/* ==========================================================================
   SOLOS · index.css
   ========================================================================== */

:root {
    --solos-accent: #EE4D2D;
    --solos-accent-dark: #D8431F;
    --solos-accent-soft: #FFF1EC;

    --solos-lilac: #9B6ADE;
    --solos-lilac-dark: #7E4FC0;
    --solos-lilac-soft: #F3ECFC;

    --solos-text: #212529;
    --solos-muted: #757575;
    --solos-border: #F0F0F0;

    --solos-radius: 14px;
    --solos-radius-sm: 8px;
}


/* ==========================================================================
   UTILIDADES
   ========================================================================== */

.animate-pulse {
    animation: solos-pulse 1.8s ease-in-out infinite;
}

@keyframes solos-pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: .45;
    }
}

.hover-link {
    transition: opacity .2s ease;
}

.hover-link:hover {
    opacity: .75;
}


/* ==========================================================================
   CATEGORÍAS — 2 FILAS
   ========================================================================== */

.categorias-scroll-wrapper {
    width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: none;

    /* Menos padding arriba para pegarlo más al header */
    padding: 4px 0 10px;

    /* Snap scroll tipo Shopee/carrusel */
    scroll-snap-type: x proximity;
}

.categorias-scroll-wrapper::-webkit-scrollbar {
    display: none;
}


.categorias-grid {
    display: grid;

    grid-template-rows: repeat(2, auto);

    grid-auto-flow: column;

    /* Columnas más angostas */
    grid-auto-columns: 82px;

    /* Gap más ajustado, estilo grilla apretada */
    gap: 14px 10px;

    width: max-content;

    min-width: 100%;

    justify-content: center;

    padding: 2px 10px;
}


.categoria-item {
    width: 82px;
    min-width: 82px;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;

    color: var(--solos-text);

    transition: transform .15s ease;

    scroll-snap-align: start;
}


.categoria-circulo {
    /* Círculo más pequeño y compacto */
    width: 52px;
    height: 52px;

    flex-shrink: 0;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #fff;

    font-size: 1.2rem;

    box-shadow:
        0 3px 8px rgba(0, 0, 0, .08);

    transition:
        transform .15s ease,
        box-shadow .15s ease;

    overflow: hidden;
}


.categoria-circulo img {
    width: 60%;
    height: 60%;

    object-fit: contain;
}


.categoria-item:active .categoria-circulo {
    transform: scale(0.93);
}

.categoria-item:hover .categoria-circulo {
    transform: translateY(-2px);

    box-shadow:
        0 6px 14px rgba(0, 0, 0, .12);
}


.categoria-nombre {
    display: block;

    width: 100%;

    /* Menos separación entre círculo y texto */
    margin-top: 5px;

    padding: 0 2px;

    color: var(--solos-text);

    /* Texto un poco más chico para que combine con el círculo reducido */
    font-size: .68rem;

    font-weight: 600;

    line-height: 1.2;

    white-space: normal;

    overflow: visible;

    word-break: normal;

    overflow-wrap: break-word;

    /* Máximo 2 líneas, igual que hicimos con el nombre del producto */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ==========================================================================
   BUSCADOR — LILA
   ========================================================================== */



.buscador-contenedor {
    position: relative;
}


.buscador-contenedor #search-form {
    border-radius: 999px;

    background: #fff;

    overflow: hidden;

    border: 1.5px solid rgba(155, 106, 222, .18);

    box-shadow:
        0 4px 16px rgba(155, 106, 222, .10) !important;

    transition:
        box-shadow .2s ease,
        border-color .2s ease,
        transform .2s ease;
}


.buscador-contenedor #search-form:focus-within {
    border-color: var(--solos-lilac);

    box-shadow:
        0 8px 24px rgba(155, 106, 222, .20) !important;

    transform: translateY(-1px);
}


.buscador-contenedor .input-group {
    position: relative;
}


.buscador-contenedor #search-input {
    border-radius: 999px !important;

    border: none !important;

    background: #fff;

    color: var(--solos-text);

    padding-left: 22px;
    padding-right: 8px;

    box-shadow: none !important;
}


.buscador-contenedor #search-input::placeholder {
    color: #999;
}


.buscador-contenedor #search-input:focus {
    border: none !important;

    box-shadow: none !important;

    outline: none;
}


.buscador-contenedor .btn-primary {
    background-color: var(--solos-lilac) !important;

    border: none !important;

    color: #fff;

    border-radius: 999px !important;

    margin: 4px 4px 4px 0;

    padding-left: 20px;
    padding-right: 20px;

    font-weight: 600;

    font-size: .92rem;

    letter-spacing: .01em;

    box-shadow: none !important;

    outline: none !important;

    transition:
        background-color .2s ease,
        transform .15s ease;
}


