/* =====================================================================
   RESET & BASE
===================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* =====================================================================
   HEADER GLOBAL
===================================================================== */
.kg-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11,16,32,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.35);
}

/* --------------------------
   HEADER TOP
--------------------------- */
.kg-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
}

.kg-logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.logo-icon { font-size: 1.3rem; }
.logo-text { font-weight: 700; }
.logo-sub { font-size: 0.75rem; opacity: .75; }

/* =====================================================================
   BUSCADOR + SUGERENCIAS
===================================================================== */
.kg-search {
    flex: 1;
    max-width: 520px;
    display: flex;
    gap: 0.4rem;
    position: relative;
}

.kg-search input {
    flex: 1;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    border: none;
    outline: none;
    background: #fff;
}

.kg-search button {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: none;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

/* CAJA DE SUGERENCIAS */
.sugerencias-box {
    display: none;
    position: absolute;
    width: 100%;
    top: 45px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    max-height: 250px;
    overflow-y: auto;
    z-index: 999;
}

.sug-item {
    padding: 10px;
    font-size: 0.9rem;
}
.sug-item:hover { background: #f1f5f9; }

/* =====================================================================
   CARRITO
===================================================================== */
.kg-cart-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    background: #f97316;
    border-radius: 999px;
    font-size: 0.85rem;
}
.badge {
    background: #fff;
    color: #1f2937;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* =====================================================================
   MENÚ — DOS FILAS (TOP + SCROLL)
===================================================================== */
.kg-nav-top {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #0f172a;
}

.kg-nav-top .nav-item {
    padding: 0.35rem 1rem;
    white-space: nowrap;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    font-size: 0.85rem;
    transition: 0.2s;
}
.kg-nav-top .nav-item.active {
    background: #2563eb;
}

/* CATEGORÍAS EN SCROLL */
.kg-nav-scroll {
    display: flex;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    background: #1e293b;
    scroll-behavior: smooth;
    cursor: grab;
    user-select: none;   /* 🔥 CLAVE */
}


.kg-nav-scroll:active {
    cursor: grabbing;
}


.kg-nav-scroll::-webkit-scrollbar {
    height: 10px; /* MÁS GRUESA */
}

.kg-nav-scroll::-webkit-scrollbar-thumb {
    background: #64748b; /* MÁS VISIBLE */
    border-radius: 999px;
}

.nav-cat-item {
    padding: 0.55rem 1.1rem;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #334155;
    white-space: nowrap;
    font-size: 0.85rem;
    color: #e5e7eb;
    transition: all .2s ease;
}


.nav-cat-item:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.nav-cat-item.active {
    background: #0ea5e9;
    color: #0f172a;
}

/* =====================================================================
   BANNER PROMOCIONAL
===================================================================== */
.kg-banner-promo {
    background: linear-gradient(90deg, #ff006e, #ffbe0b);
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    text-align: center;
    margin: 12px 0;
    color: #fff;
    animation: promoFlash 3s infinite;
}

@keyframes promoFlash {
    0% { opacity: .5; }
    50% { opacity: 1; }
    100% { opacity: .5; }
}


/* ===========================================================
   BANNERS INTELIGENTES (SLIDER PORTADA)
=========================================================== */

.kg-banner-slider {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 8px;
    padding: 8px 4px 6px;
    margin-bottom: 8px;
}

.kg-banner-slider::-webkit-scrollbar {
    height: 5px;
}
.kg-banner-slider::-webkit-scrollbar-thumb {
    background: rgba(15,23,42,0.35);
    border-radius: 999px;
}

/* Cada banner */
.kg-banner-item {
    min-width: 100%;
    border-radius: 14px;
    padding: 12px 16px;
    color: #fff;
    box-shadow: 0 6px 16px rgba(15,23,42,0.20);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Contenido de texto */
.kg-banner-content h2 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.kg-banner-content p {
    font-size: 0.78rem;
    font-weight: 500;
    margin: 0;
}

/* Imagen opcional a la derecha */
.kg-banner-img {
    margin-left: auto;
    width: 90px;
    max-height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
}

/* En pantallas chicas */
@media (max-width: 768px) {
    .kg-banner-item {
        padding: 10px 12px;
    }
    .kg-banner-img {
        width: 70px;
        max-height: 60px;
    }
    .kg-banner-content h2 {
        font-size: 1rem;
    }
    .kg-banner-content p {
        font-size: 0.75rem;
    }
}


/* =====================================================================
   HERO
===================================================================== */
.kg-main { padding: 1rem; }

.hero {
    padding: 1.8rem 1.3rem;
    background: linear-gradient(100deg, #2563eb, #22c55e);
    color: #fff;
    border-radius: 1.2rem;
    display: grid;
    grid-template-columns: 2fr 1.1fr;
    align-items: center;
    gap: 1.4rem;
}

/* =====================================================================
   PRODUCTOS
===================================================================== */
.productos-section { margin-top: 1.4rem; }

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 1.3rem;   /* 🔥 antes 1rem */
}

.producto-card {
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    padding: 12px;              /* 🔥 AIRE INTERNO */
    transition: transform .25s ease, box-shadow .25s ease;
}


.producto-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0,0,0,.18);
}


.producto-img img {
    width: 100%;
    height: 160px;              /* un poquito más alto */
    object-fit: contain;
    margin-bottom: 10px;        /* 🔥 separación */
}


.producto-info {
    padding: 4px 2px;           /* micro aire interno */
}

.producto-nombre {
    margin-bottom: 6px;
    line-height: 1.25;
}

.producto-precio {
    margin-bottom: 6px;
}

.producto-actions {
    margin-top: 10px;           /* botón respira */
}


/* =====================================================================
OFERTAS EN LAS TARJETAS
===================================================================== */
.badge-oferta {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e63946;
    padding: 4px 8px;
    color: white;
    font-size: 0.75rem;
    border-radius: 999px;
    font-weight: 700;
}

.precio-antes {
    text-decoration: line-through;
    color: #9ca3af;
    margin-right: 6px;
    font-size: 0.85rem;
}
.precio-oferta {
    color: #e11d48;
    font-weight: 700;
}

/* =====================================================================
   🔥 CATEGORÍAS — ULTRA PREMIUM
===================================================================== */

/* TÍTULO */
.categorias-hero {
    text-align: center;
    margin: 30px 0 20px;
}
.categorias-hero h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
}
.categorias-hero p {
    color: #475569;
}

/* GRID */
.categoria-grid-pro {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 25px;
    padding: 10px;
}

/* TARJETA GLASS / DEGRADADO */
.categoria-card-pro {
    padding: 25px 15px;
    border-radius: 20px;
    text-align: center;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.55);
    box-shadow: 0 10px 25px rgba(15,23,42,0.15);
    transition: 0.28s;
    position: relative;
    overflow: hidden;
}

