/* =========================================
   VARIABLES Y TOKENS DE DISEÑO
   ========================================= */
:root {
    --color-gold:        #e0aa3e;
    --color-gold-dark:   #c98f1e;
    --color-gold-hover:  #d4a02e;
    --color-red:         #d32f2f;
    --color-dark:        #111111;
    --color-dark-nav:    rgba(0, 0, 0, 0.95);
    --color-bg:          #ececec;
    --color-text:        #333333;
    --color-text-muted:  #666666;
    --color-border:      #e2e8f0;

    --font-main:         'Montserrat', sans-serif;
    --font-fallback:     'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    --bar-height:        35px;
    --nav-height:        70px;
    --offset-top:        calc(var(--bar-height) + var(--nav-height));
}

/* =========================================
   1. RESET Y ESTILOS BASE
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-family: var(--font-fallback);
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================
   2. BARRA DE ANUNCIO
   ========================================= */
.announcement-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--bar-height);
    line-height: var(--bar-height);
    background-color: rgba(224, 170, 62, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #000;
    text-align: center;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    z-index: 3001;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* =========================================
   3. NAVBAR
   ========================================= */
.navbar-top {
    position: fixed;
    top: var(--bar-height);
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: var(--color-dark-nav);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 50px;
    z-index: 2000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.nav-logo-left {
    position: absolute;
    left: 50px;
    display: flex;
    align-items: center;
}

.nav-logo-left img {
    height: 80px;
    width: auto;
}

.nav-logo-left a {
    display: flex;
    align-items: center;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 40px;
}

.nav-menu li a {
    text-decoration: none;
    color: #f0f0f0;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.nav-menu li a:hover {
    color: var(--color-gold);
}

/* =========================================
   4. HERO
   ========================================= */
.hero {
    background-image: url('imagenes/fondo-hero3.webp');
    background-size: cover;
    background-position: center 30%;
    background-attachment: fixed;
    height: calc(50vh + var(--offset-top));
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    overflow: hidden;
    padding-top: var(--offset-top);
}

@supports (-webkit-touch-callout: none) {
    .hero {
        background-attachment: scroll;
    }
}

.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.4));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 1;
}

.hero-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding-top: 40px;
}

.hero h1 {
    font-family: var(--font-main);
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--color-gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    text-align: center;
}

/* =========================================
   5. BUSCADOR
   ========================================= */
.search-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
}

.search-wrapper {
    position: relative;
    width: 90%;
    max-width: 600px;
    display: flex;
    align-items: stretch;
    background-color: white;
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    overflow: visible;
    isolation: isolate;
}

#buscador {
    flex: 1;
    border: none;
    background: transparent;
    padding: 16px 24px;
    font-size: 1.05rem;
    outline: none;
    border-radius: 50px 0 0 50px;
}

.btn-filter-icon {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    border: none;
    border-radius: 0 50px 50px 0;
    padding: 0 28px;
    cursor: pointer;
    color: white;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.25s ease, box-shadow 0.25s ease;
    min-width: 70px;
    justify-content: center;
    position: relative;
    overflow: visible;
}

.btn-filter-icon i {
    font-size: 1.15rem;
}

.btn-filter-icon:hover {
    background: linear-gradient(135deg, var(--color-gold-hover) 0%, #b87d10 100%);
    box-shadow: 0 4px 18px rgba(224, 170, 62, 0.45);
}

.filter-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--color-red);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    z-index: 10;
    line-height: 1;
}

/* =========================================
   6. CHIPS DE FILTROS ACTIVOS
   ========================================= */
.active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    width: 90%;
    max-width: 600px;
    margin-top: 14px;
}

.filter-chip-active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 13px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-family: var(--font-main);
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #fff;
    white-space: nowrap;
    background: rgba(15, 15, 20, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(224, 170, 62, 0.5);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    animation: chipFadeIn 0.2s ease forwards;
}