.buscador-contenedor .btn-primary:hover {
    background-color: var(--solos-lilac-dark) !important;

    box-shadow: none !important;
}


.buscador-contenedor .btn-primary:focus,
.buscador-contenedor .btn-primary:focus-visible {
    background-color: var(--solos-lilac-dark) !important;

    box-shadow: none !important;

    outline: none !important;
}


.buscador-contenedor .btn-primary:active {
    transform: scale(.96);

    box-shadow: none !important;
}


.buscador-contenedor .btn-primary i {
    font-size: .9rem;
}

/* ==========================================================================
   SUGERENCIAS
   ========================================================================== */

.items-buscador-flotante {
    top: calc(100% + 8px);

    left: 0;

    width: 100%;

    background: #fff;

    border: 1px solid var(--solos-lilac-soft);

    border-radius: 12px;

    overflow: hidden;

    z-index: 1050;

    text-align: left;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, .12) !important;
}


.sugerencia-producto {
    display: flex;

    align-items: center;

    gap: 12px;

    border-left: none !important;
    border-right: none !important;

    border-color: #f1f1f1 !important;

    padding: 10px 12px;

    background: #fff;

    text-decoration: none;

    transition:
        background-color .15s ease;
}


.sugerencia-producto:hover {
    background-color: var(--solos-lilac-soft);
}


.sugerencia-producto-imagen,
.sugerencia-producto-sin-imagen {
    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    border-radius: 8px;

    object-fit: cover;

    background: #f5f5f5;
}


.sugerencia-producto-sin-imagen {
    display: flex;

    align-items: center;
    justify-content: center;

    color: #aaa;

    font-size: 1.1rem;
}


.sugerencia-producto-info {
    min-width: 0;

    flex: 1;
}


.sugerencia-producto-nombre {
    color: var(--solos-text);

    font-size: .88rem;

    font-weight: 600;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


.sugerencia-producto-precio {
    margin-top: 2px;

    color: var(--solos-accent);

    font-size: .82rem;

    font-weight: 400;
}


.sugerencia-producto-flecha {
    color: var(--solos-lilac);

    font-size: .9rem;
}


/* ==========================================================================
   TARJETAS DE PRODUCTOS
   ========================================================================== */

.tarjeta-producto-animada {
    border-radius: var(--solos-radius);

    overflow: hidden;

    background: #fff;

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}


.tarjeta-producto-animada:hover {
    transform: translateY(-4px);

    box-shadow:
        0 10px 24px rgba(0, 0, 0, .10) !important;
}


/* ==========================================================================
   IMAGEN
   ========================================================================== */

.contenedor-imagen-producto {
    display: block;

    aspect-ratio: 1 / 1;

    cursor: pointer;

    background: #f7f7f7;
}


.imagen-recortada {
    object-fit: cover;

    transition: transform .35s ease;
}


.tarjeta-producto-animada:hover .imagen-recortada {
    transform: scale(1.05);
}


/* ==========================================================================
   FOTOS EXTRA
   ========================================================================== */

.badge-fotos-extra {
    bottom: 8px;

    right: 8px;

    font-size: .65rem;

    border-radius: 999px;

    padding: .25rem .5rem;

    z-index: 5;
}


/* ==========================================================================
   DESTACADO
   ========================================================================== */

.badge-flotante-producto {
    position: absolute;

    top: 10px;
    left: 10px;

    z-index: 6;

    background: #fff;

    color: var(--solos-accent);

    font-size: .65rem;

    font-weight: 600;

    padding: .3rem .55rem;

    border-radius: 999px;

    letter-spacing: .01em;

    box-shadow:
        0 3px 8px rgba(0, 0, 0, .08);
}


.badge-flotante-producto i {
    color: #FFC107;
}


/* ==========================================================================
   TIENDA — ahora es un <a> clickeable, necesita fondo y color propios
   ========================================================================== */

.etiqueta-tienda {
    display: inline-block;

    background-color: var(--solos-lilac-soft);

    color: var(--solos-lilac-dark);

    font-size: .65rem;

    font-weight: 600;

    border-radius: 999px;

    padding: .25rem .55rem;

    max-width: 100%;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    transition:
        background-color .15s ease,
        color .15s ease;
}


.etiqueta-tienda:hover {
    background-color: var(--solos-lilac);

    color: #fff;
}


/* ==========================================================================
   DESCRIPCIÓN
   ========================================================================== */

.descripcion-producto {
    min-height: 1.1em;
}


/* ==========================================================================
   PRECIO
   ========================================================================== */

/*
   "Desde" queda VERDE
*/

.etiqueta-precio-desde {
    font-size: 0.78rem;
    font-weight: 500;
    color: #16a34a; /* verde, como "Desde" */
}

.etiqueta-precio {
    font-size: 0.78rem;
    font-weight: 500;
    color: #16a34a;
}



/*
   Bs. queda en color normal.
*/

.precio-moneda {
    color: var(--solos-text);

    font-size: .85rem;

    font-weight: 400;
}


/*
   SOLO EL NÚMERO ES ROJO.
   NO está en negrita.
*/

.precio-destacado {
    color: #EE4D2D !important;

    font-size: .95rem;

    font-weight: 400 !important;

    line-height: 1.2;
}


/* ==========================================================================
   BOTÓN SUBIR ARRIBA — LILA
   ========================================================================== */

.btn-back-to-top {
    position: fixed;

    right: 20px;
    bottom: 24px;

    width: 46px;
    height: 46px;

    border: none;

    border-radius: 50%;

    background-color: var(--solos-lilac) !important;

    color: #fff;

    font-size: 1.15rem;

    display: flex;

    align-items: center;
    justify-content: center;

    box-shadow:
        0 6px 18px rgba(155, 106, 222, .35);

    z-index: 1000;

    opacity: 0;

    visibility: hidden;

    transform: translateY(12px);

    transition:
        opacity .25s ease,
        transform .25s ease,
        visibility .25s ease,
        background-color .2s ease;
}


.btn-back-to-top.mostrar {
    opacity: 1;

    visibility: visible;

    transform: translateY(0);
}


.btn-back-to-top:hover {
    background-color: var(--solos-lilac-dark) !important;

    color: #fff;
}


.btn-back-to-top:focus {
    outline: none;

    box-shadow:
        0 0 0 4px var(--solos-lilac-soft),
        0 6px 18px rgba(155, 106, 222, .35);
}


/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 991.98px) {

    .categorias-grid {
        grid-auto-columns: 115px;

        gap: 17px 14px;
    }


    .categoria-item {
        width: 115px;

        min-width: 115px;
    }

}


