.popShareCaseCont {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: linear-gradient(to bottom,
            rgba(147, 51, 234, 0.2) 0%,
            rgba(168, 85, 247, 0.15) 15%,
            rgba(14, 34, 69, 0.9) 40%);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    /* НЕ ставим overflow на fixed-обёртке — ломает position:fixed на iOS */
    overflow: hidden;
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 999999;
}

.popShareCaseCont.open {
    opacity: 1;
    visibility: visible;
    display: flex;
    pointer-events: auto;
}

.popShareCaseCont.open > .poper {
    transform: translateY(0);
    opacity: 1;
}

.popShareCaseCont > .poper {
    width: 520px;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    background: linear-gradient(139deg,
            rgba(38, 35, 78, 0.95),
            rgba(23, 19, 61, 0.98));
    border: 1px solid rgba(147, 51, 234, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 999999;
    border-radius: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(126, 34, 206, 0.5) inset;
}

.popShareCaseCont > .poper::before,
.popShareCaseCont > .poper::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right,
            transparent,
            rgba(147, 51, 234, 0.7),
            rgba(168, 85, 247, 0.8),
            rgba(147, 51, 234, 0.7),
            transparent);
    z-index: 1;
    pointer-events: none;
}

.popShareCaseCont > .poper::before {
    top: 0;
}

.popShareCaseCont > .poper::after {
    bottom: 0;
}

.popShareCaseCont .drawer-handle {
    display: none;
}

.popShareCaseCont > .poper > .top {
    width: 100%;
    text-align: center;
    padding: 30px 20px 20px;
    border-bottom: 1px solid rgba(147, 51, 234, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.popShareCaseCont > .poper > .top > h2 {
    margin: 0;
    color: #fff;
    font-size: 22px;
    font-weight: 600;
}

.popShareCaseCont > .poper > .top > small {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    line-height: 1.4;
}

.popShareCaseCont > .poper > .main {
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
}

.share-social-grid {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.share-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 12px;
    border: none;
    color: #ffffff;
    cursor: pointer;
}

.share-social-btn svg,
.share-social-btn img {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
}

.share-social-btn--x {
    background: #000000;
}

.share-social-btn--telegram {
    background: #2aabee;
}

.share-social-btn--facebook {
    background: #1877f2;
}

.share-social-btn--whatsapp {
    background: #25d366;
}

.share-social-btn--viber {
    background: #7360f2;
}

.share-social-btn--instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.share-social-btn--messenger {
    background: #0084ff;
}

.share-link-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(147, 51, 234, 0.35);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    text-align: left;
    color: inherit;
    font: inherit;
}

.share-link-bar__url {
    display: block;
    width: 100%;
    color: #ffffff;
    font-size: 13px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-link-bar__hint {
    display: block;
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    line-height: 1.2;
}

.share-link-bar.is-copied {
    border-color: rgba(34, 197, 94, 0.55);
    background: rgba(34, 197, 94, 0.12);
}

.share-link-bar.is-copied .share-link-bar__hint {
    color: #86efac;
}

@media screen and (max-width: 768px) {
    .popShareCaseCont {
        align-items: flex-end !important;
        background: rgba(0, 0, 0, 0.5) !important;
        backdrop-filter: blur(8px) !important;
        height: 100dvh !important;
        padding: 0 !important;
        overflow: hidden;
    }

    .popShareCaseCont > .poper {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 92dvh !important;
        margin: 0 !important;
        transform: translateY(100%);
        opacity: 1 !important;
        border-radius: 20px 20px 0 0 !important;
        border-bottom: none !important;
        padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5) !important;
        transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1) !important;
    }

    .popShareCaseCont.open > .poper {
        transform: translateY(0);
    }

    .popShareCaseCont .drawer-handle {
        display: block;
        position: relative;
        width: 100%;
        height: 24px;
        cursor: grab;
        z-index: 10;
        touch-action: none;
        flex: 0 0 auto;
    }

    .popShareCaseCont .drawer-handle::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: rgba(255, 255, 255, 0.25);
        border-radius: 2px;
        transition: background 0.3s ease;
    }

    .popShareCaseCont > .poper:active .drawer-handle::before,
    .popShareCaseCont > .poper.dragging .drawer-handle::before {
        background: rgba(255, 255, 255, 0.4);
    }

    .popShareCaseCont > .poper.dragging .drawer-handle {
        cursor: grabbing !important;
    }

    .popShareCaseCont > .poper > .top {
        padding: 4px 18px 14px;
        touch-action: none;
    }

    .popShareCaseCont > .poper > .main {
        padding: 12px 16px 8px;
        overflow-y: auto;
    }
}

@media (max-width: 420px) {
    .popShareCaseCont > .poper > .top {
        padding: 24px 18px 16px;
    }

    .popShareCaseCont > .poper > .top > h2 {
        font-size: 18px;
    }

    .popShareCaseCont > .poper > .top > small {
        font-size: 12px;
    }

    .popShareCaseCont > .poper > .main {
        padding: 16px;
    }

    .share-social-btn {
        width: 44px;
        height: 44px;
    }
}
