/* Ajustes generales */
:root {
    --accent: #0749d5d3;
    ;
    --bg: #f7f7f8;
    --card: #ffffff;
    --text: #222;
    --muted: #666;
    --max-width: 1100px;
    --radius: 10px;
    --header-height: 240px;
    /* Ajustado para considerar el header completo + botón categorías */
}

/* Correcciones para el container principal */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 12px;
    width: 100%;
    overflow-x: hidden;
    /* Prevenir scroll horizontal */
}

* {
    box-sizing: border-box
}

body {
    font-family: Inter, system-ui, Arial, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 0.1.45;
}

.container {
    max-width: var(--max-width);
    margin: 10px auto;
    padding: 0 16px
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 50ps;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px
}

.nombslog {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.brand img {
    width: 185px;
    height: 185px;
    object-fit: contain;
    background: #fff;
    border: 0px double #4609c9d6;
    border-radius: 100px;
    box-shadow: 0 10px 15px rgb(29, 150, 225);
    border-width: 5px;
    padding: 6px;
    margin-right: 30px;
}

.brand h1 {
    margin: 0;
    font-size: 5.25rem
}

.top-contact {
    font-size: 1.35rem;
    color: var(--muted)
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
    position: absolute;
    top: 0;
    right: 0;
}

.top-contact2 {
    font-size: 1.05rem;
    color: var(--muted)
}


.whatsapp {
    background-image: url("images/whatsapp.webp");
    background-blend-mode: multiply;
    background-size: 50px;
    background-repeat: no-repeat;
    background-position: 5px center;
    background-color: #25D366;
    color: #fff;
    padding: 10px 10px 10px 60px;
    border: 5px double #fffffd;
    border-radius: 20px;
    box-shadow: 10 0px 30px rgba(44, 235, 10, 0.433);
    text-shadow: 10 0 5px rgb(249, 247, 247), 0 0 15px rgb(117, 204, 153), 0 0 30px rgb(44, 201, 52), 0 0 50px rgb(58, 231, 35);
    border-width: 5px;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block
}


.compra-whatsapp {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    background-color: #2585d3;
    color: #fff;
    padding: 10px 10px 10px 10px;
    border: 5px double rgb(255, 255, 255);
    border-radius: 20px;
    box-shadow: 0 0px 15px rgba(46, 9, 208, 0.767);
    text-shadow: 0 0 5px rgb(56, 4, 246), 0 0 15px rgb(12, 59, 249), 0 0 30px rgb(3, 73, 235), 0 0 50px rgb(3, 79, 255);
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    text-align: center;
    font-weight: 600;
    text-decoration: none;
    display: inline-block
}


.hero {
    margin-top: 5px;
    padding: 0;
    border-radius: var(--radius);
    display: flow-root;
    grid-template-rows: 1fr 360px;
    gap: 16px;
    align-items: start;
}

.left {
    padding: 5px;
    background: transparent
}

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px
}
.hero-top h2{
    margin-bottom: 5px;
    margin-top: 0px;  
}
.hero-top p{
    padding: 0px;
    margin-bottom: 5px;    
}
.Nombre-bienvenida{
    margin: 0px;
    padding: 0px;
}

.main-nav a {
    color: rgb(255, 255, 255);
    text-decoration: none;
    padding: 8px;
    border-radius: 10px;
    background-color: #222;
}

.muted {
    color: var(--muted);
    margin-top: 4px;
}

.small {
    font-size: 0.95rem
}

.search {
    display: flex;
    gap: 8px;
    margin-top: 12px
}

.search input {
    flex: 1;
    padding: 10px;
    border: 1px solid #e6e6e8;
    border-radius: 8px
}

.search button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer
}


#categorias h3,
#productos h3 {
    margin: 0px 15px;
    padding: 0px 0px
}



.categories-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
    gap: 2px;
    flex-wrap: wrap;

}

.categories-wrap button {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #eee;
    background: #fff;
    cursor: pointer;
    font-size: 10px
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 18px
}

