/**
 * TM7 Modlar — Fancybox mod içeriği (tipografi, video alanı, backdrop)
 */

/* —— Overlay: mod pencerelerinde daha hafif, odak kartta —— */
.fancybox__container:has(.mod-popup-shell) {
    --fancybox-bg: rgba(15, 23, 42, 0.48);
    --fancybox-color: #f4f4f5;
    --fancybox-hover-color: #fff;
}

.fancybox__container:has(.mod-popup-shell) .fancybox__backdrop {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Taşan kapatma (kart köşesinin dışı) kesilmesin; gizli varsayılan close için üst padding’i sıfırla */
.fancybox__container:has(.mod-popup-shell) .fancybox__slide {
    overflow: visible;
}

.fancybox__container:has(.mod-popup-shell) .fancybox__slide.has-close-btn {
    padding-top: 4px;
}

/* Varsayılan Fancybox kapat — mod kartında özel buton kullanılıyor */
.fancybox__container:has(.mod-popup-shell) .f-button.is-close-btn {
    display: none !important;
}

/* Kart üzerinde, içerik (mod-popup-inner) alanının dışında sağ üst */

.mod-popup-close-floating {
    position: absolute;
    top: 0;
    right: clamp(6px, 1.8vw, 11px);
    z-index: 5;
    width: 50px;
    height: 50px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    background: #ffffff;
    color: #1f2937;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.14),
        0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translate(18%, -36%);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mod-popup-close-floating:hover {
    background: #f8fafc;
    color: #0f172a;
    transform: translate(18%, -36%) scale(1.05);
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.18),
        0 4px 10px rgba(0, 0, 0, 0.08);
}

.mod-popup-close-floating:focus {
    outline: none;
}

.mod-popup-close-floating:focus-visible {
    outline: 3px solid rgba(22, 178, 84, 0.45);
    outline-offset: 3px;
}

.mod-popup-close-floating__icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: block;
}

@media (max-width: 640px) {
    .mod-popup-close-floating {
        width: 46px;
        height: 46px;
        right: clamp(5px, 2.2vw, 10px);
        transform: translate(14%, -32%);
    }

    .mod-popup-close-floating:hover {
        transform: translate(14%, -32%) scale(1.05);
    }

    .mod-popup-close-floating__icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 400px) {
    .mod-popup-close-floating {
        width: 44px;
        height: 44px;
        right: 5px;
        transform: translate(10%, -28%);
    }

    .mod-popup-close-floating:hover {
        transform: translate(10%, -28%) scale(1.05);
    }

    .mod-popup-close-floating__icon {
        width: 19px;
        height: 19px;
    }
}

/* —— Modal kart —— */
.mod-popup-shell {
    box-sizing: border-box;
    position: relative;
    width: 100%;
    max-width: min(720px, calc(100vw - 32px));
    margin: 0;
    padding: 0;
    border-radius: 22px;
    overflow: visible;
    background: #fafafa;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow:
        0 32px 64px -16px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.mod-popup-shell:has(.mod-popup-video-block) {
    max-width: min(760px, calc(100vw - 32px));
}

.mod-popup-inner {
    box-sizing: border-box;
    width: 100%;
    border-radius: 22px;
    overflow-x: hidden;
    max-height: min(86vh, 880px);
    max-height: min(86dvh, 880px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: clamp(1.35rem, 4vw, 2rem) clamp(1.25rem, 4vw, 2rem);
    padding-bottom: max(
        clamp(1.35rem, 4vw, 2rem),
        env(safe-area-inset-bottom, 12px)
    );
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 48%, #f6f7f8 100%);
}

.mod-popup-title {
    margin: 0 0 0.4rem;
    padding: 0 0 1rem;
    font-size: clamp(1.25rem, 2.85vw, 1.55rem);
    font-weight: 600;
    line-height: 1.22;
    letter-spacing: -0.025em;
    color: #0f172a;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    position: relative;
}

.mod-popup-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 2.75rem;
    height: 3px;
    background: linear-gradient(90deg, #16b254, #2ee074);
    border-radius: 3px 3px 0 0;
}

.mod-popup-body {
    margin-top: 1.15rem;
    font-size: clamp(0.9375rem, 2.1vw, 1.02rem);
    font-weight: 500;
    line-height: 1.68;
    color: rgba(15, 23, 42, 0.78);
    word-break: break-word;
}

.mod-popup-body p {
    margin: 0 0 0.9em;
}

.mod-popup-body p:last-child {
    margin-bottom: 0;
}

/* Video bölümü */
.mod-popup-video-block {
    margin-top: 1.5rem;
    padding-top: 1.35rem;
    border-top: 1px solid rgba(15, 23, 42, 0.07);
}

.mod-popup-video-block::before {
    content: "Tanıtım videosu";
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.42);
    margin-bottom: 0.7rem;
}

.mod-local-video-wrap {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(145deg, #0c0c0c 0%, #1a1a1a 100%);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.mod-local-video {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: bottom;
}

@media (max-width: 480px) {
    .mod-popup-shell {
        border-radius: 18px;
        max-width: calc(100vw - 20px);
    }

    .mod-popup-inner {
        max-height: min(84dvh, 820px);
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .mod-popup-title {
        padding-bottom: 0.85rem;
    }

    .mod-local-video-wrap {
        border-radius: 12px;
    }
}

/* Kart üzerindeki + (erişilebilir minimum hedef, hafif derinlik) */
.filter-item .open-tab-button {
    min-width: 44px;
    min-height: 44px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    transition:
        transform 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.filter-item .open-tab-button:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

@media (max-width: 640px) {
    .filter-item .open-tab-button {
        min-width: 40px;
        min-height: 40px;
    }
}

.fancybox__container .fancybox__slide .mod-popup-shell {
    margin-left: auto;
    margin-right: auto;
}
