/* ==========================================================================
   Variables y Configuración Base
   ========================================================================== */
   :root {
    /* Paleta de Colores (Corporativos) */
    --brand-primary: #0f2b4a; /* Azul oscuro corporativo */
    --brand-secondary: #265582; /* Azul medio */
    --brand-light: #528fc8; /* Azul claro para hover/badges */
    --accent: #479eef; /* Azul acento */
    
    /* Colores UI */
    --surface-white: #ffffff;
    --surface-light: #f8fafc; /* Gris/celeste muy claro para fondos */
    --surface-promos: #eef5fc; /* Fondo sección promos */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #f1f5f9;
    --border-color: #e2e8f0;
    --whatsapp-green: #25D366;
    --whatsapp-hover: #1EBE5D;

    /* Tipografía */
    --font-primary: 'Inter', sans-serif;
    
    /* Espaciados y Radios */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-pill: 50px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    color: var(--text-main);
    background-color: var(--surface-white);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ==========================================================================
   Botones
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background-color: var(--brand-secondary);
    color: var(--surface-white);
}

.btn-primary:hover {
    background-color: var(--brand-primary);
}

.btn-secondary {
    background-color: var(--surface-light);
    color: var(--brand-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    background-color: var(--surface-white);
    color: var(--brand-primary);
    border-radius: var(--radius-md);
}

.btn-icon:hover {
    background-color: var(--surface-light);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.btn-block {
    width: 100%;
}

/* ==========================================================================
   Header & Nav
   ========================================================================== */
.navbar-header {
    background-color: var(--surface-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--brand-primary);
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--brand-secondary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--brand-secondary);
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--brand-primary);
    transition: 0.3s;
}

@media (max-width: 992px) {
    .nav-menu {
        display: none;
    }
    .mobile-nav-toggle {
        display: flex;
    }
    /* Simple mobile menu toggle class */
    .nav-menu.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: var(--surface-white);
        padding: var(--spacing-md);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    }
}

/* ==========================================================================
   Secciones Globales & SPA (Single Page Application)
   ========================================================================== */
main > section {
    display: none !important; /* Ocultas por defecto */
    min-height: calc(100vh - 80px); /* Altura de pantalla completa menos el header */
    animation: fadeIn 0.4s ease-out forwards;
}

main > section.section-active {
    display: block !important;
}

main > section#inicio.section-active {
    display: flex !important; /* El Hero necesita flexbox */
}

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

.section-subtitle {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--brand-light);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-primary);
    margin-bottom: 1rem;
}

.section-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 800px;
}

/* ==========================================================================
   Hero (Inicio)
   ========================================================================== */
.hero-section {
    position: relative;
    background-image: url('https://via.placeholder.com/1920x800/1e293b/ffffff?text=Fondo+Almacen');
    background-size: cover;
    background-position: center;
    padding: var(--spacing-xl) 0;
    color: var(--surface-white);
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(15,43,74,0.9) 0%, rgba(15,43,74,0.7) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    background-color: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

/* ==========================================================================
   Catálogo
   ========================================================================== */
.section-catalogo {
    padding: var(--spacing-lg) 0;
    background-color: var(--surface-white);
}

.search-box {
    background-color: var(--surface-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.search-label {
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 1rem;
}

.input-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--surface-white);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--brand-light);
    box-shadow: 0 0 0 3px rgba(82,143,200,0.1);
}

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    background-color: var(--surface-white);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    background-color: var(--surface-light);
}

.chip.active {
    background-color: var(--brand-primary);
    color: var(--surface-white);
    border-color: var(--brand-primary);
}

.catalogo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.catalogo-heading {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--brand-primary);
}

