/* ========== Social Popup ========== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 20px;
    animation: popupFadeIn 0.35s ease-out;
}

.popup-overlay.popup-visible {
    display: flex;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes popupSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popup-window {
    position: relative;
    width: 100%;
    max-width: 900px;
    background: linear-gradient(180deg, #F3F3F3 0%, #FEFEFE 77.45%, #FFFFFF 100%);
    border-radius: 70px;
    overflow: hidden;
    padding: 70px 50px 60px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: popupSlideUp 0.4s ease-out;
}

.popup-window__close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-window__close:hover {
    background: rgba(0, 0, 0, 0.06);
    transform: rotate(90deg);
}

.popup-window__close svg {
    width: 22px;
    height: 22px;
    stroke: #4a4a4b;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.popup-window__title {
    font-family: "Manrope", sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 1.2;
    color: #191a1b;
    text-align: center;
    margin: 0 0 12px;
}

.popup-window__subtitle {
    font-family: "Manrope", sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.4;
    color: #4a4a4b;
    text-align: center;
    max-width: 400px;
    margin: 0 auto 40px;
}

/* ========== Плитки — горизонтальные квадраты ========== */
.popup-window__list {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    justify-content: center;
}

.popup-window__list li {
    flex: 1;
    min-width: 0;
    max-width: 320px;
}

.popup-window__link {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 1 / 1;
    width: 100%;
    padding: 30px 26px 20px;
    background: linear-gradient(152.5deg, #666666 -6.53%, #000000 135.08%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 25px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.popup-window__link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(152.5deg, #7a7a7a -6.53%, #1a1a1a 135.08%);
    border-radius: 25px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-window__link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.popup-window__link:hover::before {
    opacity: 1;
}

.popup-window__link:active {
    transform: translateY(0);
}

/* ========== Контент плитки ========== */
.popup-window__link-content {
    position: relative;
    z-index: 1;
}

.popup-window__link-name {
    font-family: "Manrope", sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 1.3;
    color: #ffffff;
    margin: 0 0 8px;
    display: block;
}

.popup-window__link-desc {
    font-family: "Manrope", sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
    display: block;
}

/* ========== Иконка: справа снизу, крупнее ========== */
.popup-window__link-icon {
    position: ABSOLUTE;
    z-index: 0;
    align-self: flex-end;
    width: 250px;
    height: 250px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    right: 0;
    bottom: 0;
}

.popup-window__link-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ========== Адаптив ========== */

/* Планшеты — 2 колонки */
@media all and (max-width: 860px) {
    .popup-window {
        max-width: 640px;
    }

    .popup-window__list {
        flex-wrap: wrap;
    }

    .popup-window__list li {
        flex: 0 0 calc(50% - 10px);
        max-width: none;
    }

    .popup-window__link-icon {
        width: 150px;
        height: 150px;
    }
}

/* Мобильные — одна колонка */
@media all and (max-width: 860px) {
    .popup-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .popup-window {
        max-width: 100%;
        border-radius: 50px 50px 0 0;
        padding: 50px 20px 40px;
        animation: popupSlideUp 0.4s ease-out;
    }

    .popup-window__title {
        font-size: 28px;
    }

    .popup-window__subtitle {
        font-size: 15px;
        margin-bottom: 30px;
    }

    .popup-window__list {
        flex-direction: column;
        gap: 14px;
    }

    .popup-window__list li {
        flex: none;
        max-width: none;
    }

    .popup-window__link {
        flex-direction: row;
        aspect-ratio: auto;
        align-items: center;
        justify-content: flex-start;
        padding: 14px 20px;
        gap: 16px;
    }

    .popup-window__link-content {
        flex: 1;
        min-width: 0;
    }

    .popup-window__link-name {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .popup-window__link-desc {
        font-size: 12px;
    }

    .popup-window__link-icon {
        align-self: center;
        width: 100px;
        height: 100px;
        order: 1;
        position: relative;
    }
}

/* Совсем маленькие телефоны */
@media all and (max-width: 400px) {
    .popup-window {
        padding: 36px 14px 28px;
        border-radius: 40px 40px 0 0;
    }

    .popup-window__title {
        font-size: 22px;
    }

    .popup-window__subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .popup-window__link {
        padding: 12px 14px;
        gap: 12px;
        border-radius: 18px;
    }

    .popup-window__link-icon {
        width: 100px;
        height: 100px;
    }

    .popup-window__link-name {
        font-size: 14px;
    }

    .popup-window__link-desc {
        font-size: 11px;
    }
}