/* =========================================
   VARIABLES GLOBALES Y RESET
========================================= */
:root {
    --brand-dark: #084c34;
    --brand-light: #f2f5f3;
    --brand-accent: #6b9080;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    
    /* 🛑 [URL_IMAGEN_HERO_BACKGROUND] 🛑 */
    --hero-image: url('../images/hero.webp');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-white);
    color: var(--text-main);
    padding-bottom: 6rem; /* Espacio para el carrito */
}

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

/* Clases de Utilidad Esenciales para JS */
.hidden { display: none !important; }
.hidden-transform { transform: translateY(100%); }

/* =========================================
   NAVEGACIÓN (NAVBAR)
========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--bg-white);
    z-index: 40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-brand h1 {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--brand-dark);
    letter-spacing: 0.1em;
}

.dot { color: #22c55e; }

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--brand-dark);
    cursor: pointer;
}

.logo-img {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
}

/* =========================================
   MENÚ HAMBURGUESA
========================================= */
.side-menu-panel {
    background-color: var(--bg-white);
    width: 75%;
    max-width: 24rem;
    height: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 10px 0 15px rgba(0,0,0,0.1);
}

.menu-header {
    display: flex;
    justify-content: flex-end;
}

.btn-icon-gray {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.nav-btn {
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--brand-dark);
    padding-bottom: 0.5rem;
    cursor: pointer;
}

/* =========================================
   SECCIÓN INICIO (HERO Y FILTROS)
========================================= */
.view-section {
    margin-top: 4rem; /* Debajo del navbar */
}

.hero {
    height: 60vh;
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.6)), var(--hero-image);
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--bg-white);
    padding: 1rem;
}

.hero h2 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    font-style: italic;
    max-width: 28rem;
}

.categorias-container {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.category-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0 1rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }

.cat-btn {
    background-color: var(--bg-white);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 0.375rem 1.25rem;
    border-radius: 9999px;
    white-space: nowrap;
    cursor: pointer;
    font-weight: 500;
}

.cat-btn.active {
    background-color: var(--brand-dark);
    color: var(--bg-white);
    border-color: var(--brand-dark);
}

