/* ==========================================================================
   Canin — اشتراک‌گذاری: کادر و پیام کوتاهِ مشترکِ صفحه‌ی محصول و فروشگاه

   مارک‌آپ و رفتار در templates/public/share.php است. پیشوند sh- و بیرون از
   .pd-modern / .vx، چون هر دو صفحه آن را لود می‌کنند (مثل product-card.css).
   ظاهر خودِ دکمه با صفحه است: pd-icon-btn در product-modern.css و vx-share در
   vendors-modern.css — این فایل فقط اندازه‌ی آیکونش را یکی می‌کند.

   رفتار و ظاهر کادر عمداً هم‌خانواده‌ی کادر «وارد شوید» قلب است: روی گوشی از
   پایین صفحه بالا می‌آید و روی دسکتاپ وسط صفحه باز می‌شود.
   ========================================================================== */

.sh-btn svg { flex: 0 0 auto; }

/* z-index هم‌اندازه‌ی مودال‌های سایت (۳۰۰۰): بالای نوار پایینی موبایل (۲۱۰۰) و
   هدر (۱۰۰۰). hidden صریح خاموش می‌شود، چون display:flex بر display:none ی
   مرورگر مقدم است. */
.sh-sheet {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.sh-sheet[hidden],
.sh-opt[hidden],
.sh-hint[hidden],
.sh-field[hidden],
.sh-toast[hidden] { display: none; }

.sh-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 30, 66, .46);
    animation: shFade .2s ease;
}

.sh-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 26px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px 22px 0 0;
    background: #fff;
    box-shadow: 0 -12px 40px rgba(11, 37, 69, .18);
    text-align: center;
    animation: shUp .26s ease;
}

/* دستگیره‌ی بالای کادر، مثل کادر ورود قلب. */
.sh-card::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    width: 38px;
    height: 4px;
    margin-left: -19px;
    border-radius: 99px;
    background: #dbe4ef;
}

.sh-card h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
    color: #0b2545;
}

.sh-name {
    margin: 0 0 18px;
    padding: 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    color: var(--muted);
}

.sh-opts {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.sh-opt {
    flex: 1 1 0;
    max-width: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 2px;
    border: 0;
    border-radius: 16px;
    background: none;
    color: #0b2545;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease;
}

.sh-opt:hover { background: #f4f8ff; }

.sh-ico {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    color: #fff;
}

.sh-ico svg { width: 23px; height: 23px; }
.sh-ico--copy { background: var(--primary); }
.sh-ico--tg   { background: #229ed9; }
.sh-ico--wa   { background: #25d366; }
.sh-ico--sms  { background: #64748b; }

.sh-hint {
    margin: 14px 0 6px;
    font-size: 12px;
    line-height: 1.9;
    color: #b45309;
}

.sh-field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfe3fd;
    border-radius: 12px;
    background: #f7fafe;
    color: #0b2545;
    font: inherit;
    font-size: 12px;
    text-align: left;
}

.sh-close {
    width: 100%;
    min-height: 44px;
    margin-top: 14px;
    border: 0;
    border-radius: 14px;
    background: #f4f8ff;
    color: #0b2545;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.sh-opt:focus-visible,
.sh-close:focus-visible,
.sh-field:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* پیام کوتاه — همان جای پیام قلب: روی موبایل بالای نوار پایینی، نه رویش. */
.sh-toast {
    position: fixed;
    right: 16px;
    left: 16px;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    z-index: 2200;
    max-width: 420px;
    margin: 0 auto;
    padding: 12px 16px;
    border-radius: 14px;
    background: #0b2545;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.8;
    text-align: center;
    box-shadow: 0 12px 30px rgba(11, 37, 69, .28);
    animation: shFade .2s ease;
}

@keyframes shUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@keyframes shFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (min-width: 901px) {
    .sh-sheet { align-items: center; padding: 20px; }

    .sh-card {
        padding: 28px 22px 20px;
        border-radius: 22px;
        box-shadow: 0 24px 60px rgba(11, 37, 69, .25);
        animation-name: shFade;
    }

    .sh-card::before { display: none; }

    .sh-toast { bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .sh-backdrop,
    .sh-card,
    .sh-toast { animation: none; }
}
