/* =========================================================
   🔗 Compartir producto (core/js/compartir_producto.js)
   Lo cargan el catálogo de la tienda y la ficha del producto.
   ========================================================= */

/* ---------- Tarjeta del catálogo: flechita arriba a la izquierda ----------
   (arriba a la derecha está la etiqueta de descuento). El botón va fuera del enlace de
   la tarjeta, encima de la foto, y la columna le da la posición. */
.producto-item { position: relative; }
.btn-compartir-tarjeta {
    position: absolute;
    top: 8px;
    left: calc(var(--bs-gutter-x, 1.5rem) * .5 + 8px);
    z-index: 3;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .92);
    color: #374151;
    font-size: .95rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .15s ease, background .15s ease;
}
.btn-compartir-tarjeta:hover { background: #fff; color: #ee4d2d; }
.btn-compartir-tarjeta:active { transform: scale(.92); }

/* ---------- Ficha: "Compartir", igual que "Ampliar" (.fp-zoom en ficha_producto.css) ----------
   Mismo fondo, letra y forma. Va a la izquierda de "Ampliar", que no se mueve: el JS de
   la ficha mide "Ampliar" y ajusta right; 98px es el valor de respaldo. */
.fp-compartir {
    position: absolute;
    right: 98px;
    bottom: 12px;
    z-index: 3;
    padding: 4px 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(17, 24, 39, .72);
    color: #fff;
    font-size: .75rem;
    line-height: 1.5;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.fp-compartir:hover { background: rgba(17, 24, 39, .85); }

/* ---------- Panel para PC (sin menú nativo de compartir) ---------- */
.compartir-fondo {
    position: fixed;
    inset: 0;
    z-index: 2100;              /* encima de los toasts (2000) y del visor */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
    padding: 16px;
}
@media (min-width: 576px) { .compartir-fondo { align-items: center; } }
.compartir-panel {
    width: 100%;
    max-width: 340px;
    background: #fff;
    border-radius: 16px;
    padding: 14px 16px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.compartir-cabeza { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.compartir-cerrar { border: 0; background: none; font-size: 1rem; color: #6b7280; padding: 4px; }
.compartir-nombre {
    color: #6b7280;
    font-size: .85rem;
    margin: 0 0 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.compartir-opcion {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    margin-top: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
}
.compartir-opcion i { font-size: 1.2rem; }
.compartir-whatsapp { background: #25d366; border-color: #25d366; color: #fff; }
.compartir-whatsapp:hover { background: #1ebe5a; color: #fff; }
.compartir-copiar:hover { background: #f9fafb; }