@keyframes chipFadeIn {
    from { opacity: 0; transform: translateY(-5px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.filter-chip-active span:first-child {
    color: #f0d080;
    font-weight: 600;
}

.chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.chip-remove:hover {
    background: rgba(211, 47, 47, 0.8);
    color: #fff;
    transform: scale(1.2);
}

/* =========================================
   7. PASARELA DE MARCAS
   ========================================= */
.brands-slider {
    width: 100%;
    overflow: hidden;
    background: #0a0f18;
    padding: 20px 0;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    margin-bottom: 30px;
}

.brands-track {
    display: flex;
    align-items: center;
    width: calc(300px * 16);
    animation: scroll-brands 30s linear infinite;
}

.brand-item {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.85rem;
    color: #f0f0f0;
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0.8;
}

@keyframes scroll-brands {
    0%   { transform: translateX(0); }
    100% { transform: translateX(calc(-300px * 8)); }
}

/* =========================================
   8. CATÁLOGO Y TARJETAS
   ========================================= */
.container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    padding: 20px;
    align-items: stretch;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.15);
}

.image-container {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background-color: #f0f0f0;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease;
}

.etiqueta-destacado {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--color-red);
    color: white;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 10px;
    font-weight: bold;
    font-family: var(--font-main);
    z-index: 1;
}

.etiqueta-promo {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e67e22;
    color: white;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 10px;
    font-weight: bold;
    font-family: var(--font-main);
    z-index: 1;
}

.skeleton-card {
    background-color: #eee;
    width: 100%;
    height: 350px;
    border-radius: 10px;
    animation: parpadeo 1.5s infinite ease-in-out;
}

@keyframes parpadeo {
    0%   { opacity: 0.6; }
    50%  { opacity: 1; }
    100% { opacity: 0.6; }
}

.info {
    padding: 15px;
    border-top: 3px solid var(--color-gold-hover);
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.price-container {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.competitor-price {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.7em;
}

.our-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--color-red);
    margin-bottom:0.7em;
    margin-top:0.5em;
}

.product-title {
    font-size: 1.1rem;
    line-height: 1.3;
    overflow: hidden;
    margin: 5px 0;
    color: var(--color-text);
}

.product-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 5px;
}

.product-agotado {
    color: var(--color-red);
    font-weight: bold;
    margin-top: 5px;
    font-size: 0.9rem;
}

/* =========================================
   9. MODAL DE FILTROS
   ========================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 550px;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .modal-overlay {
        align-items: center;
    }
    .modal-content {
        border-radius: 24px;
        transform: scale(0.9);
        opacity: 0;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    }
    .modal-overlay.active .modal-content {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 24px 24px 0 0;
    padding-top: calc(24px + var(--bar-height));
}

.modal-header h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-main);
}

.btn-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.filter-group {
    margin-bottom: 28px;
}

.filter-label {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #334155;
    margin-bottom: 12px;
    font-family: var(--font-main);
}

.filter-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 10px 20px;
    border: 2px solid var(--color-border);
    border-radius: 25px;
    background: white;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.filter-chip.selected {
    background: #1e293b;
    color: white;
    border-color: #1e293b;
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.3);
}

.filter-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    background: white;
    color: var(--color-text);
    -webkit-appearance: none;
    appearance: none;
}

.filter-select:focus {
    border-color: #1e293b;
    box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.1);
}

.modal-footer {
    padding: 20px 24px;
    background: #f8fafc;
    display: flex;
    gap: 12px;
    border-top: 1px solid var(--color-border);
    border-radius: 0 0 24px 24px;
}

.btn-clear {
    flex: 1;
    padding: 14px;
    border: 2px solid #cbd5e1;
    background: white;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-main);
}

.btn-clear:hover {
    background: #f1f5f9;
}

.btn-apply {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-hover) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(224, 170, 62, 0.4);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    font-family: var(--font-main);
}

.btn-apply:hover {
    background: linear-gradient(135deg, var(--color-gold-hover) 0%, #c49428 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(224, 170, 62, 0.5);
}

/* =========================================
   10. FOOTER
   ========================================= */
.site-footer {
    background-color: var(--color-dark);
    color: #888;
    text-align: center;
    padding: 40px 20px;
    margin-top: 50px;
}

