/* =========================
   ESTILOS GENERALES
========================= */
body {
    font-family: Arial, sans-serif;
    background: #ffffff; /* Fondo general blanco */
    color: #000;
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
}


/* =========================
   HEADER PRINCIPAL
========================= */
.header-top {

    
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0a0f2e; /* Azul oscuro */
    padding: 15px 30px;
    position: sticky;
    top: 0;
    z-index: 2000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    flex-wrap: wrap; /* para móviles */
}


.header-top {
    height: auto;
    min-height: 100px;
}


/* FRANJA VERDE */
.header-linea-verde {
    width: 100%;
    height: 50px;
    background: #00a859;
    display: flex;
    align-items: center;
    padding: 0 20px;
    /* pegada justo debajo del header (que ya es sticky): el acceso a
       categorías queda siempre a mano, sin tener que volver a subir con
       el scroll. --header-top-h la calcula JS (altura real del header,
       que varia segun el ancho de pantalla) para que encastre siempre
       justo debajo, sin overlap ni hueco. */
    position: sticky;
    top: var(--header-top-h, 100px);
    z-index: 999;
}

.btn-volver {
    background: #ffffff;
    color: #030617;
    padding: 4px 8px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 12px;
    transition: all 0.2s ease;
}

.btn-volver:hover {
    background: #0a0f2e;
    color: #ffffff;
}

/* Botón verde elegante con icono tipo hamburguesa */
#btn-categorias {
    background-color: #22c55e; /* verde principal */
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px; /* espacio entre icono y texto */
    transition: all 0.3s ease;
}

#btn-categorias:hover {
    background-color: #1bb34a; /* verde más oscuro al pasar */
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

#btn-categorias .hamburger {
    font-size: 18px;  /* tamaño del icono */
    line-height: 1;
}

/* Responsive: botón más compacto en móviles */
@media (max-width: 768px) {
    #btn-categorias {
        padding: 6px 12px;
        font-size: 13px;
    }

    #btn-categorias .hamburger {
        font-size: 16px;
    }
}


.header-left {
    flex: 1;
}


.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

#buscador {
    width: 100%;
    max-width: 600px;
}

/* BARRA DE CATEGORIAS */
.barra-categorias {
    width: 100%;
    background: #0b1f3a; /* mismo azul oscuro */
    border-top: 1px solid rgba(255,255,255,0.1);
}

.categorias-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 25px;
    padding: 10px 20px;
}

.barra-categorias a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;      /* espacio interno */
    border-radius: 6px;     /* bordes redondeados */
    background: #ffffff; /* fondo sutil */
    transition: all 0.3s ease;
}

.barra-categorias a:hover {
    color: #fff;             /* texto blanco */
    background: #008f4d;     /* fondo verde al pasar */
    box-shadow: 0 3px 8px rgba(0,0,0,0.2); /* sombra leve */
    transform: translateY(-2px);          /* efecto flotante */
}

.barra-categorias a.activo {
    background: #aec223;
    color: #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

/* LOGO A LA IZQUIERDA */
.header-left img,
.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* BUSCADOR CENTRADO */
.header-center {
     flex: 2; /* aumentamos el espacio que ocupa respecto a los otros elementos */
    text-align: center;
    display: flex;
    justify-content: center; /* centra el input horizontalmente */
    position: relative; /* referencia para alinear la "x" de limpiar búsqueda */
}

.header-center input#buscador {
    width: 100%;
    max-width: 600px;

    padding: 14px 16px;      /* 🔥 más alto */
    font-size: 16px;

    border-radius: 8px;      /* 🔥 más rectangular */
    border: 2px solid #00a859;

    background: #ffffff;
    color: #000;

    outline: none;
    transition: all 0.3s ease;
}

.header-center input#buscador:focus {
    border-color: #1bb34a;
}


.btn-carrito {
    background: none;
    border: none;
    outline: none;
    box-shadow: none;
}

.btn-carrito:focus,
.btn-carrito:active {
    outline: none;
    box-shadow: none;
}

.btn-carrito svg {
    display: block;
}

/* CARRITO A LA DERECHA */
.btn-carrito svg {
    width: 36px !important;
    height: 36px !important;
    display: block;
    flex-shrink: 0;   /* evita que flex lo comprima */
}


