/* assets/css/style.css - VERSIÓN MAESTRA */

/* --- 1. VARIABLES Y FUENTES --- */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

:root {
    --bg-body: #ffffff;
    --text-main: #1c1c1c;
    --text-light: #666666;
    --accent: #bfa05f; /* Dorado Premium */
    --border: #e5e5e5;
    --light-gray: #f9f9f9;
    --header-bg: rgba(255, 255, 255, 0.98);
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
}

/* --- 2. RESET GLOBAL --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background: var(--bg-body);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; }
img { max-width: 100%; display: block; height: auto; }
button, input { font-family: inherit; }

/* --- 3. UTILIDADES --- */
.container { max-width: 1400px; margin: 0 auto; padding: 0 4%; }
.text-center { text-align: center; }
.section-header { margin: 60px 0 40px; text-align: center; }
.section-title { font-family: var(--font-heading); font-size: 2.5rem; margin-bottom: 10px; font-weight: 400; }
.section-desc { color: var(--text-light); max-width: 600px; margin: 0 auto; }

/* Botones */
.btn {
    display: inline-block;
    padding: 15px 40px;
    background: var(--text-main);
    color: #fff;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    border: 1px solid var(--text-main);
    cursor: pointer;
    font-weight: 700;
    transition: 0.3s;
}
.btn:hover { background: transparent; color: var(--text-main); }
.btn-outline { background: transparent; color: #fff; border: 1px solid #fff; }
.btn-outline:hover { background: #fff; color: var(--text-main); }
.btn-full { width: 100%; text-align: center; }

/* --- 4. HEADER Y NAVEGACIÓN --- */
header {
    padding: 15px 0;
    position: sticky;
    top: 0;
    background: var(--header-bg);
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: 0.3s;
    box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}

.header-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}
.logo img { max-height: 45px; }

/* Menú Escritorio */
.nav-desktop { display: flex; gap: 30px; align-items: center; }
.menu-item { position: relative; padding: 10px 0; }
.menu-link { 
    font-size: 0.8rem; 
    text-transform: uppercase; 
    letter-spacing: 1.5px; 
    font-weight: 600; 
    color: #111;
}
.menu-link:hover { color: var(--accent); }

/* Dropdown Submenú */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: -20px;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    padding: 15px 0;
    z-index: 1001;
    border: 1px solid #eee;
}
.menu-item:hover .dropdown-menu { display: block; animation: fadeIn 0.3s; }
.dropdown-item {
    display: block;
    padding: 10px 25px;
    font-size: 0.85rem;
    color: #555;
    border-bottom: 1px solid #f9f9f9;
}
.dropdown-item:hover { background: #fcfcfc; color: var(--accent); padding-left: 30px; }

/* Iconos Derecha */
.nav-right { display: flex; justify-content: flex-end; align-items: center; gap: 20px; }
.cart-icon { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

/* --- 5. MENÚ MÓVIL (HAMBURGUESA) --- */
.hamburger { display: none; font-size: 1.5rem; cursor: pointer; padding: 5px; }
.nav-mobile-overlay {
    display: none;
    position: fixed;
    top: 60px; /* Debajo del header */
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: #fff;
    z-index: 999;
    flex-direction: column;
    padding: 30px;
    overflow-y: auto;
    border-top: 1px solid #eee;
}
.nav-mobile-overlay.active { display: flex; }
.mobile-link {
    font-size: 1.2rem;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #111;
    font-family: var(--font-heading);
}
.mobile-sublink {
    font-size: 1rem;
    padding: 10px 0 10px 20px;
    color: #666;
    display: block;
}

/* --- 6. HERO SECTION --- */
.hero {
    height: 80vh;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    margin-bottom: 60px;
}
.hero::before {
    content: ''; position: absolute; top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.3); /* Velo oscuro */
}
.hero-content { position: relative; z-index: 2; max-width: 800px; padding: 20px; }
.hero-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    margin-bottom: 20px;
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.hero-subtitle {
    font-size: 1.2rem; margin-bottom: 40px; letter-spacing: 1px; font-weight: 300;
}
.hero-search input {
    background: transparent; border: none; border-bottom: 1px solid #fff;
    color: #fff; padding: 10px; width: 300px; text-align: center; font-size: 1.1rem;
}
.hero-search input::placeholder { color: rgba(255,255,255,0.7); }
.hero-search input:focus { outline: none; border-color: var(--accent); }

/* --- 7. TARJETAS DE PRODUCTO --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px 20px;
    margin-bottom: 60px;
}
.product-card { position: relative; }
.product-image-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3/4;
    background: var(--light-gray);
    margin-bottom: 15px;
}
.product-img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.7s ease;
}
.product-card:hover .product-img { transform: scale(1.05); }

.product-meta { text-align: center; }
.product-cat { font-size: 0.7rem; text-transform: uppercase; color: #999; margin-bottom: 5px; letter-spacing: 1px; }
.product-name { font-family: var(--font-heading); font-size: 1.1rem; margin-bottom: 5px; color: var(--text-main); }
.product-price { font-weight: 700; font-size: 0.95rem; }

.add-btn-minimal {
    margin-top: 10px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #ddd;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding-bottom: 3px;
    cursor: pointer;
    color: #555;
    transition: 0.3s;
}
.add-btn-minimal:hover { color: var(--text-main); border-color: var(--text-main); }

/* --- 8. GALERÍA GRID (BLOQUES) --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 40px auto;
}
.gallery-item { height: 400px; overflow: hidden; }
.gallery-item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.6s ease;
}
.gallery-item:hover img { transform: scale(1.03); }

/* --- 9. FICHA DE PRODUCTO (DETAIL) --- */
.product-detail-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 60px;
    margin: 60px 0;
    align-items: start;
}
.product-gallery-wrapper { display: flex; gap: 20px; }
.thumbs-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 80px;
}
.thumb-img {
    width: 80px; height: 100px; object-fit: cover;
    cursor: pointer; opacity: 0.6; transition: 0.3s;
    border: 1px solid transparent;
}
.thumb-img.active, .thumb-img:hover { opacity: 1; border-color: var(--text-main); }

