/* =========================================================
   PIE DE TARJETA: PRECIO + BOTÓN "AÑADIR" Y HOJA PARA ELEGIR OPCIÓN
   (products/includes/precio_anadir.html y products/js/anadir_carrito.js)
   Lo cargan la tienda (detalle_tienda.html) y la búsqueda
   (resultados_busqueda.html). Sube ?v= en las dos al cambiarlo.

   - Precio a la izquierda en dos líneas: "Bs." chico arriba (o "Desde Bs.",
     y en promoción el precio de antes tachado) y el número debajo.
   - "Añadir" siempre en el mismo lugar: abajo, pegado al borde derecho.
   - NUNCA baja de línea (nowrap): en tarjetas angostas se achican el
     número y el botón; a 360px o menos el botón queda solo con el ícono.
   ========================================================= */

.pie-precio {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;               /* siempre al fondo de la tarjeta */
    margin-right: -6px;             /* el botón más cerca del borde */
}

.pie-precio-bloque {
    flex: 1 1 auto;
    min-width: 0;                   /* puede achicarse: nunca se mete debajo del botón */
    overflow: hidden;
    line-height: 1.1;
}

/* "Bs." / "Desde Bs." / "Bs. ~~300,00~~" */
.pie-precio-linea {
    display: block;
    margin-bottom: 1px;
    color: #6b7280;
    font-size: .68rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pie-precio-linea s {
    color: #9aa0a6;
    font-weight: 500;
}

/* El número: se achica solo según el ancho de la pantalla */
.pie-precio-monto {
    display: block;
    overflow: hidden;
    color: #dc3545;
    font-size: clamp(.82rem, 3.4vw, 1.05rem);
    font-weight: 700;
    letter-spacing: -.2px;
    white-space: nowrap;
    text-overflow: ellipsis;
}


/* ---------- Botón "Añadir" ---------- */

.btn-anadir-carrito {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 5px 10px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #5927ce, #7a58b1);
    box-shadow: 0 4px 10px rgba(89, 39, 206, .25);
    color: #fff;
    font-size: .76rem;
    font-weight: 700;
    line-height: 1;
}

.btn-anadir-carrito i { font-size: .92rem; }
.btn-anadir-carrito:disabled { opacity: .6; }
.btn-anadir-carrito.agregado { background: #16a34a; }

.etiqueta-agotado {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f3f5;
    color: #6c757d;
    font-size: .7rem;
    font-weight: 600;
}

/* Celulares: más compacto y más pegado al borde */
@media (max-width: 430px) {
    .pie-precio { gap: 4px; margin-right: -8px; }
    .pie-precio-linea { font-size: .62rem; }
    .btn-anadir-carrito { gap: 2px; min-height: 30px; padding: 5px 7px; font-size: .68rem; }
    .btn-anadir-carrito i { font-size: .82rem; }
}

/* Celulares muy chicos: solo el ícono */
@media (max-width: 360px) {
    .btn-anadir-carrito span { display: none; }
    .btn-anadir-carrito { padding: 7px; }
}


/* ---------- Hoja abajo para elegir variante y talla ---------- */

.hoja-opciones-fondo {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(10, 8, 30, .5);
}

.hoja-opciones {
    width: 100%;
    max-width: 460px;
    max-height: 75vh;
    margin: 12px;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    border-radius: 20px;
    background: #fff;
}

.hoja-opciones-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.hoja-opciones-cerrar { border: 0; background: none; color: #6c757d; font-size: 1.1rem; }
.hoja-opciones-ayuda { margin: 4px 0 12px; color: #6c757d; font-size: .86rem; }
.hoja-opciones-lista { display: grid; gap: 8px; }

.hoja-opcion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2ddf3;
    border-radius: 14px;
    background: #faf9ff;
    color: #1c1633;
    text-align: left;
}

.hoja-opcion strong { color: #dc3545; white-space: nowrap; }
.hoja-opcion:hover, .hoja-opcion:focus { border-color: #6d3fe0; }

@media (prefers-reduced-motion: no-preference) {
    .hoja-opciones { animation: hojaSubir .25s ease-out; }
    .btn-anadir-carrito { transition: background-color .2s ease, transform .15s ease; }
    .btn-anadir-carrito:active { transform: scale(.94); }
}

@keyframes hojaSubir {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: none; }
}
