/* =========================================
   1. CONTENEDORES PRINCIPALES
   ========================================= */
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 40px 20px; 
}

/* =========================================
   2. HEADER (Estructura)
   ========================================= */
header { 
    position: sticky; 
    top: 0; 
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px); 
    z-index: 1000; 
    border-bottom: 1px solid rgba(0,0,0,0.05); 
    height: 60px; 
    display: flex; 
    align-items: center; 
}

.navbar { 
    width: 100%; 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Menú Central (Desktop) */
.nav-links { 
    display: flex; 
    gap: 25px; 
}

.nav-links a { 
    font-size: 0.9rem; 
    color: #86868b; 
    transition: 0.2s; 
    text-decoration: none;
}

.nav-links a:hover { 
    color: #1d1d1f; 
}

/* Logo */
.logo { 
    font-weight: 600; 
    font-size: 1.3rem; 
    letter-spacing: -0.5px; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    color: #1d1d1f;
}

/* Iconos (Carrito y Menú) */
.cart-icon-wrap, .menu-toggle { 
    position: relative; 
    cursor: pointer; 
    padding: 5px; 
    color: #1d1d1f;
}

.cart-count { 
    position: absolute; 
    top: -2px; 
    right: -5px; 
    background: #ff3b30; 
    color: white; 
    font-size: 0.7rem; 
    width: 16px; 
    height: 16px; 
    border-radius: 50%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-weight: 600; 
}

/* =========================================
   3. FOOTER (Estructura de Rejilla)
   ========================================= */
footer { 
    background: #fff; 
    padding: 60px 20px 20px; 
    margin-top: 60px; 
    border-top: 1px solid #e5e5e5; 
}

.footer-content { 
    max-width: 1200px; 
    margin: 0 auto; 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 40px; 
}

.footer-col h4 { 
    margin-bottom: 20px; 
    font-size: 0.9rem; 
    font-weight: 600; 
    text-transform: uppercase; 
    color: #1d1d1f; 
}

.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 12px; }

.footer-col ul li a { 
    color: #86868b; 
    font-size: 0.9rem; 
    transition: 0.2s; 
    text-decoration: none;
}

.footer-col ul li a:hover { 
    color: #1d1d1f; 
    text-decoration: underline; 
}

.footer-bottom { 
    text-align: center; 
    margin-top: 50px; 
    padding-top: 20px; 
    border-top: 1px solid #e5e5e5; 
    font-size: 0.8rem; 
    color: #86868b; 
}

/* =========================================
   4. SIDEBARS (CARRITO Y MENÚ DE NAVEGACIÓN)
   ========================================= */

/* Base común para ambos sidebars */
.cart-sidebar, .right-nav-sidebar { 
    position: fixed; 
    top: 0; 
    right: -100%; /* Oculto a la derecha */
    height: 100%; 
    max-height: 100vh;
    background: white; 
    transition: right 0.4s cubic-bezier(0.19, 1, 0.22, 1); 
    display: flex; 
    flex-direction: column; 
}

/* Sidebar Carrito */
.cart-sidebar {
    width: 420px; 
    max-width: 100vw;
    z-index: 3000; 
    box-shadow: -10px 0 40px rgba(0,0,0,0.1); 
}

/* Sidebar Menú Navegación (Nuevo) */
.right-nav-sidebar {
    width: 300px;
    max-width: 80vw;
    z-index: 3001; /* Encima del carrito si se solapan */
    box-shadow: -5px 0 15px rgba(0,0,0,0.15);
}

/* Estado Activo (Visible) */
.cart-sidebar.active, .right-nav-sidebar.active { 
    right: 0; 
}

/* Cabeceras de Sidebar */
.cart-header, .nav-header { 
    padding: 20px 25px; 
    border-bottom: 1px solid #f5f5f7; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-shrink: 0; 
}

.cart-header h3, .nav-header h3 { 
    font-weight: 700; 
    font-size: 1.3rem; 
    margin: 0;
    color: #1d1d1f;
}

.close-cart { 
    cursor: pointer; 
    font-size: 1.8rem; 
    line-height: 1; 
    color: #86868b; 
    transition: 0.2s;
}
.close-cart:hover { color: #1d1d1f; }

/* Cuerpos con Scroll */
.cart-body, .nav-body { 
    flex: 1; 
    overflow-y: auto; 
    padding: 25px; 
}

/* Footer del Carrito */
.cart-footer { 
    padding: 30px; 
    border-top: 1px solid #e5e5e5; 
    background: #fbfbfd; 
    flex-shrink: 0; 
}

/* =========================================
   5. RESPONSIVE (MÓVIL)
   ========================================= */
@media (max-width: 768px) {
    /* Ocultar menú superior en móvil */
    .nav-links { 
        display: none; 
    }

    /* El botón hamburguesa se controla vía JS/Style.css, 
       pero aquí aseguramos estructura */
    .nav-right {
        gap: 20px;
    }
    
    /* Ajustar anchos de sidebar en móvil */
    .cart-sidebar { 
        width: 100%; 
    }
    .right-nav-sidebar {
        width: 85%;
    }
    
    .footer-content {
        grid-template-columns: 1fr; /* Una sola columna */
        gap: 30px;
    }
}