.card {
    background: var(--card);
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
    text-align: center;
    /* Centrar todo el contenido */
}

.card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
}

.card h3 {
    margin: 8px 0 4px 0;
    font-size: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.4em;
    text-align: center;
}

.card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8em;
    text-align: center;
}

.card-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    /* Aumentar espacio entre elementos */
}

.price {
    color: var(--accent);
    font-weight: 600;
    font-size: 1.2rem;
    margin: 5px 0 5px 0;
 
}

.carousel {
    background: var(--card);
    padding: 13px;
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    margin: 8px 0;
}

.carousel h2{
    margin: 5px;
}

.carousel-track {
    display: flex;
    gap: 15px;
    overflow: hidden;
    padding-bottom: 5px;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-item {
    min-width: 240px;
    /* 1.5x más grande */
    border-radius: 8px;
    background: #fafafa;
    padding: 12px;
    text-align: center;
    flex: 0 0 auto;
}

.carousel-item img {
    width: 100%;
    height: 165px;
    /* 1.5x más grande */
    object-fit: cover;
    border-radius: 6px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.carousel-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: background-color 0.3s;
}

.carousel-dot.active {
    background: rgb(255, 4, 0)
}

footer {
    width: 100%;
    margin-top: 28px;
    padding: 18px;
    background: #fff;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px
}

footer a {
    color: var(--accent);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    margin-right: 25px;
}

.footer-copy {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 12px
}


.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.03);
}

.pagination .pagi-left {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination .pagi-info {
    color: var(--muted);
    font-size: .95rem;
}


.lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}

.lightbox.open {
    display: flex;
    animation: fadeIn 0.18s ease-in;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(49, 178, 207, 0.325);
    backdrop-filter: blur(3px);
}

.lightbox-content {
    position: relative;
    max-width: 92%;
    max-height: 92%;
    z-index: 2;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgb(1, 86, 244);
    transform: translateY(-8px);
    animation: popIn .25s cubic-bezier(.2, .9, .2, 1);
}

.lightbox-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
    background: #111111a2;
}

.lightbox-close {
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 3;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}



/* Mejoras UI */
.category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
}

.category-title h3 {
    margin: 0;
}

.category-title .separator {
    color: var(--muted);
    font-size: 1.2rem;
}

.category-title .current {
    color: var(--accent);
    font-weight: 600;
}

/* Estilo botón categoría activa */
.cat-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Mejora estética botón comprar en lightbox */
.lightbox .lb-buy {
    display: inline-block;
    background: linear-gradient(45deg, #0c2fdd, #788c89);
    color: white;
    padding: 10px 10px;
    border-radius: 15px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgb(0, 76, 254);
    margin-bottom: 10px;
    font-size: 1.1rem;
    width: 100%;
    min-width: 200px;
}

.lightbox .lb-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 37, 211, 0.4);
}

/* Estilo números paginación */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 20px 0;
}

.pagination .numbers {
    display: flex;
    gap: 4px;
    margin: 0 12px;
}

.pagination button {
    min-width: 36px;
    height: 36px;
    border: 1px solid #eee;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text);
}

.pagination button.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .arrow {
    font-size: 1.2rem;
    font-weight: 600;
}



/* Botón nav inferior */
.bottom-nav {
    margin: 30px 0;
    text-align: center;
}

.bottom-nav a {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bottom-nav a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(7, 73, 213, 0.2);
}

/* Mejoras visuales generales */
.whatsapp {
    width: fit-content;
}

.compra-whatsapp {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

/* Eliminar duplicados y estilos conflictivos */
.main-nav,
.categories-wrap,
.category-title,
.pagination {
    margin-left: 0;
    margin-right: 0;
}

.carousel-track {
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
    cursor: grab;
}

.carousel-track.dragging {
    cursor: grabbing;
}

/* puntos indicativos: tamaño y contraste */
.carousel-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ddd;
}

.carousel-dot.active {
    background: var(--accent);
}