/* =========================================
   GRILLA DE PRODUCTOS
========================================= */
.products-main { padding: 1rem; }
.category-title { color: #9ca3af; font-style: italic; margin-bottom: 1rem; font-family: 'Inter', sans-serif;}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* =========================================
   SECCIONES: UBICACIÓN Y ENTREGA
========================================= */
.section-padding { padding: 1.5rem; }
.section-heading { font-size: 1.875rem; color: var(--brand-dark); margin-bottom: 1rem; }
.section-desc { color: var(--text-muted); margin-bottom: 1.5rem; }

.featured-img {
    width: 100%;
    height: 16rem;
    object-fit: cover;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.info-box, .info-card {
    background-color: var(--brand-light);
    padding: 1rem;
    border-radius: 1rem;
    display: flex;
    gap: 1rem;
}

.info-box { flex-direction: column; padding: 1.5rem; }
.icon-circle { background-color: var(--bg-white); padding: 0.75rem; border-radius: 50%; color: var(--brand-dark); }
.text-brand { color: var(--brand-dark); }
.steps-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.steps-list li { display: flex; gap: 0.75rem; align-items: flex-start; }

/* =========================================
   FOOTER
========================================= */
.site-footer {
    background-color: var(--brand-light);
    padding: 1.5rem;
    text-align: center;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.site-footer h3 { font-size: 1.5rem; color: var(--brand-dark); margin-bottom: 1.5rem; }
.footer-links { display: flex; flex-direction: column; gap: 1rem; align-items: center; }
.footer-links a { color: var(--brand-dark); text-decoration: none; font-weight: 600; display: flex; gap: 0.5rem; align-items: center;}
.btn-link { background: none; border: none; color: var(--text-muted); text-decoration: underline; cursor: pointer; font-size: 0.875rem;}

/* =========================================
   CARRITO FLOTANTE
========================================= */
.cart-bar {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: var(--brand-light);
    border-top: 1px solid var(--border-color);
    border-radius: 1.5rem 1.5rem 0 0;
    z-index: 30;
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 6px -1px rgba(0,0,0,0.1);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
}

.cart-summary { display: flex; gap: 1rem; font-weight: bold; color: var(--brand-dark); font-size: 1.125rem;}
#cart-icon { background: var(--bg-white); padding: 0.5rem; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }

.cart-expanded { padding: 0 1.5rem 1.5rem; max-height: 50vh; overflow-y: auto; }
.cart-expanded-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; margin-bottom: 1rem;}
.btn-clear { background: none; border: none; color: var(--text-muted); cursor: pointer; font-weight: 600; }
.cart-items-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }

/* =========================================
   MODALES Y FORMULARIOS
========================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background-color: var(--bg-white);
    width: 100%;
    max-width: 28rem;
    border-radius: 1rem;
    padding: 1.5rem;
    position: relative;
}

.modal-bottom { align-self: flex-end; border-radius: 1.5rem 1.5rem 0 0; }
.scrollable { max-height: 95vh; overflow-y: auto; }
.btn-close-modal { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.25rem; color: var(--text-muted); cursor: pointer; z-index: 10;}
.absolute-top-right { background: var(--bg-white); width: 2rem; height: 2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,0.2);}

.modal-title { font-size: 1.5rem; color: var(--brand-dark); margin-bottom: 1.5rem; text-align: center; }

.button-group { display: flex; flex-direction: column; gap: 1rem; }
.form-layout { display: flex; flex-direction: column; gap: 0.75rem; }

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    outline: none;
}
.input-field:focus { border-color: var(--brand-dark); }
.mt-1 { margin-top: 0.25rem; }

.btn-primary {
    background-color: var(--brand-dark);
    color: var(--bg-white);
    padding: 1rem;
    border: none;
    border-radius: 9999px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
}
.btn-outline {
    background-color: transparent;
    color: var(--brand-dark);
    padding: 1rem;
    border: 2px solid var(--brand-dark);
    border-radius: 0.75rem;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
}
.btn-secondary {
    background-color: var(--brand-light);
    color: var(--brand-dark);
    border: 1px solid var(--brand-dark);
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-weight: bold;
    cursor: pointer;
}
.w-full { width: 100%; }

/* MAPA */
.map-container {
    width: 100%;
    height: 12rem;
    background-color: var(--border-color);
    border-radius: 0.5rem;
    z-index: 1;
}

/* =========================================
   ELEMENTOS INYECTADOS DINÁMICAMENTE (JS)
========================================= */
.product-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 0.75rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.product-title {
    font-size: 0.875rem;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    height: 2.5rem;
    overflow: hidden;
}

.product-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

.product-price {
    font-weight: bold;
    color: var(--brand-dark);
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.qty-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.25rem;
}

.btn-qty {
    background-color: var(--brand-dark);
    color: var(--bg-white);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-text {
    font-weight: bold;
    color: var(--text-muted);
}

.pointer-events-none {
    pointer-events: none;
}

.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9fafb;
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.cart-item-name {
    font-weight: bold;
    font-size: 0.875rem;
    color: var(--brand-dark);
}

.cart-item-price {
    font-weight: bold;
    color: var(--brand-dark);
}

/* Estilo del botón Explorar (Hero) */
.btn-explore {
    background-color: var(--bg-white);
    color: var(--brand-dark);
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 2rem;
    font-size: 1rem;
    transition: transform 0.2s;
}
.btn-explore:active { transform: scale(0.95); }

/* Estilos de enlaces del nuevo Footer */
.contact-link {
    color: var(--brand-dark);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 1.125rem;
}
.btn-instagram {
    background-color: var(--brand-dark);
    color: var(--bg-white) !important; /* El !important fuerza a que el texto sea blanco */
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* =========================================
   DISEÑO RESPONSIVO (TABLETS Y ESCRITORIO)
========================================= */
@media (min-width: 768px) {
    /* Navbar con márgenes laterales */
    .navbar {
        padding: 1rem 5%;
    }

    /* Centrar contenedores principales para evitar que se estiren infinitamente */
    .products-main,
    .section-padding,
    .categorias-container {
        max-width: 1024px;
        margin: 0 auto;
        padding-left: 2rem;
        padding-right: 2rem;
    }

    /* Hero más imponente en pantallas grandes */
    .hero h2 {
        font-size: 4rem;
    }
    .hero p {
        font-size: 1.5rem;
    }

    /* Pasar de 2 a 3 columnas de productos en Tablets */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    /* Alinear las tarjetas de información visualmente mejor */
    .featured-img {
        height: 20rem;
    }

    /* Centrar contenido del footer y poner los enlaces en línea horizontal */
    .site-footer {
        padding: 3rem;
    }
    .footer-links {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
    }

    /* Restringir el ancho del contenido del carrito flotante */
    .cart-header,
    .cart-expanded {
        max-width: 800px;
        margin: 0 auto;
    }
}

@media (min-width: 1024px) {
    /* Pasar de 3 a 4 columnas de productos en Computadoras */
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }

    /* Imágenes principales más amplias */
    .featured-img {
        height: 24rem;
    }
}