.header-right .btn-carrito {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;   /* sin fondo */
    padding: 0;                /* sin espacio */
    border-radius: 0;          /* sin borde redondeado */
    text-decoration: none;
}
#contador-carrito-header {
    background: #ff3b3b;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: -10px;
    margin-top: -10px;
}

/* =========================
   CATÁLOGO
========================= */
.catalogo {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 30px;
    justify-items: center;
}
.card {
    width: 240px !important;
    height: 375px !important;
    min-width: 240px !important;
    max-width: 240px !important;
    min-height: 375px !important;
    max-height: 375px !important;

    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.card:hover {
    transform: translateY(-4px);
}

.card img {
    width: 100%;
    height: 220px;
    margin-top: 3px;
    object-fit: contain;
    background: #ffffff;
    margin: 3px auto 0 auto; /* margen superior 3px y centrado horizontal */
}

.card-body {
    padding: 12px;
    text-align: center;
}

/* Descripción */
.card h3 {
    font-size: 14px;
    line-height: 1.25;
    height: 35px;  /* espacio reservado para exactamente 2 líneas */
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.codigo {
    font-size: 12px;
    color: #555;
}

.precio-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.precio {
    font-size: 16px;
    font-weight: bold;
    color: #00a859 !important;
}

.btn-agregar {
    width: 32px;
    height: 32px;
    background-color: #00a859 !important;
    color: #fff !important;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.btn-agregar:hover {
    transform: scale(1.1);
    background-color: #008f4d !important;
    color: #fff !important;
}

#sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #0a0f2e; /* azul marino real, igual al header */
    padding-top: 130px;
    padding-bottom: 24px;
    transition: left .4s cubic-bezier(.16, 1, .3, 1), box-shadow .4s ease;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}
#sidebar::-webkit-scrollbar { width: 5px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 10px; }

/* Focos de "azul electrico" con una respiracion muy lenta y sutil -- es un
   pseudo-elemento aparte (no el fondo) para poder animarle solo la opacidad,
   sin volver a pintar el navio de base. Anima una sola propiedad (opacity)
   en un elemento chico y fijo: no cuesta casi nada de GPU/CPU. */
#sidebar:before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(420px circle at -30px 30px, rgba(59,130,246,.32), transparent 60%),
        radial-gradient(320px circle at 300px 560px, rgba(59,130,246,.18), transparent 65%);
    pointer-events: none;
    animation: sidebarGlow 7s ease-in-out infinite alternate;
}
@keyframes sidebarGlow {
    from { opacity: .75; }
    to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    #sidebar:before { animation: none; opacity: 1; }
}

.sidebar-eyebrow {
    padding: 0 24px 14px;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.32);
    border-bottom: 1px solid rgba(255,255,255,.08);
}

#sidebar a {
    display: block;
    margin: 2px 12px;
    padding: 11px 14px;
    border-radius: 9px;
    color: rgba(255,255,255,.82);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .005em;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

#sidebar a:hover {
    background: rgba(59,130,246,.16);
    color: #fff;
    transform: translateX(2px);
}

#sidebar.activo {
    left: 0;
    box-shadow: 10px 0 44px rgba(0,0,0,.45);
}

/* ---------- Árbol de categorías/subcategorías ---------- */
.sidebar-cat { position: relative; }
.sidebar-cat-fila { display: flex; align-items: stretch; gap: 2px; }
.sidebar-cat-fila .sidebar-link { flex: 1 1 auto; min-width: 0; }

.sidebar-toggle {
    flex: 0 0 34px;
    margin: 2px 8px 2px 0;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; border-radius: 8px; cursor: pointer;
    color: rgba(255,255,255,.4);
    transition: color .15s ease, background .15s ease;
}
.sidebar-toggle:hover { color: #fff; background: rgba(59,130,246,.2); }
.sidebar-toggle svg { width: 12px; height: 12px; transform: rotate(0deg); transition: transform .25s cubic-bezier(.16,1,.3,1); }
.sidebar-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.sidebar-toggle[aria-expanded="true"] { color: rgba(255,255,255,.75); }

.sidebar-children { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s cubic-bezier(.16,1,.3,1); }
.sidebar-children.abierto { grid-template-rows: 1fr; }
.sidebar-children-inner { overflow: hidden; padding: 2px 0 4px; }

#sidebar a.sidebar-sub-link {
    margin: 1px 12px 1px 22px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 400;
    color: rgba(255,255,255,.52);
}
#sidebar a.sidebar-sub-link:hover {
    color: #fff;
    background: rgba(59,130,246,.16);
    transform: translateX(2px);
}

