/* ========================================================= */
/* --- MOBİL ÖZEL ALT PANEL (ERKAP KAPI - NEON ALTIN DOCK) --- */
/* Ara + WhatsApp | LOGO | Sosyal + Yukarı Çık                */
/* ========================================================= */

/* Masaüstünde tamamen gizli */
.mp-root {
    display: none;
}

@media screen and (max-width: 768px) {

    :root {
        --mp-h: 96px;           /* Dock yüksekliği + alt boşluk (safe-area hariç) */
        --mp-icon: 38px;        /* Tüm yuvarlak butonların ortak boyutu */
        --mp-glyph: 16px;
        --mp-radius: 13px;      /* Buton köşe yuvarlaklığı (50% yaparsan tekrar daire olur) */
        --mp-gold: #c5a059;
        --mp-gold-light: #e2b765;
        --mp-gold-hot: #f0c978;
        --mp-gold-ring: linear-gradient(140deg, #fff0c4 0%, #e2b765 28%, #a8823a 60%, #6e5120 100%);
    }

    .mp-root {
        display: block;
    }

    /* Panel sayfa içeriğinin üstünü kapatmasın */
    body {
        padding-bottom: calc(var(--mp-h) + env(safe-area-inset-bottom, 0px));
    }

    /* Eski dağınık butonlar mobilde gizlenir (masaüstünde çalışmaya devam eder) */
    .qc-wrap,
    .sticky-social-bar,
    .scroll-top-btn {
        display: none !important;
    }

    /* --- ALT KARARTMA GEÇİŞİ: içerik panelin çevresinden sızmaz --- */
    .mp-fade {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(var(--mp-h) + 18px + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(to top, rgba(6, 7, 9, 0.94) 0%, rgba(6, 7, 9, 0.78) 45%, rgba(6, 7, 9, 0) 100%);
        pointer-events: none;
        z-index: 9985;
    }

    /* --- ARKA PLAN KARARTMA (sosyal kart açılınca) --- */
    .mp-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(8, 9, 11, 0.55);
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 9988;
    }

    .mp-open .mp-backdrop {
        opacity: 1;
        visibility: visible;
    }

    /* --- ALT DOCK (yüzen, kavisli, neon çerçeveli) --- */
    .mp-dock {
        position: fixed;
        left: 50%;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        transform: translateX(-50%);
        width: calc(100% - 20px);
        max-width: 560px;
        height: 88px;
        z-index: 9990;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: end;
        padding: 0 6px 11px;
        filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6));
        animation: mp-rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    }

    @keyframes mp-rise {
        from { opacity: 0; transform: translateX(-50%) translateY(40px); }
        to   { opacity: 1; transform: translateX(-50%) translateY(0); }
    }

    /* Panel şekli: koyu cam zemin + parlayan altın kenar */
    .mp-shape {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: visible;
        pointer-events: none;
        z-index: 0;
        filter: drop-shadow(0 0 3px rgba(240, 201, 120, 0.4));
    }

    .mp-shape-inner {
        display: none;
    }

    .mp-group {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: flex-end;
        justify-content: space-evenly;
        gap: 2px;
        min-width: 0;
    }

    /* --- ORTA LOGO + DİKEY AYIRAÇLAR --- */
    .mp-logo {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        align-self: center;
        height: 44px;
        padding: 0 12px;
        margin-top: 8px;
        -webkit-tap-highlight-color: transparent;
    }

    .mp-logo::before,
    .mp-logo::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 1px;
        background: linear-gradient(180deg, transparent, rgba(240, 201, 120, 0.8), transparent);
    }

    .mp-logo::before { left: 0; }
    .mp-logo::after  { right: 0; }

    .mp-logo img {
        display: block;
        height: 27px;
        width: auto;
        max-width: 96px;
        object-fit: contain;
        filter: drop-shadow(0 2px 6px rgba(226, 183, 101, 0.35));
    }

    /* --- DOCK ÖĞELERİ --- */
    .mp-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        min-width: 48px;
        padding: 0;
        margin: 0;
        border: none;
        background: transparent;
        color: #ffffff;
        text-decoration: none;
        cursor: pointer;
        font-family: inherit;
        -webkit-tap-highlight-color: transparent;
        outline: none;
    }

    /* Tüm yuvarlak butonlar aynı boyut: gradient altın halka + koyu cam zemin */
    .mp-icon {
        position: relative;
        flex: 0 0 var(--mp-icon);
        width: var(--mp-icon);
        height: var(--mp-icon);
        min-width: var(--mp-icon);
        min-height: var(--mp-icon);
        border-radius: var(--mp-radius);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--mp-gold-hot);
        border: 1.5px solid transparent;
        background:
            radial-gradient(circle at 32% 26%, #2d3037 0%, #14161a 62%, #0a0b0d 100%) padding-box,
            var(--mp-gold-ring) border-box;
        box-shadow:
            0 0 6px rgba(226, 183, 101, 0.3),
            0 3px 6px rgba(0, 0, 0, 0.5);
        transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.25s ease;
    }

    /* Üst kenarda cam parlaması */
    .mp-icon::before {
        display: none;
        content: '';
        position: absolute;
        top: 3px;
        left: 8px;
        right: 8px;
        height: 38%;
        border-radius: 50%;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
        pointer-events: none;
    }

    /* Ortak sembol: hepsi aynı kutuda, aynı boyutta */
    .mp-icon i {
        position: relative;
        width: 1em;
        font-size: var(--mp-glyph);
        line-height: 1;
        text-align: center;
        filter: drop-shadow(0 0 3px rgba(240, 201, 120, 0.45));
    }

    .mp-item:active .mp-icon {
        transform: scale(0.9);
    }

    .mp-item:focus-visible .mp-icon {
        outline: 2px solid #ffffff;
        outline-offset: 3px;
    }

    .mp-label {
        display: block;
        height: 11px;
        font-size: 10px;
        font-weight: 600;
        line-height: 11px;
        letter-spacing: 0.3px;
        color: rgba(255, 255, 255, 0.92);
        white-space: nowrap;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    }

    /* ARA: nazik nabız halkası */
    .mp-call .mp-icon::after {
        content: '';
        position: absolute;
        inset: -2px;
        border-radius: var(--mp-radius);
        pointer-events: none;
    }

    @keyframes mp-pulse {
        0%   { box-shadow: 0 0 0 0 rgba(240, 201, 120, 0.55); }
        70%  { box-shadow: 0 0 0 13px rgba(240, 201, 120, 0); }
        100% { box-shadow: 0 0 0 0 rgba(240, 201, 120, 0); }
    }

    /* WHATSAPP: yeşil cam dolgu + aynı altın halka */
    .mp-wa .mp-icon {
        color: #ffffff;
        background:
            radial-gradient(circle at 32% 26%, #4ff08f 0%, #19b35a 45%, #0b6b36 100%) padding-box,
            var(--mp-gold-ring) border-box;
        box-shadow:
            0 0 6px rgba(37, 211, 102, 0.3),
            0 3px 6px rgba(0, 0, 0, 0.5);
    }

    .mp-wa .mp-icon i {
        font-size: 21px; /* WhatsApp sembolü kendi içinde boşluklu, optik denge için */
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
    }

    /* SOSYAL açıkken parlama */
    .mp-open .mp-social .mp-icon {
        background:
            radial-gradient(circle at 32% 26%, #5a4521 0%, #2a2112 70%) padding-box,
            var(--mp-gold-ring) border-box;
        box-shadow: 0 0 10px rgba(240, 201, 120, 0.6);
        color: #ffffff;
    }

    .mp-open .mp-social .mp-label {
        color: var(--mp-gold-hot);
    }

    /* YUKARI ÇIK: halka ilerleme göstergesi (kenarı SVG halka çizer) */
    .mp-top .mp-icon {
        background: radial-gradient(circle at 32% 26%, #2d3037 0%, #14161a 62%, #0a0b0d 100%);
        border-color: transparent;
    }

    .mp-ring {
        position: absolute;
        inset: -1.5px;
        width: calc(100% + 3px);
        height: calc(100% + 3px);
        pointer-events: none;
        overflow: visible;
    }

    .mp-ring-bg,
    .mp-ring-fg {
        fill: none;
        stroke-width: 2;
    }

    .mp-ring-bg {
        stroke: rgba(226, 183, 101, 0.5);
    }

    .mp-ring-fg {
        stroke: #fff0c4;
        stroke-linecap: round;
        filter: drop-shadow(0 0 2px rgba(240, 201, 120, 0.8));
        transition: stroke-dashoffset 0.1s linear;
    }

    /* Sayfanın en üstündeyken ok hafif sönük, aşağı inince parlar */
    .mp-top .mp-icon i {
        opacity: 0.6;
        transition: opacity 0.35s ease, transform 0.35s ease;
    }

    .mp-top.mp-active .mp-icon i {
        opacity: 1;
        transform: translateY(-1px);
    }

    .mp-top.mp-active .mp-icon {
        box-shadow: 0 0 8px rgba(240, 201, 120, 0.45), 0 3px 6px rgba(0, 0, 0, 0.5);
    }

    /* --- SOSYAL MEDYA AÇILIR KART --- */
    .mp-sheet {
        position: fixed;
        left: 14px;
        right: 14px;
        max-width: 540px;
        margin: 0 auto;
        bottom: calc(var(--mp-h) + env(safe-area-inset-bottom, 0px) + 8px);
        z-index: 9989;
        padding: 14px 14px 16px;
        background: linear-gradient(180deg, rgba(26, 27, 32, 0.97), rgba(10, 11, 13, 0.97));
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(226, 183, 101, 0.4);
        border-top: 2px solid var(--mp-gold-hot);
        border-radius: 22px;
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(240, 201, 120, 0.2);
        opacity: 0;
        visibility: hidden;
        transform: translateY(24px) scale(0.96);
        transform-origin: bottom center;
        transition: opacity 0.28s ease, visibility 0.28s ease, transform 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
    }

    .mp-open .mp-sheet {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

    .mp-sheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
    }

    .mp-sheet-title {
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 1.2px;
        text-transform: uppercase;
        color: var(--mp-gold-hot);
    }

    .mp-sheet-close {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        border: 1px solid rgba(226, 183, 101, 0.35);
        background: rgba(255, 255, 255, 0.05);
        color: #ffffff;
        font-size: 13px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
    }

    .mp-sheet-links {
        display: flex;
        gap: 10px;
    }

    .mp-chip {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 12px 8px 8px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(226, 183, 101, 0.35);
        border-radius: 40px;
        color: #ffffff;
        text-decoration: none;
        font-size: 13px;
        font-weight: 600;
        transition: background 0.25s ease, border-color 0.25s ease;
    }

    .mp-chip:active {
        background: rgba(197, 160, 89, 0.15);
        border-color: var(--mp-gold-light);
    }

    .mp-chip-icon {
        flex-shrink: 0;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        color: #ffffff;
        border: 1px solid rgba(255, 255, 255, 0.25);
    }

    .mp-fb .mp-chip-icon {
        background: #1877f2;
    }

    .mp-ig .mp-chip-icon {
        background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    }

    /* Dar ekranlar */
    @media screen and (max-width: 360px) {
        :root {
            --mp-icon: 34px;
            --mp-glyph: 15px;
        }
        .mp-wa .mp-icon i { font-size: 19px; }
        .mp-item { min-width: 44px; }
        .mp-logo { padding: 0 8px; }
        .mp-logo img { height: 23px; max-width: 80px; }
        .mp-label { font-size: 9.5px; }
    }

    @media screen and (max-width: 340px) {
        .mp-sheet-links {
            flex-direction: column;
        }
    }

    /* RTL (Arapça) */
    .mp-root[dir="rtl"] .mp-chip {
        padding: 8px 8px 8px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mp-dock { animation: none; }
    .mp-call .mp-icon::after { animation: none; }
    .mp-shape-sweep { display: none; }
    .mp-sheet,
    .mp-backdrop,
    .mp-icon,
    .mp-ring-fg {
        transition-duration: 0.01s;
    }
}