/* =========================================================
   TARJETA DE RESULTADOS
   ========================================================= */

.resultado-card {
    overflow: visible;
}


/* =========================================================
   ZOOM DE IMAGEN
   ========================================================= */

.hover-zoom:hover {
    transform: scale(1.04);
}


/* =========================================================
   BOTÓN VOLVER AL INICIO
   ========================================================= */

.btn-regresar-detalle {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 9px 16px;

    background: #6f42c1;
    color: #ffffff !important;

    border: none;
    border-radius: 8px;

    font-size: 0.9rem;
    font-weight: 600;

    text-decoration: none !important;

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

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.btn-regresar-detalle:hover {
    background: #5f35ad;
    color: #ffffff !important;

    text-decoration: none !important;

    transform: translateY(-1px);

    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.16);
}


.btn-regresar-detalle:active {
    transform: translateY(0);
}


.btn-regresar-detalle i {
    font-size: 1rem;
}


/* =========================================================
   CONTENEDOR DEL SELECTOR
   ========================================================= */

.selector-variantes-container {
    position: relative;
}


/* =========================================================
   PANEL DE VARIANTES

   Inicialmente oculto.

   Al aparecer:
   - No modifica el tamaño de la tarjeta.
   - No mueve los demás productos.
   - Aparece encima del botón.
   ========================================================= */

.selector-variantes {
    display: none;

    position: absolute;

    bottom: calc(100% + 8px);
    left: 0;

    width: 100%;

    background: #ffffff;

    border: 1px solid #d8d8d8;
    border-radius: 10px;

    padding: 9px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);

    z-index: 1000;
}


/* =========================================================
   PANEL VISIBLE
   ========================================================= */

.selector-variantes.mostrar {
    display: block;
}


/* =========================================================
   TÍTULO
   ========================================================= */

.selector-label {
    display: block;

    margin-bottom: 8px;

    font-size: 0.82rem;
    font-weight: 600;

    color: #333333;
}


/* =========================================================
   CONTENEDOR DE OPCIONES
   ========================================================= */

.opciones-variantes {
    display: flex;
    flex-direction: column;

    gap: 5px;

    width: 100%;
}


/* =========================================================
   OPCIÓN DE TALLA / NÚMERO / KIT
   ========================================================= */

.opcion-variante {
    width: 100%;

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

    gap: 10px;

    padding: 8px 10px;

    background: #f8f9fa;

    border: 1px solid #d8d8d8;
    border-radius: 7px;

    color: #222222;

    cursor: pointer;

    font-size: 0.84rem;
    font-weight: 600;

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.15s ease;
}


.opcion-variante:hover {
    background: #f0eafa;

    border-color: #6f42c1;

    transform: translateY(-1px);
}


/* =========================================================
   NOMBRE DE LA VARIANTE
   ========================================================= */

.opcion-nombre {
    font-weight: 700;
}


/* =========================================================
   STOCK
   ========================================================= */

.opcion-stock {
    font-size: 0.75rem;

    color: #198754;

    font-weight: 500;

    white-space: nowrap;
}


/* =========================================================
   VARIANTE SELECCIONADA
   ========================================================= */

.opcion-variante.seleccionada {
    background: #6f42c1;

    border-color: #6f42c1;

    color: #ffffff;

    box-shadow: 0 3px 8px rgba(111, 66, 193, 0.25);
}


.opcion-variante.seleccionada .opcion-stock {
    color: #ffffff;
}


/* =========================================================
   BOTÓN AÑADIR
   ========================================================= */

.selector-variantes-container .btn-primary {
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}


.selector-variantes-container .btn-primary:hover {
    transform: translateY(-1px);
}


/* =========================================================
   EVITAR PROBLEMAS DE OVERFLOW
   ========================================================= */

.resultado-card,
.card-body {
    overflow: visible;
}


/* =========================================================
   BUSCADOR
   ========================================================= */
#search-form-resultados {
    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;
}