/* Selección activa: chip redondeado con acento verde, sin necesitar hover */
#sidebar a.activo {
    background: linear-gradient(135deg, rgba(34,197,94,.24), rgba(34,197,94,.12));
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(34,197,94,.4);
}
#sidebar a.sidebar-sub-link.activo {
    background: rgba(34,197,94,.2);
    box-shadow: inset 0 0 0 1px rgba(34,197,94,.35);
}

#overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgba(8,10,25,.45);
    top: 0;
    left: 0;
    display: none;
    z-index: 900;
}

#overlay.activo {
    display: block;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 10px;
        padding: 15px 15px;
    }

    .header-left img {
        height: 45px;
    }

    .header-center input#buscador {
        width: 90%;
        font-size: 14px;
    }

    .btn-agregar {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

/* =========================
   VERSION MOVIL 2 COLUMNAS
========================= */
@media (max-width: 768px) {
    /* Header reorganizado */
 /* Header reorganizado para móvil */
.header-top {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    padding: 25px 15px 10px 15px; /* más espacio arriba */
    height: auto;
}




.barra-categorias a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 2px 6px;      /* espacio interno */
    border-radius: 6px;     /* bordes redondeados */
    background: #00a859; /* fondo sutil */
    transition: all 0.3s ease;
}

.barra-categorias a:hover {
    color: #fff;             /* texto blanco */
    background: #008f4d;     /* fondo verde al pasar */
    box-shadow: 0 3px 8px rgba(0,0,0,0.2); /* sombra leve */
    transform: translateY(-2px);          /* efecto flotante */
}

/* Logo y carrito en la misma línea */
.header-left,
.header-right{
    width:50%;
    display:flex;
    align-items:center;
}

.header-left img{
    pointer-events:none;
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto; /* empuja el carrito al extremo derecho */
}

.header-center{
    order: 3;        /* lo manda debajo del logo y carrito */
    width: 100%;     /* ocupa toda la fila */
    flex-basis: 100%;
    display:flex;
    justify-content:center;
    margin-top:15px;
}

.header-left img,
.logo-img {
margin-top: 0px;    /* margen superior leve para logo */
    height: 32px; /* logo más pequeño */
    width: auto;
}

.header-right .btn-carrito {
    display: flex;
    align-items: center;
}

.header-left .logo-link{
    display:flex;
    align-items:center;
    height:100%;
    width:100%;
}

.logo-link img{
    pointer-events:auto;
}

/* Botón carrito */

.btn-carrito {
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
}

.btn-carrito:focus,
.btn-carrito:active {
    outline: none;
    box-shadow: none;
}

.btn-carrito svg {
    display: block;
}

/* Buscador debajo */
.header-center {
    order: 2;
    width: 100%;
    justify-content: center;
    margin-top: 20px;
}

.header-center input#buscador {
    width: 100%;
    max-width: 100%;

    padding: 14px 16px;   /* 🔥 más alto en móvil */
    font-size: 16px;      /* evita zoom iPhone */

    border-radius: 6px;
    border: 1px solid #e0e0e0;

    background: #f8f9fa;
}

.header-center input#buscador:focus {
    border: 1px solid #22c55e;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}


    /* Catalogo: 2 columnas */
    .catalogo {
        grid-template-columns: repeat(2, 1fr);
        padding: 10px;
        gap: 10px;
    }

    /* Cards */
