/* Estilos específicos para la página de Productos */

.products-page .section-header {
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.products-page h1 {
    color: var(--brand-blue);
    font-size: 2.5rem;
    font-weight: 800;
}

.page-search {
    max-width: 300px;
    width: 100%;
}

.page-search input {
    width: 100%;
    padding: 12px 20px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    outline: none;
    transition: all 0.3s;
}

.page-search input:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 10px rgba(51, 67, 178, 0.1);
}

/* Layout con Filtros */
.products-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

.filters-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
}

.filter-group h3 {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: var(--brand-blue);
    font-weight: 800;
    letter-spacing: -0.5px;
    position: relative;
    padding-bottom: 10px;
}

.filter-group h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--brand-green);
    border-radius: 10px;
}

.filter-group ul {
    list-style: none;
    padding: 0;
}

/* Botón 'Todas las categorías' - Diseño Premium */
.btn-todas {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 20px;
    font-weight: 700;
    background: #f8f9fa;
    color: var(--brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #edf2f7;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.btn-todas:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-color: var(--brand-green);
}

.btn-todas.active {
    background: linear-gradient(135deg, var(--brand-green) 0%, #48bb78 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(72, 187, 120, 0.2);
}

/* Acordeón de Categorías Premium */
.category-accordion-item {
    margin-bottom: 10px;
}

.cat-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: white;
    border: 1px solid #f0f4f8;
    border-radius: 14px;
    font-weight: 600;
    color: var(--brand-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cat-parent::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: var(--brand-green);
    transition: width 0.3s ease;
    opacity: 0.1;
}

.cat-parent:hover {
    border-color: var(--brand-green);
    background: #fafdff;
    transform: translateX(5px);
}

.cat-parent:hover::before {
    width: 100%;
}

.cat-parent.active {
    background: #f0fff4;
    border-color: var(--brand-green);
    color: var(--brand-green);
}

.cat-parent.active .cat-name {
    font-weight: 700;
}

.toggle-area .sub-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, var(--brand-green), #48bb78);
    color: white;
    border-radius: 50%;
    font-size: 0.62rem;
    font-weight: 900;
    flex-shrink: 0;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    animation: pulse-sub-badge 2.5s ease-in-out infinite;
}

@keyframes pulse-sub-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.5); }
    55%       { box-shadow: 0 0 0 6px rgba(72, 187, 120, 0); }
}

.cat-parent.open .toggle-area .sub-indicator {
    transform: rotate(45deg);
    animation: none;
    box-shadow: none;
}

.cat-name {
    flex-grow: 1;
    z-index: 1;
}

.toggle-area {
    padding: 4px 0 4px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.sub-menu {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    padding-left: 15px;
    visibility: hidden;
}

.sub-menu-inner {
    min-height: 0;
    padding: 5px 0 15px 15px;
    border-left: 2px solid #e2e8f0;
    margin-left: 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cat-parent.open + .sub-menu {
    grid-template-rows: 1fr;
    visibility: visible;
}

.cat-child {
    padding: 10px 15px;
    font-size: 0.9rem;
    color: #718096;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cat-child:hover {
    color: var(--brand-green);
    background: #f0fff4;
    padding-left: 20px;
}

.cat-child.active {
    font-weight: 700;
    color: var(--brand-green);
    background: #f0fff4;
    padding-left: 20px;
}

/* Paginación */
.products-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.pagination-container {
    padding: 20px 0;
    display: flex;
    justify-content: center;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.btn-secondary {
    padding: 12px 40px;
    border-radius: 50px;
    background: var(--brand-blue);
    border: 1px solid var(--brand-blue);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-secondary:hover {
    background: white;
    color: var(--brand-green);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(97, 206, 112, 0.2);
}

/* Botón de Filtros Móvil */
.btn-mobile-filters {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000; /* Asegurar que esté por encima de todo */
    background: var(--brand-blue);
    color: white;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Grilla de Catálogo (3 Desktop / 2 Mobile) */
.grid-catalog {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

@media (max-width: 1024px) {
    .grid-catalog {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .grid-catalog {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Breadcrumbs (Migas de Pan) */
.breadcrumbs {
    margin-bottom: 25px;
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.breadcrumb-item {
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-light);
}

.breadcrumb-item:hover {
    color: var(--brand-green);
}

.breadcrumb-item.active {
    font-weight: 600;
    color: var(--brand-dark);
    cursor: default;
}

.separator {
    color: #ccc;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 992px) {
    .products-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .btn-mobile-filters {
        display: flex !important; /* Forzar visibilidad en mobile */
    }
    
    .btn-mobile-filters:active {
        transform: scale(0.9);
    }

    /* Ocultar el sidebar original en mobile y convertirlo en un Overlay/Drawer */
    .filters-sidebar {
        position: fixed;
        left: -110%; /* Oculto */
        top: 0;
        width: 85%;
        max-width: 320px;
        height: 100%;
        background: white;
        z-index: 1001;
        transition: left 0.5s cubic-bezier(0.77, 0, 0.175, 1);
        padding: 40px 25px;
        box-shadow: 15px 0 40px rgba(0,0,0,0.15);
        overflow-y: auto;
        border-radius: 0 30px 30px 0;
        border: none;
        backdrop-filter: none; /* No blur on the drawer for better performance/clarity */
    }

    .filters-sidebar.active {
        left: 0;
    }

    /* Fondo oscuro al abrir menú */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(4px);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: all 0.4s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .filter-group h3 {
        display: block;
        font-size: 1.5rem;
        margin-bottom: 30px;
        color: var(--brand-blue);
    }

    .products-page .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 25px;
    }

    .page-search {
        max-width: 100%;
    }

    .products-page h1 {
        font-size: 1.8rem;
    }

    /* Breadcrumbs compactos en mobile */
    .breadcrumbs {
        padding: 12px 20px;
        background: #f8f9fa;
        border: 1px solid #edf2f7;
        font-size: 0.8rem;
        margin-bottom: 20px;
        gap: 5px;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* -------------------------------------------------------------------
   Estilo Interior de los Options (Selects Premium - Minimalista)
------------------------------------------------------------------- */
.custom-premium-select {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.custom-premium-select option {
    background-color: #ffffff;
    color: #334155; /* Gris pizarron muy elegante */
    font-weight: 500;
    font-family: inherit;
    font-size: 0.95rem; 
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0,0,0,0.03); /* Casi imperceptible */
    transition: background 0.2s ease;
}

/* El primer option (Placeholder) */
.custom-premium-select option:first-child {
    background-color: #f8fafc;
    color: #94a3b8; /* Gris muy clarito */
    font-style: italic;
    font-weight: 500;
}

/* Hover o Clickeado (Selección activa suave y corporativa) */
.custom-premium-select option:checked,
.custom-premium-select option:hover,
.custom-premium-select option:focus {
    background-color: #f0f9ff !important; /* Celostito hielo muy suave */
    color: var(--brand-blue) !important;
    font-weight: 600;
}