#search-form-resultados:focus-within {
    border-color: #9b59b6;

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

    transform: translateY(-1px);
}


#search-form-resultados .form-control {
    border: none !important;

    box-shadow: none !important;
}


#search-form-resultados .btn {
    background: #9b59b6;

    border-color: #9b59b6;

    color: white;
}


#search-form-resultados .btn:hover {
    background: #8e44ad;
}


/* =========================================================
   TARJETA DE PRODUCTO
   ========================================================= */

.tarjeta-producto-animada {
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tarjeta-producto-animada:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1) !important;
}

.badge-flotante-producto {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background-color: #fff;
    color: #d97706;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

.contenedor-imagen-producto {
    aspect-ratio: 1 / 1;
}

.imagen-recortada {
    object-fit: cover;
}

.badge-fotos-extra {
    bottom: 8px;
    right: 8px;
    font-size: 0.65rem;
    border-radius: 20px;
    padding: 3px 9px;
}

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

/* TIENDA (pastilla gris clara, como "bazar" en la imagen) */
.etiqueta-tienda {
    font-size: 0.72rem;
    font-weight: 500;
    color: #6c757d;
    background-color: #f1f2f4 !important;
    border: none !important;
    border-radius: 20px;
    padding: 4px 12px;
}

.etiqueta-tienda i {
    display: none; /* la imagen no muestra ícono junto al nombre de tienda */
}

/* BADGE DE VISTAS (pastilla blanca con borde) */
.badge.bg-light.text-secondary.border {
    background-color: #ffffff !important;
    color: #6c757d !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 20px;
    font-weight: 600;
}

/* PRECIO */
.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;
}

.precio-actual {
    font-size: 1rem;
    font-weight: 400; /* "Bs." delgado */
    color: #212529;
}

.precio-monto {
    color: #f35906; /* número en naranja-rojo */
    font-weight: 400; /* delgado también, igual que en la imagen */
    font-size: 1rem;
}

/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 576px) {

    .selector-variantes {
        width: 100%;

        padding: 8px;

        bottom: calc(100% + 7px);
    }


    .opcion-variante {
        padding: 8px;

        font-size: 0.82rem;
    }


    .opcion-stock {
        font-size: 0.7rem;
    }


    .btn-regresar-detalle {
        padding: 8px 13px;

        font-size: 0.85rem;
    }

}


.etiqueta-tienda {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    font-size: 0.72rem;
    font-weight: 500;
    color: #6c757d;
    background-color: #f1f2f4;
    border: none;
    border-radius: 20px;
    padding: 4px 12px;

    transition: background-color 0.15s ease, color 0.15s ease;
}

.etiqueta-tienda i {
    font-size: 0.8rem;
    color: #6c757d;
}

.etiqueta-tienda:hover {
    background-color: #e2e4e8;
    color: #495057;
}

.etiqueta-tienda:hover i {
    color: #495057;
}
.etiqueta-tienda {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #6c757d;
    background-color: #f1f2f4;
    border: none;
    border-radius: 20px;
    padding: 4px 12px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.etiqueta-tienda:hover {
    background-color: #e2e4e8;
    color: #495057;
    text-decoration: none;
}
/* --- Badge de tienda con logo circular --- */
.etiqueta-tienda {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;
    text-align: left;
    max-width: 100%;
}

.logo-tienda-mini {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.logo-tienda-mini-icono {
    font-size: 14px;
    flex-shrink: 0;
}

/* --- Nombre del producto en dos líneas --- */
.nombre-producto {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    min-height: 2.6em;
    line-height: 1.3em;
    word-break: break-word;
}


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

.btn-back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;

    width: 46px;
    height: 46px;

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

    background: #6f42c1;
    color: #ffffff;

    border: none;
    border-radius: 50%;

    font-size: 1.1rem;

    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);

    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        background 0.2s ease;

    z-index: 1050;
}

.btn-back-to-top.mostrar {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-back-to-top:hover {
    background: #5f35ad;
}