/* mantener botón toggle visible en móvil */
.cat-toggle {
    display: none;
}

/* Asegurar que el título de Categorías se muestre en todas las resoluciones */
#categorias .cat-title,
#categorias h3,
.cat-title {
    display: block !important;
    margin: 10px 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

/* Separación entre categorías y carrusel */
#categorias {
    margin-bottom: 10px;
}



@keyframes popIn {
    from {
        transform: translateY(-20px) scale(.98);
        opacity: 0
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1
    }
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}










@media(max-width:950px) {
    .container {
        padding: 0 8px;
        padding: 0 8px;
        width: 100%;
        max-width: 100%;
    }

    header {
        padding: 8px;
        margin: 0 -8px;
        width: 100%;
        flex-direction: column;
        padding: 8px;
        margin: 0 -8px;
        width: calc(100% + 16px);
    }

     .brand .nombslog {
        display: flex;
        flex-direction: column;
    }

    .brand img {
        width: 180px;
        height: 180px;
        margin-right: 0;
    }

    .brand h1 {
        font-size: 2.55rem;
        text-align: start;
        padding-left: 0px;
        margin-top: 5px;
    }

    .top-contact,
    .top-contact2 {
        font-size: 1rem;
    }

    .header-right {
        display: flex;
        position: relative;
      
    }

    /* Posicionar botón categorías dentro del header */
    .cat-toggle {
        position: absolute;
        left: 10px;
        top: 185px;
        /* Ajustar según altura del header */
        width: auto;
        z-index: 120;
        padding: 8px 16px;
        font-size: 0.9rem;
        border-radius: 6px;
    }
}









/* Ajustes móviles */
@media (max-width: 600px) {
    .brand h1 {
        font-size: 1.95rem;
        margin-top: 15px;
    }

    .top-contact,
    .top-contact2 {
        font-size: 0.75rem;
        margin-bottom: 15px;
    }

    /* Grid de productos */
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 0;
    }

    .card {
        padding: 8px;
    }

    .card img {
        height: 120px;
    }

    /* Ajuste botón categorías */
    .cat-toggle {
        position:sticky;
        left: 8px;
        right: 8px;
        top: 200px;
        width: calc(100% - 16px);
        margin-bottom: 0px;
        z-index: 100;
        text-align: center;
        display: grid;
        background: var(--accent);
        color: var(--bg);
    }
    

    /* Drawer categorías */
    .categories-wrap {
        position: fixed;
        left: 8px;
        right: 8px;
        padding:15px;
        top: 255px;
        width: calc(95% - 16px);
        margin: 0 auto;
        display: none;
    }

    .categories-wrap.open {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        background: rgba(19, 111, 204, 0.678);
    }



    /* Footer ajustado */
    footer {
        margin: 12px -8px;
        padding: 12px;
        flex-direction: row;
        text-align:start;
    }

    .footer-right {
        margin-top: 12px;
        margin-left: 10px;
        text-align: center;
    }

    footer a {
        margin-right: 0;
    }
}

/* Responsive: 2 productos por fila en móviles */
@media(max-width:600px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .card img {
        height: 120px;
    }

    /* Ocultar título de categorías cuando está el toggle */
    .cat-title {
        display: none;
    }


    #productos {
        order: 1;
    }

    #categorias {
        order: 7;
        background: var(--text);
    }

    .bottom-nav {
        order: 3;
        margin: 10px;
    }
    .social-icons {
        order: 4;
        margin: 20px;
    }




    /* Contenedor flex para ordenar */
    .left {
        display: flex;
        flex-direction: column;
    }

    .search {
        margin-bottom: 0;
    }
}

/* estilos para iconos sociales */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    align-items: center;
}

.social-icon svg {
    width: 28px;
    height: 28px;
    fill: rgba(0, 0, 0, 0.738);
    transition: transform .12s ease, opacity .12s ease;
    opacity: 0.95;
}

.social-icon:hover svg {
    transform: translateY(-4px);
    opacity: 1;
}