/* ── MODAL DE COMPARTIR ───────────────────────────────────────────────────
   Se abre siempre al pulsar el botón (flotante o embebido), en vez del share
   sheet nativo del SO directamente: así el logo/nombre que se ve es siempre
   el del subsitio actual, con marca propia y el mismo aspecto en cualquier
   navegador. "Más opciones…" dentro de la modal ofrece el share nativo del
   SO cuando existe (navigator.share), para el resto de apps instaladas.
   z-index por encima de todo lo demás del ecosistema (carrito 999998, modal
   de pedidos 9999999): es una interacción explícita del usuario, debe
   quedar siempre encima. ─────────────────────────────────────────────── */

.wfns-share-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000000;
    background: rgba(15, 23, 42, .55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    animation: wfnsShareFade .16s ease forwards;
}
.wfns-share-overlay.wfns-share-closing { animation: wfnsShareFade .16s ease reverse forwards; }
@keyframes wfnsShareFade { to { opacity: 1; } }

.wfns-share-modal {
    background: #fff;
    width: 100%;
    max-width: 380px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    border-radius: 20px;
    padding: 22px 20px calc(18px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
    position: relative;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transform: translateY(18px) scale(.97);
    opacity: 0;
    animation: wfnsShareUp .22s cubic-bezier(.22, 1, .36, 1) .02s forwards;
}
.wfns-share-closing .wfns-share-modal { animation: wfnsShareUp .16s ease reverse forwards; }
@keyframes wfnsShareUp { to { transform: translateY(0) scale(1); opacity: 1; } }

.wfns-share-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.wfns-share-close:hover { background: #e5e7eb; color: #111827; }
.wfns-share-close svg { width: 15px; height: 15px; }

.wfns-share-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 26px;
    margin-bottom: 18px;
}
.wfns-share-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.wfns-share-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
}
.wfns-share-logo-fallback svg { width: 20px; height: 20px; }
.wfns-share-head-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wfns-share-site {
    font-size: 15px;
    color: #111827;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wfns-share-msg {
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wfns-share-channels {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}
.wfns-share-ch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    padding: 6px 2px;
    border-radius: 12px;
    transition: background .15s, transform .15s;
}
.wfns-share-ch:hover { background: #f3f4f6; }
.wfns-share-ch:active { transform: scale(.94); }
.wfns-share-ch-ico {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.wfns-share-ch-ico svg { width: 22px; height: 22px; }
.wfns-share-ch-label {
    font-size: 11px;
    color: #4b5563;
    text-align: center;
}
.wfns-share-ch-wa .wfns-share-ch-ico { background: #25d366; }
.wfns-share-ch-fb .wfns-share-ch-ico { background: #1877f2; }
.wfns-share-ch-x  .wfns-share-ch-ico { background: #0f1419; }
.wfns-share-ch-tg .wfns-share-ch-ico { background: #229ed9; }
.wfns-share-ch-em .wfns-share-ch-ico { background: #6b7280; }

.wfns-share-linkrow {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 6px 6px 6px 12px;
}
.wfns-share-link-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: none;
    font-size: 12.5px;
    color: #4b5563;
    outline: none;
    text-overflow: ellipsis;
}
.wfns-share-copy {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    border: none;
    background: #111827;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 9px;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.wfns-share-copy svg { width: 14px; height: 14px; }
.wfns-share-copy:hover { background: #000; }
.wfns-share-copy:active { transform: scale(.96); }
.wfns-share-copy.wfns-share-copied { background: #16a34a; }

.wfns-share-native {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    padding: 11px;
    border-radius: 12px;
    cursor: pointer;
    transition: background .15s;
}
.wfns-share-native:hover { background: #f9fafb; }
.wfns-share-native svg { width: 16px; height: 16px; }

@media (max-width: 420px) {
    .wfns-share-channels { grid-template-columns: repeat(4, 1fr); row-gap: 12px; }
}