.catalogo-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.category-group {
    margin-bottom: var(--spacing-lg);
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 4px solid var(--brand-light);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background-color: var(--surface-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.product-img-wrapper {
    aspect-ratio: 4/3;
    background-color: var(--surface-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.product-info {
    padding: 1.25rem;
}

.brand-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--brand-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background-color: var(--surface-promos);
    border-radius: var(--radius-sm);
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--brand-primary);
    line-height: 1.3;
}

/* ==========================================================================
   Promociones
   ========================================================================== */
.section-promociones {
    padding: var(--spacing-lg) 0;
    background-color: var(--surface-promos);
}

.promos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
}

.promo-img-box {
    background-color: var(--surface-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.promo-icon {
    width: 150px;
    height: 150px;
    color: var(--brand-primary);
}

.promo-content .section-desc {
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .promos-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Nosotros
   ========================================================================== */
.section-nosotros {
    padding: var(--spacing-xl) 0;
    background-color: var(--brand-primary);
    text-align: center;
}

.section-title-light {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--surface-white);
    margin-bottom: 1rem;
}

.section-desc-light {
    color: var(--text-light);
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

/* ==========================================================================
   Zonas
   ========================================================================== */
.section-zonas {
    padding: var(--spacing-lg) 0;
    background-color: var(--surface-light);
}

.zonas-header {
    margin-bottom: var(--spacing-md);
}

.zonas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.zonas-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.zonas-form-wrapper {
    background-color: var(--surface-white);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.form-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand-primary);
    margin-bottom: 0.5rem;
}

.form-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--brand-secondary);
}

@media (max-width: 768px) {
    .zonas-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer-b2b {
    background-color: #0b2038; /* Más oscuro que el primary */
    color: var(--surface-white);
    padding: var(--spacing-md) 0;
}

.footer-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-info h4 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.footer-info p {
    color: var(--text-light);
    opacity: 0.7;
    font-size: 0.9rem;
}

.footer-contact {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.phone {
    font-size: 1.2rem;
    font-weight: 700;
}

.social-links {
    display: flex;
    gap: 0.5rem;
}

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

.social-icon:hover {
    background-color: rgba(255,255,255,0.2);
}

@media (max-width: 768px) {
    .footer-flex {
        flex-direction: column;
        text-align: center;
    }
    .footer-contact {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ==========================================================================
   Botón WhatsApp Flotante
   ========================================================================== */
.whatsapp-float-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--whatsapp-green);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(37,211,102,0.4);
    z-index: 1000;
    transition: transform 0.2s, background-color 0.2s;
}

.whatsapp-float-btn:hover {
    background-color: var(--whatsapp-hover);
    transform: scale(1.1);
}
/* ==========================================================================
   UX / UI ENHANCEMENTS: LIGHTBOX & WHATSAPP BTN
   ========================================================================== */

/* Efecto Hover en Tarjeta */
.product-card:hover .product-img {
    transform: scale(1.05);
}

/* Modal Lightbox */
#lightbox-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

#lightbox-modal.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: var(--brand-accent);
}

/* Boton Cotizar WhatsApp en cada producto */
.btn-whatsapp-card {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #25d366;
    color: white;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    margin-top: 1rem;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.btn-whatsapp-card:hover {
    background-color: #128c7e;
    color: white;
}


/* ==========================================================================
   Responsive: Mobile (Smartphones)
   ========================================================================== */
@media (max-width: 576px) {
    /* 1. Grilla 2 columnas en catalogo */
    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    /* 2. Scroll horizontal fluido para filtros */
    .chips-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        /* Ocultar barra scroll estetica */
        scrollbar-width: none; 
        max-width: 100%;
        width: 100vw; /* Asegurar que no se estire más que el viewport */
        margin-left: -1rem; /* Compensar padding del contenedor si hace falta para el scroll */
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .chips-container::-webkit-scrollbar {
        display: none;
    }
    .chip {
        flex: 0 0 auto;
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    /* 3. Ajuste de textos de cards para encajar en 2 columnas */
    .product-name {
        font-size: 0.85rem;
    }
    .brand-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    .btn-whatsapp-card {
        font-size: 0.8rem;
        padding: 0.4rem;
        margin-top: 0.5rem;
    }
    .product-info {
        padding: 0.75rem;
    }

    /* 4. Lightbox responsive */
    .lightbox-content {
        max-width: 95%;
        max-height: 80vh;
    }
    .lightbox-close {
        top: 20px;
        right: 20px;
        font-size: 30px;
    }
}
@media (max-width: 576px) {
    .container {
        max-width: 100%;
        overflow-x: hidden;
    }
    .search-box {
        max-width: 100%;
    }
}
.header-icon {
    height: 40px;
    width: auto;
    object-fit: contain;
}