/* brillo diagonal */
.categoria-card-pro::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(59,130,246,0.18), transparent 60%),
                radial-gradient(circle at bottom right, rgba(34,197,94,0.18), transparent 55%);
    opacity: 0.9;
    z-index: -1;
}

.categoria-card-pro:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 18px 40px rgba(15,23,42,0.25);
}

/* ICONO ESTILO "SVG" (EMOJI MEJORADO) */
.cat-icon {
    font-size: 2.8rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 3px 3px rgba(15,23,42,0.35));
}

.cat-name {
    font-size: 1.13rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.cat-count {
    font-size: 0.9rem;
    color: #64748b;
}

/* ===========================================================
   BOTÓN - ESTILO PREMIUM
=========================================================== */
/* BOTÓN AGREGAR AL CARRITO - COMPACTO */
.btn-primary {
    display: inline-block;
    padding: 5px 12px; /* ← MÁS PEQUEÑO */
    border-radius: 8px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff !important;
    font-weight: 600;
    font-size: 0.80rem; /* ← MÁS CHIQUITO */
    border: none;
    cursor: pointer;
    transition: 0.25s;
}

.btn-add-cart:active {
    transform: scale(0.94);
}


.btn-primary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #16a34a, #15803d);
    box-shadow: 0 4px 10px rgba(22,163,74,0.30);
}


