/* ==========================================================================
   PASSION GLAM - STYLES.CSS (v3.2)
   Estética Lujo Minimalista, Paleta de Colores y Modal Apilado Responsivo
   ========================================================================== */

:root {
    --bg-color: #FFFFFF;
    --text-main: #1A1A1A;          /* Negro Azabache */
    --accent-gold: #D4AF37;        /* Dorado de Lujo Principal */
    --accent-color: #C58F84;       /* Oro Rosa / Rosa Nude */
    --accent-light: #F4E8E1;       /* Tono Crema / Marfil suave */
    --light-gray: #F8F9FA;
    --border-color: #E5E5E5;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 5px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Lato', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, .logo-text {
    font-family: 'Playfair Display', serif;
}

section, header, footer {
    scroll-margin-top: 90px;
}

/* ==========================================================================
   CABECERA, LOGO Y NAVEGACIÓN (NAVBAR)
   ========================================================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 5%;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 500;
    box-shadow: var(--shadow-light);
}

.logo-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img {
    height: 45px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

.logo-brand:hover .logo-img {
    transform: scale(1.06);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-main);
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--accent-gold);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-icon {
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-main);
    transition: var(--transition);
}

.header-icon:hover {
    color: var(--accent-gold);
}

.user-menu-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.user-icon-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-main);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 130%;
    right: 0;
    background: #FFFFFF;
    min-width: 190px;
    box-shadow: var(--shadow-medium);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    border-bottom: 1px solid #F0F0F0;
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background: var(--light-gray);
    color: var(--accent-gold);
    padding-left: 20px;
}

.cart-icon-wrapper {
    position: relative;
    cursor: pointer;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--accent-gold);
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: bold;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-menu-btn {
    display: none;
}

/* ==========================================================================
   BARRA DE BÚSQUEDA FLOTANTE
   ========================================================================== */
.search-bar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
    padding: 1rem 5%;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 70px;
    z-index: 490;
    box-shadow: var(--shadow-light);
    gap: 1rem;
    flex-wrap: wrap;
}

.search-bar-container input {
    flex: 1;
    min-width: 250px;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.search-bar-container input:focus {
    border-color: var(--accent-gold);
}

.filter-pills-container {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--light-gray);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.filter-pill.active, .filter-pill:hover {
    background: var(--accent-gold);
    color: #FFFFFF;
    border-color: var(--accent-gold);
}

.search-close {
    font-size: 1.2rem;
    cursor: pointer;
    color: #888;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
    text-align: center;
    padding: 5rem 1rem;
    background: linear-gradient(135deg, #FAF6F0 0%, #FFF5F3 100%);
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 0.8rem;
    color: var(--text-main);
}

.hero p {
    font-size: 1.1rem;
    color: #555;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

/* ==========================================================================
   BOTONES Y ELEMENTOS COMUNES
   ========================================================================== */
button {
    cursor: pointer;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary {
    background: var(--text-main);
    color: #FFFFFF;
    border: 1px solid var(--text-main);
    padding: 10px 20px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-main);
    color: var(--text-main);
    padding: 10px 20px;
}

.btn-secondary:hover {
    background: var(--text-main);
    color: #FFFFFF;
}

.full-width {
    width: 100%;
}

/* ==========================================================================
   SECCIONES DEL CATÁLOGO & CARRUSELES
   ========================================================================== */
.catalog-section {
    padding: 2.5rem 5%;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 50%;
    height: 3px;
    background: var(--accent-gold);
    bottom: -5px;
    left: 0;
}

.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.carousel-btn {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    z-index: 10;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.carousel-btn.prev { left: -15px; }
.carousel-btn.next { right: -15px; }
.carousel-btn:hover { background: var(--accent-gold); color: #FFF; border-color: var(--accent-gold); }

.product-grid {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 5px;
    scroll-padding: 20px;
}

.product-grid::-webkit-scrollbar {
    display: none;
}

/* TARJETAS DE PRODUCTO */
.product-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    min-width: 240px;
    max-width: 240px;
    flex: 0 0 auto;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-gold);
}

.product-img {
    position: relative;
    height: 220px;
    background: var(--light-gray);
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img img {
    transform: scale(1.05);
}

.product-info {
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.product-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.product-info p {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.8rem;
}

.out-of-stock-card {
    opacity: 0.7;
}

.out-of-stock-card img {
    filter: grayscale(1);
}

/* ==========================================================================
   MODALES Y CONTENEDOR FLEX (NUEVO DISEÑO APILADO)
   ========================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    backdrop-filter: blur(3px);
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #FFFFFF;
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    color: #DC3545;
}

/* CONTENEDOR MODAL PRODUCTO: COLUMNAS */
.modal-flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.modal-img-column {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-img-column img {
    width: 100%;
    border-radius: 12px;
    object-fit: contain;
    background: #FAFAFA;
}

#modal-img {
    max-height: 400px;
}

#modal-notes-img {
    max-height: 350px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.03);
}

.modal-details-column {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

.compact-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 10px;
}

.price-display {
    color: var(--accent-gold);
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: bold;
}

/* SELECTOR DE DECANTS EN MODAL PRODUCTO */
.size-selector {
    margin-bottom: 25px;
}

.size-selector label {
    font-weight: 700;
    display: block;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--text-main);
}

.pill-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.size-pill {
    padding: 8px 18px;
    border: 2px solid var(--border-color);
    background: #FFFFFF;
    border-radius: 20px;
    font-weight: bold;
    color: var(--text-main);
    transition: var(--transition);
}

.size-pill.active {
    background: var(--text-main);
    color: #FFFFFF;
    border-color: var(--text-main);
}

.size-pill:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #F8F9FA;
}

/* ACCIONES MODAL PRODUCTO (CANTIDAD Y CARRITO) */
.modal-actions-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.qty-selector {
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.qty-selector button {
    padding: 12px 18px;
    background: #F8F9FA;
    border-radius: 0;
    font-size: 1.2rem;
    color: var(--text-main);
}

.qty-selector button:hover {
    background: #E5E5E5;
}

.qty-selector input {
    width: 60px;
    text-align: center;
    border: none;
    font-weight: bold;
    font-size: 1.1rem;
    outline: none;
    background: #fff;
    color: var(--text-main);
}

.flex-grow {
    flex-grow: 1;
    padding: 16px;
    font-size: 1.1rem;
    border-radius: 8px;
}

/* ==========================================================================
   PANEL LATERAL DEL CARRITO (DRAWER)
   ========================================================================== */
.cart-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

.cart-drawer-overlay.active {
    display: block;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 380px;
    height: 100%;
    background: #FFFFFF;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.35s cubic-bezier(0.77, 0, 0.175, 1);
}

.cart-drawer.active {
    right: 0;
}

.cart-drawer-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--text-main);
    color: #fff;
}