.card {
    width: 180px !important;
    height: 225px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    min-height: 225px !important;
    max-height: 225px !important;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

    .card img {
        width: 100%;
        height: 100px;
        object-fit: contain;
        margin: 10px auto 5px auto;
    }

    .card-body {
        padding: 10px;
        text-align: center;
    }

    .card h3 {
        font-size: 10px;
        height: 26px; /* espacio reservado para exactamente 2 líneas */
        line-height: 1.3;
        -webkit-line-clamp: 2;
        margin-bottom: 3px;
    }

    .codigo {
        font-size: 10px;
    }

    .card-ver-mas {
        font-size: 10px;
        margin: 0 0 4px;
    }

    .card-variantes-indicador {
        margin: 0;
        min-height: 12px;
    }

    .mini-swatch {
        width: 11px;
        height: 11px;
    }

    .badge-opciones {
        font-size: 9px;
        padding: 1px 6px;
    }

    .precio-container {
        justify-content: space-between;
        margin-top: 2px;
    }

    .precio {
        font-size: 14px;
    }

    .btn-agregar {
        width: 25px;
        height: 25px;
        font-size: 14px;
    }

    .btn-whatsapp {
        width: 55px;
        height: 55px;
        bottom: 15px;
        right: 15px;
    }


  #sidebar {
        position: fixed;
        top: 0;               /* siempre pegado al top */
        padding-top: 153px;
        padding-bottom: 24px;
        left: -260px;
        width: 260px;
        height: 100%;              /* 🔥 altura exacta */
        background: #0a0f2e;
        transition: left .4s cubic-bezier(.16, 1, .3, 1), box-shadow .4s ease;
        z-index: 1000;
        overflow-y: auto;     /* permite scroll si hay muchas categorías */
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    }


    /* Links restantes */
    #sidebar a {
        display: block;
        min-height: 24px;
        margin: 2px 10px;
        padding: 13px 14px;
        border-radius: 9px;
        color: rgba(255,255,255,.82);
        font-size: 14.5px;
        font-weight: 500;
        text-decoration: none;
        transition: background .15s ease, color .15s ease;
    }

    #sidebar a:hover {
        background: rgba(59,130,246,.16);
        color: #fff;
    }

#sidebar.activo {
    left: 0;
    box-shadow: 10px 0 44px rgba(0,0,0,.45);
}

#overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgba(8,10,25,.45);
    top: 0;
    left: 0;
    display: none;
    z-index: 900;
}

#overlay.activo {
    display: block;
}
}


@media (max-width: 768px){

.header-top{
    display:flex;
    flex-wrap:wrap;
}

.header-left,
.header-right{
    width:50%;
    display:flex;
    align-items:center; /* centra verticalmente */
}

.header-left{
    justify-content:flex-start;
}

.header-right{
    justify-content:flex-end;
}

}

/* =========================
   VERSION TABLET
========================= */
@media (min-width: 769px) and (max-width: 1024px) {

    /* Header más compacto */
    .header-top {
        padding: 15px 20px;
        height: 80px;
    }

.header-left img,
.logo-img {
margin-top: 5px;    /* margen superior leve para logo */
    height: 30px; /* logo más pequeño */
    width: auto;
}

    .header-center input#buscador {
        width: 90%;
        max-width: 450px;
        font-size: 14px;
    }



    /* Catálogo en 3 columnas */
    .catalogo {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        padding: 20px;
    }

    /* Card tamaño intermedio */
    .card {
        width: 100% !important;
        height: 325px !important;
        min-height: 325px !important;
        max-height: 325px !important;
    }

    .card img {
        height: 175px;
    }

    .card h3 {
        font-size: 12px;
        line-height: 1.25;
        height: 30px; /* espacio reservado para exactamente 2 líneas */
        -webkit-line-clamp: 2;
    }

    .precio {
        font-size: 15px;
    }
}

.btn-whatsapp {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 999;
}

.btn-whatsapp svg {
    width: 60%;
    height: 60%;
    display: block;
    fill: white;
}

@keyframes flotar {
    0% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}

/* Footer */
footer.footer {
    background: #222;
    color: #fff;
    padding: 30px 15px;
    font-family: Arial, sans-serif;
}

.footer-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.footer-col {
    flex: 1 1 200px;
    min-width: 180px;
}

.footer-col h4 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    font-weight: bold;
    color: #f4f4f4;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col ul li a:hover {
    color: #fff;
}

.footer-socials a {
    margin-right: 10px;
    display: inline-block;
}

.footer-socials img {
    width: 24px;
    height: 24px;
    filter: invert(1);
}

.footer-bottom {
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid #444;
    padding-top: 12px;
}



.clear-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    display: none;
    z-index: 2;
}

/* ===== Indicador de "tiene más variantes" en la card de la grilla ===== */
.card-nombre-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
.card-ver-mas {
    display: block;
    color: #00a859;
    font-size: 11px;
    font-weight: bold;
    margin: 0 0 5px;
    text-decoration: none;
    cursor: pointer;
}
.card-ver-mas:hover {
    text-decoration: none;
}
.card-variantes-indicador {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 2px 0;
    flex-wrap: wrap;
    min-height: 16px;
}
.mini-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.15);
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.badge-opciones {
    display: inline-block;
    background: #f0f9f4;
    color: #00a859;
    border: 1px solid #00a859;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: bold;
}
