/**
 * NM Filters - Estilos CSS
 * Estilos personalizados para el sistema de filtros
 */

/* Contenedor principal de filtros */
.nm-filters {
    margin-bottom: 2rem;
}

/* Grupos de filtros */
.filters.parents, .filters.children {
    gap: 0 27px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filters.children {
    padding-top: 60px;
}

/* Si no hay contenedor parents, reducir el padding de children */
.nm-filters:not(:has(.filters.parents)) .filters.children {
    padding-top: 0;
}

/* Pills/Pastillas de filtro */
.filters .pill {
    font-family: 'PP Franktion Sans';
    font-size: 18px;
    display: flex;
    margin: .25em .5em .5em 0;
    padding: 10px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: background .2s;
    cursor: pointer;
    user-select: none;
    outline: none;
}

/* Estilos específicos por tipo */
.filters .parent {
    background: #C700CC;
    color: #fff;
    text-transform: uppercase;
}

.filters .child {
    background: #C6FCC8;
    color: #009A6F;
    text-transform: uppercase;
}

/* Estados activos */
.filters .parent.active {
    background: #C700CC;
    color: #fff;
}

.filters .child.active {
    background: #C6FCC8;
    color: #009A6F;
}

/* Hover effects */
.filters .pill:hover {
    opacity: .85;
}

/* Estados de accesibilidad */
.filters .pill:focus {
    box-shadow: 0 0 0 3px rgba(199, 0, 204, 0.25);
    outline: none;
}

.filters .pill[role="button"]:focus-visible {
    outline: 2px solid #C700CC;
    outline-offset: 2px;
}

/* Compatibilidad con clases nm-pill (por si se usan) */
.nm-pill {
    display: flex;
    margin: .25em .5em .5em 0;
    padding: 10px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: background .2s;
    cursor: pointer;
    user-select: none;
    outline: none;
}

.nm-pill.parent {
    background: #C700CC;
    color: #fff;
    text-transform: uppercase;
}

.nm-pill.child {
    background: #C6FCC8;
    color: #009A6F;
    text-transform: uppercase;
}

.nm-pill.parent.active {
    background: #C700CC;
    color: #fff;
}

.nm-pill.child.active {
    background: #C6FCC8;
    color: #009A6F;
}

.nm-pill:hover {
    opacity: .85;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Loader centrado con spinner en #C700CC */
.nm-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Elimina el emoji previo */
.nm-loading:before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(199, 0, 204, 0.25);
  border-top-color: #C700CC;   /* color principal */
  animation: nm-spin .6s linear infinite;
}

/* Animación del spinner */
@keyframes nm-spin {
  to { transform: rotate(360deg); }
}

/* Respeto a usuarios con reduce motion */
@media (prefers-reduced-motion: reduce) {
  .nm-loading:before {
    animation: none;
    border-color: #C700CC;
    border-top-color: #C700CC;
  }
}


/* Responsive */
@media (max-width: 798px) {
    .filters.parents, .filters.children {
        gap: 12px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filters .pill, .nm-pill {
    animation: fadeIn 0.3s ease-out;
}

/* Error state */
.nm-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 1rem;
    border-radius: 0.25rem;
    margin: 1rem 0;
}