.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-drawer-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--light-gray);
}

.cart-subtotal-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
    background: var(--text-main);
    color: #FFFFFF;
    text-align: center;
    padding: 40px 20px;
}

.footer-content {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.footer-col h4 {
    color: var(--accent-gold);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.footer-col p {
    color: #ccc;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

/* ==========================================================================
   MEDIA QUERIES (ADAPTACIÓN A CELULARES Y TABLETS)
   ========================================================================== */
@media (max-width: 768px) {
    .navbar {
        padding: 0.8rem 4%;
    }

    .logo-img {
        height: 38px;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #FFFFFF;
        flex-direction: column;
        padding: 1.5rem 0;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-medium);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .product-grid {
        gap: 1rem;
    }

    .product-card {
        min-width: 180px;
        max-width: 180px;
    }

    .product-img {
        height: 170px;
    }

    button, .size-pill, .filter-pill {
        padding: 12px 16px;
    }

    .carousel-btn {
        display: none;
    }

    /* Ajuste Modal Producto en Móvil */
    .modal-flex-container {
        flex-direction: column;
        gap: 20px;
    }

    .modal-img-column {
        min-width: 100%;
    }

    .modal-details-column {
        min-width: 100%;
    }

    .modal-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .qty-selector {
        justify-content: center;
    }
    
    /* ==========================================================================
   ADAPTACIÓN A CELULARES DE LA TIENDA PÚBLICA (RESPONSIVE WEB)
   ========================================================================== */
@media (max-width: 768px) {
    /* La cabecera se reordena */
    .navbar {
        padding: 0.8rem 4%;
    }

    .logo-img {
        height: 38px;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    /* El menú pasa a ser el clásico de 3 rayitas (Hamburguesa) */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #FFFFFF;
        flex-direction: column;
        padding: 0;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-medium);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
        display: block;
        width: 100%;
        text-align: center;
    }

    .mobile-menu-btn {
        display: block; /* Muestra el icono de 3 rayas */
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .product-grid {
        gap: 1rem;
    }

    .product-card {
        min-width: 180px;
        max-width: 180px;
    }

    .product-img {
        height: 170px;
    }

    /* Ajuste de Botones en móvil */
    button, .size-pill, .filter-pill {
        padding: 12px 16px;
    }

    .carousel-btn {
        display: none; /* En celular es mejor deslizar con el dedo (swipe) nativo */
    }

    /* Ajuste Modal Producto (Las imágenes y la info se apilan 100%) */
    .modal-flex-container {
        flex-direction: column;
        gap: 15px;
    }

    .modal-img-column, .modal-details-column {
        min-width: 100%;
    }

    .modal-actions-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .qty-selector {
        justify-content: space-between;
        width: 100%;
    }
    
    .qty-selector input {
        flex: 1;
    }

    /* Carrito lateral a pantalla completa */
    .cart-drawer {
        max-width: 100%;
    }

    /* Pie de página apilado */
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
}
}