/* ==========================================================================
   CELULAR
   ========================================================================== */

@media (max-width: 767.98px) {

    .categorias-grid {
        grid-auto-columns: 76px;

        gap: 10px 8px;

        padding-left: 8px;
        padding-right: 8px;
        padding-top: 2px;

        justify-content: start;
    }


    .categoria-item {
        width: 76px;

        min-width: 76px;

        scroll-snap-align: start;
    }


    .categoria-circulo {
        width: 50px;
        height: 50px;

        font-size: 1.1rem;
    }


    .categoria-nombre {
        font-size: .64rem;

        line-height: 1.15;

        margin-top: 4px;

        padding: 0 2px;
    }


    /* BUSCADOR */

    .buscador-contenedor #search-input {
        padding-left: 15px;

        font-size: .95rem;
    }


    .buscador-contenedor .btn-primary {
        padding-left: 15px;

        padding-right: 15px;
    }


    .buscador-contenedor .btn-primary span {
        display: none;
    }


    /* PRODUCTOS */

    .card-body {
        padding: .7rem !important;
    }


    .card-title {
        font-size: .82rem;
    }


    .etiqueta-tienda {
        font-size: .6rem;
    }


    .descripcion-producto {
        font-size: .68rem !important;
    }


    .precio-moneda {
        font-size: .78rem;
    }


    .precio-destacado {
        font-size: .88rem;
    }


    .etiqueta-precio-desde {
        font-size: .62rem;
    }


    .badge-flotante-producto {
        font-size: .6rem;

        padding: .22rem .45rem;
    }


    /* BOTÓN SUBIR */

    .btn-back-to-top {
        right: 14px;

        bottom: 16px;

        width: 42px;
        height: 42px;
    }


    /* SUGERENCIAS */

    .sugerencia-producto {
        padding: 9px 10px;
    }


    .sugerencia-producto-imagen,
    .sugerencia-producto-sin-imagen {
        width: 44px;
        height: 44px;

        flex-basis: 44px;
    }


    .sugerencia-producto-nombre {
        font-size: .82rem;
    }


    .sugerencia-producto-precio {
        font-size: .78rem;
    }

}


/* ==========================================================================
   CELULARES MUY PEQUEÑOS
   ========================================================================== */

@media (max-width: 380px) {

    .categorias-grid {
        grid-auto-columns: 70px;

        gap: 8px 6px;

        padding-top: 0;
    }


    .categoria-item {
        width: 70px;

        min-width: 70px;
    }


    .categoria-circulo {
        width: 46px;
        height: 46px;
    }


    .categoria-nombre {
        font-size: .6rem;
    }


    .card-body {
        padding: .6rem !important;
    }


    .precio-moneda {
        font-size: .74rem;
    }


    .precio-destacado {
        font-size: .84rem;
    }

}