.btn-danger {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff !important;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: 0.25s;
}

.btn-danger:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 6px 14px rgba(220,38,38,0.35);
}


/* ===========================================================
   CARRITO DE COMPRAS (DISEÑO MODERNO)
=========================================================== */

.carrito-tabla {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.carrito-tabla thead {
    background: #0f172a;
    color: #fff;
}

.carrito-tabla th,
.carrito-tabla td {
    padding: 14px 12px;
    text-align: center;
    font-size: 0.95rem;
}

.carrito-tabla tbody tr:nth-child(even) {
    background: #f1f5f9;
}

.carrito-tabla img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 12px;
}

.carrito-cantidad input {
    width: 60px;
    padding: 6px;
    font-size: 0.95rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

/* Total final 
.carrito-total {
    margin-top: 18px;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: right;
}*/

/*aquiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiicambie lo uiltimo */
/* ==============================
   TABLA DE CARRITO MODERNA
============================== */

.tabla-carrito {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.tabla-carrito thead {
    background: #0f172a;
    color: #fff;
}

.tabla-carrito th,
.tabla-carrito td {
    padding: 14px 10px;
    text-align: center;
    font-size: 0.95rem;
}

.tabla-carrito tbody tr:nth-child(even) {
    background: #f1f5f9;
}

.carrito-producto {
    display: flex;
    align-items: center;
    gap: 12px;
}

.carrito-producto img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
}

/*INPUT DE CANTIDAD*/
.tabla-carrito input[type="number"] {
    width: 60px;
    padding: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}

/*Botones secundarios: Actualizar, Vaciar carrito*/

.btn-secondary {
    padding: 8px 14px;
    background: #e2e8f0;
    color: #1e293b;
    border-radius: 10px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: 0.25s;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

/*TOTAL

.carrito-total {
    margin-top: 20px;
    text-align: right;
    font-size: 1.2rem;
    font-weight: 700;
}*/

/*BOTONES FINALES (Seguir comprando / Finalizar)*/

.carrito-footer {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}


/* ===========================================================
   🔥 CORRECCIÓN DEFINITIVA TABLA DE CARRITO
=========================================================== */

.tabla-carrito {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.tabla-carrito thead {
    background: #0f172a;
    color: #fff;
}

.tabla-carrito th {
    padding: 14px 10px;
    font-size: 0.95rem;
    font-weight: 700;
}

.tabla-carrito td {
    padding: 14px 10px;
    font-size: 0.95rem;
}

.tabla-carrito tbody tr:nth-child(even) {
    background: #f1f5f9;
}

.carrito-producto {
    display: flex;
    align-items: center;
    gap: 12px;
}

.carrito-producto img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
}

/* Input cantidad estilizado */
.tabla-carrito input[type="number"] {
    width: 55px;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    text-align: center;
}

/* Sección de botones */
.carrito-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

/* Total alineado */
.carrito-total {
    text-align: right;
    margin-top: 20px;
    font-size: 1.35rem;
}


/* ================================================
   CONTENEDOR CENTRAL PARA EL CARRITO
================================================ */
.carrito-section {
    max-width: 1100px;   /* ← ANCHO CONTROLADO */
    margin: 0 auto;      /* ← CENTRAR */
    padding: 20px;
}

/*PIE DE PAGINA*/
/* ================================================
   FOOTER — CENTRADO Y LETRA MÁS PEQUEÑA
================================================ */

footer {
    text-align: center !important;
    padding: 20px 0;
}

footer p,
footer a,
footer div {
    font-size: 0.85rem !important; /* letra más pequeña */
    color: #475569 !important;     /* gris elegante */
    line-height: 1.4;
}


/* ==========================================================
   DETALLE DE PRODUCTOS – LISTA DE PRECIOS POR CANTIDAD
========================================================== */

.detalle-precios {
    list-style: none !important;   /* quitar los puntos */
    padding-left: 0 !important;
    margin-top: 8px;
}

.detalle-precios li {
    background: #f1f5f9;           /* gris suave */
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 8px;
    font-size: 0.92rem;
    color: #0f172a;
    display: flex;
    justify-content: space-between; /* precio alineado bonito */
}

.detalle-precios li span {
    font-weight: 700;
    color: #2563eb;                /* color azul elegante */
}

/* ======================================================
   PRECIOS SEGMENTADOS — TARJETAS DEL INDEX
====================================================== */

.producto-precios-segmentados {
    margin-top: 6px;
    font-size: 0.80rem;      /* 🔥 Texto más pequeño */
    line-height: 1.2;        /* 🔥 Espaciado perfecto */
    color: #374151;          /* Gris elegante */
}

.producto-precios-segmentados span {
    font-weight: 600;
    font-size: 0.82rem;
    display: block;
    margin-bottom: 2px;
}

/* Aplica estilo a los <li> generados por formatearPreciosSegmentados() */
.producto-precios-segmentados ul {
    margin: 0;
    padding-left: 14px;      /* Disminuye la sangría */
}

.producto-precios-segmentados li {
    font-size: 0.78rem;      /* 🔥 Más pequeño */
    margin: 1px 0;
    color: #4b5563;          /* Gris medio */
}

/* Punto decorativo más fino */
.producto-precios-segmentados li::marker {
    color: #6b7280;
    font-size: 0.65rem;
}


/* TOAST FINAL – ESQUINA INFERIOR DERECHA */
.kg-toast {
    position: fixed;
    bottom: 20px;     /* ABAJO, YA NO ARRIBA */
    right: 20px;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    color: #fff;
    background: #22c55e;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    opacity: 0;
    transform: translateY(15px);   /* inicia un poco abajo */
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 99999;
}

.kg-toast.show {
    opacity: 1;
    transform: translateY(0);      /* sube suavemente */
}

.kg-toast-error {
    background: #ef4444 !important;
}


/* ===============================
   MINI CARRITO PRO — DISEÑO 2025
=============================== */

.kg-mini-cart {
    position: fixed;
    top: 70px;
    right: 16px;
    width: 300px;
    max-height: 75vh;
    background: #ffffff;
    color: #1e293b;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    padding: 12px;
    z-index: 99999;
    display: none;
    flex-direction: column;
    animation: fadeInMiniCart .25s ease-out;
}

@keyframes fadeInMiniCart {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.kg-mini-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1rem;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.kg-mini-cart-header button {
    border: none;
    background: transparent;
    font-size: 1.05rem;
    cursor: pointer;
    color: #475569;
}

.kg-mini-cart-body {
    overflow-y: auto;
    max-height: 55vh;
    padding-right: 4px;
}

.mini-cart-container {
    max-height: 345px;
    overflow-y: auto;
}

.mini-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    border-bottom: 1px solid #f1f5f9;
}

.mini-cart-img {
    width: 55px;
    height: 55px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

.mini-cart-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-cart-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.mini-cart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-cart-price {
    color: #16a34a;
    font-size: 14px;
    font-weight: 700;
}

.mini-cart-qty {
    display: flex;
    align-items: center;
    gap: 4px;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: #e2e8f0;
    cursor: pointer;
    font-weight: bold;
}
.qty-btn:hover {
    background: #cbd5e1;
}

.qty-input {
    width: 40px;
    text-align: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 3px;
}

.mini-cart-delete {
    background: #f87171;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: .2s;
}
.mini-cart-delete:hover {
    background: #dc2626;
}

.mini-cart-footer {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    text-align: right;
}

.mini-cart-total {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.btn-mini-cart {
    display: block;
    text-align: center;
    padding: 8px 14px;
    border-radius: 8px;
    color: white;
    background: #2563eb;
    font-weight: 700;
    transition: .25s;
}
.btn-mini-cart:hover {
    background: #1d4ed8;
}

.precio-antes {
    text-decoration: line-through;
    color: #999;
    margin-right: 6px;
}

.precio-oferta {
    color: #e53935;
    font-weight: bold;
}

.precio-segmento {
    color: #1b8f3c;
    font-weight: bold;
}

.precio-badge {
    font-size: 12px;
    margin-top: 4px;
}

.precio-badge.segmento {
    color: #1b8f3c;
}

.precio-badge.oferta {
    color: #e53935;
}

.kg-paginacion {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.btn-pagina {
    padding: 8px 14px;
    background: #2563eb;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
}

.btn-pagina:hover {
    background: #1e40af;
}

.pagina-actual {
    background: #111827;
    cursor: default;
}


/* ===============================
   HEADER MÓVIL LIMPIO Y FUNCIONAL
=============================== */

.kg-header-mobile {
    display: none;
}

@media (max-width: 768px) {

    /* Ocultar header escritorio */
    .kg-header-top,
    .kg-nav-top,
    .kg-nav-scroll {
        display: none;
    }

    /* Mostrar header móvil */
    .kg-header-mobile {
        display: flex;
        flex-direction: column;
        background: rgba(11,16,32,0.95);
        backdrop-filter: blur(12px);
        position: sticky;
        top: 0;
        z-index: 9999;
        padding: 0.4rem;
        gap: 0.35rem;
    }

    .kg-mobile-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .kg-mobile-logo {
        font-weight: 800;
        font-size: 1rem;
        color: #fff;
    }

    .kg-mobile-right {
        display: flex;
        gap: 0.6rem;
        align-items: center;
    }

    .kg-cart-mobile {
        background: #f97316;
        padding: 0.35rem 0.6rem;
        border-radius: 999px;
        font-size: 0.8rem;
        font-weight: 700;
        color: #fff;
    }


    /* BUSCADOR MÓVIL */
    .kg-search-mobile {
        display: flex;
        width: 100%;
        gap: 0.4rem;
    }
    
        /* Ocultar buscador de escritorio en móvil */
    .kg-search:not(.kg-search-mobile) {
        display: none !important;
    }


    .kg-search-mobile input {
        flex: 1;
        padding: 0.55rem 0.9rem;
        border-radius: 999px;
        border: none;
        font-size: 0.95rem;
    }

    .kg-search-mobile button {
        padding: 0.55rem 1rem;
        border-radius: 999px;
        border: none;
        background: #2563eb;
        color: #fff;
        font-weight: 600;
    }
}


/* ======================================
   FIX BOTÓN MENÚ ☰ (MÓVIL)
====================================== */
@media (max-width: 768px) {

    .kg-menu-toggle {
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.6rem;
        line-height: 1;
        color: #ffffff;
        background: transparent;
        border: none;
        cursor: pointer;
    }

}


/* ======================================
   MENÚ MÓVIL DESPLEGABLE
====================================== */
.kg-mobile-menu {
    display: none;
    flex-direction: column;
    background: #0f172a;
    padding: 0.75rem;
    gap: 0.6rem;
    position: absolute;   /* 🔥 CLAVE */
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 10000;       /* 🔥 MÁS QUE EL HEADER */
}



.kg-mobile-menu a {
    color: #ffffff;
    font-weight: 600;
    padding: 0.6rem;
    border-radius: 8px;
}

.kg-mobile-menu a:hover {
    background: rgba(255,255,255,0.1);
}

.kg-mobile-menu.show {
    display: flex;
}


/* ======================================
   HERO FIX MÓVIL
====================================== */
@media (max-width: 768px) {

    .hero {
        display: flex;
        flex-direction: column;
        gap: 0.9rem;
        padding: 1rem;
        grid-template-columns: none; /* 🔥 ESTA ES LA CLAVE */
    }

    .hero h1 {
        font-size: 1.3rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .hero img {
        display: none;
    }

}

/* =====================================================
   🛒 CARRITO MÓVIL PRO — DEFINITIVO KG
===================================================== */
@media (max-width: 768px) {

    /* ocultar encabezado tabla */
    .tabla-carrito thead {
        display: none;
    }

    /* tarjeta producto */
    .tabla-carrito tr {
        display: block;
        background: #ffffff;
        margin-bottom: 12px;
        border-radius: 18px;
        padding: 14px 12px 12px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.08);
        position: relative; /* 🔥 CLAVE */
    }

    .tabla-carrito td {
        display: block;
        border: none;
        padding: 0;
    }

    /* ===============================
       FILA SUPERIOR
    =============================== */
    .carrito-producto {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 6px;
    }

    .carrito-producto img {
        width: 54px;
        height: 54px;
        border-radius: 12px;
        object-fit: cover;
        flex-shrink: 0;
    }

    .carrito-producto span {
        font-size: 0.85rem;
        font-weight: 700;
        line-height: 1.15;
;
    }

    /* ===============================
       BOTÓN ELIMINAR PRO REAL
    =============================== */
    .eliminar-item {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: #fee2e2;
        color: #dc2626;
        font-size: 16px;
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        cursor: pointer;
        transition: 0.25s;
        box-shadow: 0 4px 12px rgba(220,38,38,0.35);
        z-index: 10;
    }

    .eliminar-item:hover {
        background: #dc2626;
        color: #fff;
    }

    /* ===============================
       FILA INFERIOR (UNA SOLA FILA)
    =============================== */
    .tabla-carrito .precio-carrito,
    .tabla-carrito td[data-subtotal-id] {
        margin-top: 6px;
    }

    .tabla-carrito .precio-carrito {
        font-size: 0.8rem;
    }

    .tabla-carrito .precio-antes {
        font-size: 0.75rem;
        margin-right: 4px;
    }

    .tabla-carrito .precio-oferta,
    .tabla-carrito .precio-segmento {
        font-size: 0.9rem;
        font-weight: 800;
    }

    .tabla-carrito input[type="number"] {
        width: 44px;
        height: 30px;
        border-radius: 8px;
        border: 1px solid #cbd5e1;
        text-align: center;
        font-size: 0.85rem;
        background: #f8fafc;
        margin-top: 6px;
    }

    /* subtotal */
    .tabla-carrito td[data-subtotal-id] {
        font-weight: 800;
        color: #16a34a;
        font-size: 0.9rem;
        margin-top: 4px;
    }

    /* texto mayorista */
    .precio-badge,
    .precio-segmento {
        font-size: 0.7rem;
        margin-top: 2px;
    }

    /* ===============================
       TOTAL Y BOTONES
    =============================== */
    .carrito-total {
        text-align: center;
        font-size: 1.3rem;
        font-weight: 800;
        margin: 16px 0 12px;
    }

    .carrito-footer {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .carrito-footer a,
    .carrito-footer button {
        width: 100%;
        padding: 12px;
        border-radius: 14px;
        font-size: 0.95rem;
    }
}


/* EFECTO HORIZONTE FUTURISTA */
.kg-nav-scroll::before,
.kg-nav-scroll::after {
    content: "";
    position: sticky;
    top: 0;
    width: 36px;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.kg-nav-scroll::before {
    left: 0;
    background: linear-gradient(to right, #1e293b 65%, transparent);
}

.kg-nav-scroll::after {
    right: 0;
    background: linear-gradient(to left, #1e293b 65%, transparent);
}


/* BADGE FUTURISTA */
.badge-futuro {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,.35);
    z-index: 5;
    pointer-events: none;
    animation: pulseFuturo 2.5s infinite;
}

/* ANIMACIÓN FUTURISTA */
@keyframes pulseFuturo {
    0%   { box-shadow: 0 0 0 rgba(59,130,246,0); }
    50%  { box-shadow: 0 0 18px rgba(59,130,246,0.55); }
    100% { box-shadow: 0 0 0 rgba(59,130,246,0); }
}

/* 📱 DESACTIVAR ANIMACIÓN EN MÓVIL */
@media (max-width: 768px) {
    .badge-futuro {
        animation: none;
    }
}