.main-img-container { flex: 1; background: var(--light-gray); overflow: hidden; }
.main-img-container img { width: 100%; height: auto; object-fit: cover; }

.product-info-detail h1 { font-family: var(--font-heading); font-size: 2.5rem; margin-bottom: 20px; line-height: 1.2; }
.detail-price { font-size: 1.5rem; margin-bottom: 30px; font-weight: 400; color: var(--text-main); }
.detail-desc { font-size: 1rem; color: #555; margin-bottom: 40px; line-height: 1.8; }
.stock-badge { display: inline-block; background: #e8f5e9; color: #2e7d32; padding: 5px 10px; font-size: 0.8rem; margin-bottom: 20px; }

/* --- 10. FOOTER --- */
footer { background: #111; color: #fff; padding: 80px 0 30px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 50px; margin-bottom: 60px; }
.footer-col h5 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 25px; color: #666; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { color: #ccc; font-size: 0.9rem; }
.footer-col a:hover { color: #fff; }
.dev-credit { border-top: 1px solid #222; padding-top: 30px; text-align: center; color: #555; font-size: 0.8rem; }

/* --- 11. RESPONSIVE QUERIES --- */
@media (max-width: 900px) {
    .container { padding: 0 20px; }
    .header-grid { grid-template-columns: auto 1fr auto; gap: 10px; padding: 0 20px; }
    
    /* Mostrar hamburguesa, ocultar menú escritorio */
    .hamburger { display: block; }
    .nav-desktop { display: none; }
    .nav-right { gap: 10px; }
    
    .hero { height: 60vh; }
    .hero-title { font-size: 2.5rem; }
    
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    
    .gallery-grid { grid-template-columns: 1fr; gap: 10px; }
    .gallery-item { height: 300px; }
    
    .product-detail-grid { grid-template-columns: 1fr; gap: 30px; }
    .product-gallery-wrapper { flex-direction: column-reverse; }
    .thumbs-list { flex-direction: row; width: 100%; overflow-x: auto; }
    .thumb-img { width: 60px; height: 60px; flex-shrink: 0; }
    
    .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 30px; }
}

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

/* --- SECCIÓN DE CARACTERÍSTICAS (FEATURES) --- */
.features-section {
    background-color: var(--light-gray); /* Fondo gris suave */
    padding: 80px 0;
    margin-top: 60px;
    border-top: 1px solid var(--border);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Columnas iguales */
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4%;
}

.feature-box {
    background: #ffffff;
    padding: 40px 30px;
    text-align: center;
    border: 1px solid transparent; /* Borde invisible por defecto */
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.feature-box:hover {
    transform: translateY(-5px); /* Se eleva un poco */
    box-shadow: 0 15px 30px rgba(0,0,0,0.05); /* Sombra elegante */
    border-color: var(--accent); /* Borde dorado al pasar el ratón */
}

.feature-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 20px;
    color: var(--accent); /* Color Dorado */
}

.feature-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 1.5; /* Líneas finas y elegantes */
}

.feature-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    color: var(--text-main);
}

.feature-desc {
    font-size: 0.9rem;
    color: #777;
    line-height: 1.6;
    max-width: 250px;
    margin: 0 auto;
}

/* Adaptación Móvil */
@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: 1fr; /* 1 columna en móvil */
        gap: 20px;
    }
    .feature-box {
        padding: 30px;
        flex-direction: row; /* En móvil, icono a la izquierda */
        text-align: left;
        gap: 20px;
        align-items: center;
        justify-content: flex-start;
    }
    .feature-icon {
        width: 40px; 
        height: 40px; 
        margin-bottom: 0; 
        flex-shrink: 0;
    }
    .feature-desc { margin: 0; max-width: 100%; }
}
/* --- EFECTO PULSACIÓN (LATIDO) --- */
@keyframes redPulse {
    0% { 
        transform: scale(1); 
        color: #333; /* Color normal */
        text-shadow: 0 0 0 rgba(255, 0, 0, 0); 
    }
    50% { 
        transform: scale(1.1); /* Crece un poco más */
        color: #ff0000; /* SE PONE ROJO */
        text-shadow: 0 0 15px rgba(255, 0, 0, 0.4); /* Resplandor rojo */
    }
    100% { 
        transform: scale(1); 
        color: #333; 
        text-shadow: 0 0 0 rgba(255, 0, 0, 0); 
    }
}

