/* PALETA DE COLORES (Basada en el logo "Notte & Giorno") */
:root {
    --color-bg-dark: #22201e; /* Gris muy oscuro del logo */
    --color-text-light: #d1c3b2; /* Beige/Dorado claro del logo */
    --color-accent-gold: #b8860b; /* Dorado vibrante para CTAs */
    --color-secondary-beige: #4a4540; /* Tono medio para fondos secundarios */
    --color-border-dark: #3a3835; /* Borde oscuro */
    --font-serif: 'Playfair Display', serif; /* Fuente elegante */
    --font-sans: 'Roboto', sans-serif; /* Fuente limpia */
}

/* RESET Y ESTILOS GLOBALES */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    background-color: var(--color-bg-dark); 
    color: var(--color-text-light); 
}

a {
    text-decoration: none;
    color: var(--color-text-light);
}

/* ESTILO CTA GENÉRICO */
.cta-button {
    display: inline-block;
    background-color: var(--color-accent-gold); 
    color: var(--color-bg-dark); 
    padding: 10px 30px;
    border-radius: 5px;
    text-transform: uppercase;
    font-weight: bold;
    transition: background-color 0.3s;
}

.cta-button:hover {
    background-color: #a37209; 
}

/* ---------------------------------------------------- */
/* 1. CABECERA (HEADER) Y NAVEGACIÓN */
/* ---------------------------------------------------- */
header {
    background-color: var(--color-bg-dark);
    border-bottom: 1px solid var(--color-border-dark);
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    position: relative; 
}

.logo {
    flex-grow: 1; 
    text-align: center;
}

.logo a {
    font-family: var(--font-serif);
    font-size: 1.7rem;
    font-weight: bold;
    color: var(--color-text-light);
    text-transform: uppercase;
}

.header-left-elements, .header-right-icons {
    display: flex;
    align-items: center;
    min-width: 100px; 
}

.header-right-icons {
    justify-content: flex-end; 
}

.header-right-icons button {
    background: none;
    border: none;
    font-size: 1.25rem;
    margin-left: 10px;
    cursor: pointer;
    color: var(--color-text-light);
    position: relative; 
}

/* Contador de carrito */
#cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--color-accent-gold);
    color: var(--color-bg-dark);
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
    padding: 2px 5px;
    line-height: 1;
}

/* Menú Móvil */
.menu-toggle {
    display: block; 
    font-size: 1.5rem;
}
.desktop-nav {
    display: none; 
}

.mobile-nav {
    display: none;
    background-color: var(--color-secondary-beige);
    position: absolute;
    width: 100%;
    left: 0;
    padding: 10px 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.mobile-nav.open {
    display: block;
}

.mobile-nav ul {
    list-style: none;
}

.mobile-nav li a {
    display: block;
    padding: 10px 20px;
    color: var(--color-text-light);
}

.mobile-nav li a:hover {
    background-color: var(--color-border-dark);
}

/* ---------------------------------------------------- */
/* 2. ESTILOS DE LA PÁGINA DE ROPA (CATÁLOGO) */
/* ---------------------------------------------------- */
.clothing-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page-title {
    font-family: var(--font-serif);
    text-align: center;
    margin-bottom: 30px;
    color: var(--color-text-light);
}

/* BARRA DE BÚSQUEDA Y FILTROS */
.search-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--color-border-dark);
    margin-bottom: 20px;
    flex-wrap: wrap; 
}

.search-input-container {
    flex-grow: 1;
    position: relative;
    max-width: 300px;
}

.search-input {
    width: 100%;
    padding: 8px 10px 8px 35px;
    border: 1px solid var(--color-secondary-beige);
    border-radius: 5px;
    background-color: var(--color-secondary-beige);
    color: var(--color-text-light);
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.toggle-filters-btn {
    display: block; 
    background-color: var(--color-secondary-beige);
    color: var(--color-text-light);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
}

.sort-dropdown {
    display: none; 
}

/* CONTENIDO PRINCIPAL: FILTROS Y PRODUCTOS */
.clothing-main-content {
    display: flex;
    gap: 30px;
}

/* FILTROS (Sidebar) */
.filters-sidebar {
    width: 250px;
    padding: 20px;
    background-color: var(--color-bg-dark); 
    border-right: 1px solid var(--color-border-dark);
    display: none; 
}

.filter-group {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--color-border-dark);
}

.filter-group h4 {
    color: var(--color-accent-gold);
    margin-bottom: 10px;
    font-family: var(--font-serif);
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.95rem;
    cursor: pointer;
}

/* --- INICIO DE LA MODIFICACIÓN CSS --- */

/* PRODUCTOS (Grid) */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    flex-grow: 1;
}

.product-card-item {
    background-color: var(--color-secondary-beige);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    text-align: center;
    cursor: pointer;
    position: relative;
    height: 320px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* Pseudo-elemento para el gradiente oscuro de fondo */
.product-card-item::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    z-index: 1;
    border-radius: 0 0 8px 8px;
}