.footer-brands {
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

.footer-brands-title {
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-family: var(--font-main);
    font-weight: 700;
}

.footer-brands-list {
    font-family: var(--font-main);
    font-size: 0.85rem;
    line-height: 1.8;
}

.footer-legal {
    font-size: 0.8rem;
}

.footer-legal p {
    margin-bottom: 10px;
}

.footer-disclaimer {
    font-size: 0.7rem;
    color: #555;
}

/* =========================================
   11. BOTONES FLOTANTES
   ========================================= */
.btn-flotante {
    position: fixed;
    bottom: 40px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    color: #fff;
    font-size: 38px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.btn-flotante:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.btn-whatsapp {
    right: 8%;
    background-color: #25d366;
}

.btn-mail {
    left: 8%;
    background-color: #333;
}

/* =========================================
   12. RESPONSIVE
   ========================================= */

/* iPad — ajuste de posición del hero */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero {
        background-position: center 47%;
    }
}
/* --- CAMBIO CLAVE 1: Bajamos de 900px a 768px para NO afectar al iPad --- */
@media (max-width: 700px) {

    .container {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 10px;
}

.product-title {
    font-size: 0.9rem;
}

.our-price {
    font-size: 1.1rem;
}

    /* Navbar mobile */
    .navbar-top {
        height: auto;
        padding: 5px 0;
        flex-direction: column;
    }

    .nav-logo-left { display: none; }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
        margin-bottom: 5px;
    }

    .nav-menu li a {
        font-size: 0.75rem; /* Letra más chica para que entre en una línea */
    }

    /* Hero mobile */
    .hero {
        background-image: url('imagenes/fondo-celular-4.webp');
        /* Usamos svh para evitar problemas con la barra de Safari */
        height: 70svh; 
        background-attachment: scroll;
        align-items: flex-start; /* Alineación arriba */
        padding-top: 0;
    }

    .etiqueta-destacado,
 .etiqueta-promo {
    font-size: 8px;
    padding: 3px 7px;
    border-radius: 8px;
 }

 .product-meta {
    font-size: 0.75rem;
    white-space: nowrap;
 }

    .overlay {
        justify-content: flex-start;
        align-items: flex-start;
        /* --- CAMBIO CLAVE 2: Bajamos el contenido --- */
        /* Antes era 40px (muy arriba). Ahora usamos 110px para darle aire respecto al menú */
        padding-top: 165px; 
        padding-bottom: 0;
        flex-direction: column;
        width: 100%;
    }

    .hero-content {
        padding-top: 0;
        justify-content: flex-start;
        gap: 15px;
        width: 100%;
        text-align: center;
    }

    .hero h1 {
        font-size: 1.35rem;
        line-height: 1.2;
        padding: 0 15px;
        /* Sombra negra suave para que se lea mejor sobre cualquier fondo */
        text-shadow: 0px 2px 4px rgba(0,0,0,0.6); 
    }

/* --- Barra buscadora mobile --- */
.search-container {
    margin-top: 10px;
    width: 100%;
    align-items: center;
}

.search-wrapper {
    width: 85%;
    max-width: 320px;
    height: 42px;
}

#buscador {
    font-size: 0.85rem;
    padding: 0 15px;
}

.btn-filter-icon {
    padding: 0 16px;
    font-size: 0.85rem;
    min-width: 48px;
}

 .announcement-bar {
        font-size: 0.65rem;
        letter-spacing: 1px;
    }
}

/* --- Ajuste ULTRA COMPACTO para iPhone SE (320px - 380px) --- */
@media (max-width: 380px) {
    .hero h1 {
        font-size: 1.2rem; /* Título controlado */
    }
    
    .overlay {
        padding-top: 100px; 
    }
    
   .search-wrapper {
    width: 90%;
    height: 38px;
}

#buscador {
    font-size: 0.8rem;
}

.btn-filter-icon {
    min-width: 42px;
    padding: 0 12px;
}
    
    /* Achicamos botones de WhatsApp también para que no molesten */
    .btn-flotante {
        width: 45px;
        height: 45px;
        font-size: 22px;
        bottom: 15px;
    }
}

/* iPhone estándar 390-430px */
@media (min-width: 381px) and (max-width: 430px) {
    .overlay {
        padding-top: 105px !important;
    }

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