.pulsing-link {
    animation: redPulse 1.5s infinite ease-in-out; /* 1.5s es un ritmo de latido cardíaco */
    font-weight: 800 !important; /* Más grueso para destacar */
}

/* --- LAYOUT TIENDA CON SIDEBAR --- */
.shop-layout {
    display: grid;
    grid-template-columns: 250px 1fr; /* Sidebar 250px - Productos resto */
    gap: 40px;
    margin-top: 40px;
    align-items: start;
}

.filter-sidebar {
    background: #fff;
    border-right: 1px solid #eee;
    padding-right: 30px;
}

.filter-group { margin-bottom: 30px; }
.filter-title { font-family: var(--font-heading); font-size: 1.1rem; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.filter-list li { margin-bottom: 10px; }
.filter-link { color: #666; font-size: 0.9rem; }
.filter-link:hover, .filter-link.active { color: var(--text-main); font-weight: bold; }

/* Inputs de rango de precio */
.price-inputs { display: flex; gap: 10px; margin-bottom: 10px; }
.price-inputs input { width: 100%; padding: 5px; border: 1px solid #ddd; text-align: center; }

/* --- ESTILOS DEL CARRITO (CART.PHP) --- */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 40px; }
.cart-table th { text-align: left; padding: 15px; border-bottom: 2px solid #eee; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; }
.cart-table td { padding: 20px 15px; border-bottom: 1px solid #eee; vertical-align: middle; }
.cart-img { width: 80px; height: 80px; object-fit: cover; }

.cart-summary-box {
    background: var(--light-gray);
    padding: 40px;
    text-align: right;
    max-width: 400px;
    margin-left: auto;
}
.cart-total-row { font-size: 1.5rem; font-family: var(--font-heading); margin-bottom: 20px; }

/* Responsive Filtros y Carrito */
@media (max-width: 900px) {
    .shop-layout { grid-template-columns: 1fr; }
    .filter-sidebar { border-right: none; border-bottom: 1px solid #eee; padding-bottom: 20px; margin-bottom: 30px; }
    
    /* Tabla carrito móvil */
    .cart-table thead { display: none; }
    .cart-table tr { display: block; border-bottom: 2px solid #eee; margin-bottom: 20px; }
    .cart-table td { display: flex; justify-content: space-between; align-items: center; padding: 10px; border: none; }
    .cart-table td::before { content: attr(data-label); font-weight: bold; }
    .cart-img { width: 60px; height: 60px; }
    
    .cart-summary-box { max-width: 100%; text-align: center; }
}
/* AJUSTE ESPACIADO TÍTULOS */
.section-header {
    margin-top: 0 !important; /* Fuerza que no tenga margen superior extra */
    margin-bottom: 40px;
}
/* --- CORRECCIÓN DESPLEGABLE VARIACIONES --- */
#varSelect {
    color: #111 !important; /* Texto negro forzado */
    background-color: #fff !important; /* Fondo blanco */
    border: 1px solid #ddd;
    opacity: 1 !important;
}

#varSelect option {
    color: #111;
    background: #fff;
    padding: 10px;
}
/* --- ESTILO ICONO BOLSA --- */
.cart-icon-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    color: var(--text-color);
    transition: 0.3s;
}
.cart-icon-wrapper:hover {
    color: var(--accent);
}
.cart-count {
    font-size: 0.8rem;
    font-weight: 700;
    background: #f0f0f0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -5px; /* Superponer ligeramente */
    margin-top: -10px; /* Elevar */
}
/* --- ICONO BOLSA MODERNO --- */
.cart-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: transform 0.2s ease, color 0.3s ease;
}

.cart-icon-wrapper:hover {
    color: var(--accent); /* Se pone dorado/rojo al pasar ratón */
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--text-color); /* Fondo negro */
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #fff;
}