.product-img {
    display: block; 
    width: 100%;
    height: 100%;
    object-fit: cover; 
    transition: transform 0.3s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.product-card-item:hover .product-img {
    transform: scale(1.05);
}

/* Contenedor para los detalles del producto */
.product-details-container {
    position: relative;
    z-index: 2;
    padding: 10px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.product-name {
    font-weight: bold;
    margin: 0;
    height: 3.2em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.6em;
}

.product-price {
    color: var(--color-accent-gold);
    font-size: 1.1rem;
    margin: 0;
}

.quick-view-btn {
    background-color: rgba(34, 32, 30, 0.8);
    color: var(--color-text-light);
    border: 1px solid var(--color-border-dark);
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 5px;
    width: auto;
}

.quick-view-btn:hover {
    background-color: var(--color-bg-dark);
}

/* --- FIN DE LA MODIFICACIÓN CSS --- */


/* ---------------------------------------------------- */
/* 3. MODAL DE DETALLES DEL PRODUCTO Y ANIMACIONES */
/* ---------------------------------------------------- */

.product-modal {
    display: none; 
    position: fixed;
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.0);
    transition: background-color 0.3s ease-in-out;
}

.product-modal.show {
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    background-color: var(--color-secondary-beige);
    margin: 10vh auto; 
    padding: 30px;
    width: 90%;
    max-width: 900px; 
    border-radius: 10px;
    position: relative;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}

@keyframes fadeInScaleUp {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeOutScaleDown {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}

.product-modal.show .modal-content {
    animation: fadeInScaleUp 0.3s ease-out forwards;
}

.product-modal.hide .modal-content {
    animation: fadeOutScaleDown 0.3s ease-in forwards;
}

.modal-body {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.modal-image, .modal-details {
    flex: 1 1 45%; 
}

.modal-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.modal-details h2 {
    font-family: var(--font-serif);
    color: var(--color-text-light);
    margin-bottom: 10px;
}

.modal-price {
    font-size: 1.8rem;
    color: var(--color-accent-gold);
    margin-bottom: 15px;
    font-weight: bold;
}

/* ---------------------------------------------------- */
/* 4. CARRITO MODAL (CHECKOUT) - AJUSTES FINALES */
/* ---------------------------------------------------- */
.cart-modal {
    display: none; 
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.0); 
    transition: background-color 0.3s;
}

.cart-modal.visible {
    display: block;
    background-color: rgba(0,0,0,0.6);
}

.cart-content {
    background-color: var(--color-secondary-beige);
    margin: 15% auto; 
    padding: 20px;
    border: 1px solid var(--color-border-dark);
    width: 90%; 
    max-width: 450px; 
    border-radius: 10px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    color: var(--color-text-light);
}

.cart-content h3 {
    font-family: var(--font-serif);
    color: var(--color-text-light);
    margin-bottom: 15px;
    text-align: center;
    border-bottom: none; 
}

.cart-content p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.cart-total {
    border-top: none; 
    padding-top: 10px;
    margin-top: 10px;
    text-align: right;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--color-accent-gold);
}

.shipping-options {
    border-top: 1px solid var(--color-border-dark); 
    padding-top: 15px;
    margin-top: 15px;
    text-align: left;
}

footer {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--color-border-dark);
    margin-top: 50px;
}

footer img {
    width: 250px;
    filter: invert(75%)
}

footer hr {
    border: 0;
    height: 1px;
    background: var(--color-border-dark);
    margin: 15px 0;
}

/* ---------------------------------------------------- */
/* 5. ADAPTACIÓN A MÓVIL (CORRECCIÓN CRÍTICA DE MODAL) */
/* ---------------------------------------------------- */
@media (max-width: 767px) {
    
    .product-modal .modal-body {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 20px;
    }

    .product-modal .modal-image,
    .product-modal .modal-details {
        flex: 1 1 100%;
    }

    .product-modal .modal-content {
        padding: 20px;
        margin: 5vh auto;
    }

    .filters-modal {
        display: none;
        position: fixed;
        z-index: 2100;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .filters-modal.visible {
        display: block;
    }

    .filters-modal-overlay {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.45);
        backdrop-filter: blur(2px);
        opacity: 0;
        transition: opacity 0.3s ease-out;
    }
    .filters-modal.visible .filters-modal-overlay {
        opacity: 1;
    }

    @keyframes fadeInUp {
        from { opacity: 0; transform: translate(-50%, -30%); }
        to { opacity: 1; transform: translate(-50%, -50%); }
    }

    @keyframes fadeOutDown {
        from { opacity: 1; transform: translate(-50%, -50%); }
        to { opacity: 0; transform: translate(-50%, -30%); }
    }

    .filters-modal-content {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -30%);
        width: 90%; 
        max-width: 320px; 
        height: auto; 
        background: var(--color-bg-dark);
        box-shadow: 0 18px 50px rgba(0,0,0,0.65);
        padding: 20px; 
        border-radius: 10px;
        opacity: 0;
        transition: none;
    }
    
    .filters-modal.visible .filters-modal-content {
        animation: fadeInUp 0.3s ease-out forwards;
    }

    .filters-modal.hiding .filters-modal-content {
        animation: fadeOutDown 0.3s ease-in forwards;
    }

    .filters-modal-close {
        position: absolute;
        right: 14px;
        top: 10px;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--color-text-light);
        cursor: pointer;
        padding: 6px 8px;
        text-decoration: none; 
    }
    
    .filters-modal-body {
        overflow-y: auto; 
        padding: 0; 
        margin-top: 0;
        width: 100%; 
    }

    .filters-modal-body .filters-sidebar {
        display: block;
        width: 100%;
        background: transparent;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }
}

/* ADAPTACIÓN A ESCRITORIO */
@media (min-width: 768px) {
    .header-container { justify-content: flex-start; }
    .menu-toggle { display: none; }
    .desktop-nav { display: block; }
    .desktop-nav ul { list-style: none; display: flex; padding-left: 0; }
    .desktop-nav li a { padding: 0 15px; }
    
    .logo {
        position: absolute; 
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%); 
        flex-grow: 0; 
    }
    
    .header-right-icons { margin-left: auto; }
    .header-left-elements { min-width: 300px; }
    .header-right-icons { min-width: 300px; }

    .toggle-filters-btn { display: none; }
    .sort-dropdown { display: block; }
    .filters-sidebar { display: block; min-width: 250px; flex-shrink: 0; }
    
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    
    .modal-body { flex-wrap: nowrap; } 
    
    .cart-content { margin: 10vh auto; }
}
