/* Single-source mobile navigation drawer. */
.mobile-drawer {
    display: none;
}

@media (max-width: 991px) {
    .offcanvas__area {
        display: none !important;
    }

    .mobile-drawer {
        --drawer-border: rgba(255, 255, 255, 0.12);
        --drawer-muted: rgba(255, 255, 255, 0.62);
        --drawer-primary: var(--primary, #d32f2e);
        position: fixed;
        top: calc(100px + env(safe-area-inset-top));
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 9998;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0;
        width: 100%;
        height: calc(100dvh - 100px - env(safe-area-inset-top));
        padding: 4px 20px max(16px, env(safe-area-inset-bottom));
        background:
            radial-gradient(circle at 100% 0, rgba(211, 47, 46, 0.16), transparent 34%),
            #070707;
        color: #fff;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
        box-sizing: border-box;
        overflow: hidden;
    }

    .mobile-drawer.is-open {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        transition: opacity 180ms ease, transform 180ms ease;
    }

    /* Header drawer üstünde kalır; hamburger kapatma ikonuna dönüşür. */
    body.mobile-drawer-open .header__area {
        z-index: 9999 !important;
        border-bottom-color: rgba(211, 47, 46, 0.45) !important;
    }

    .header__nav-icon button#open_offcanvas {
        position: relative !important;
        overflow: visible !important;
        transition: background-color 180ms ease !important;
    }

    .header__nav-icon button#open_offcanvas img,
    .header__nav-icon button#open_offcanvas .menu-label {
        transition: opacity 160ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1) !important;
    }

    body.mobile-drawer-open .header__nav-icon button#open_offcanvas {
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, 0.06) !important;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14) !important;
    }

    body.mobile-drawer-open .header__nav-icon button#open_offcanvas img,
    body.mobile-drawer-open .header__nav-icon button#open_offcanvas .menu-label,
    body.mobile-drawer-open .header__nav-icon button#open_offcanvas .interaction-hint-menu {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: scale(0.65) rotate(90deg) !important;
    }

    .header__nav-icon button#open_offcanvas .menu-close-icon {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        z-index: 3 !important;
        display: block !important;
        width: 18px !important;
        height: 18px !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transform: translate(-50%, -50%) rotate(-90deg) scale(0.65) !important;
        transition: opacity 160ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1) !important;
    }

    .header__nav-icon button#open_offcanvas .menu-close-icon span {
        position: absolute !important;
        top: 50% !important;
        left: 0 !important;
        display: block !important;
        width: 18px !important;
        height: 2px !important;
        border-radius: 2px !important;
        background: #fff !important;
    }

    .header__nav-icon button#open_offcanvas .menu-close-icon span:first-child {
        transform: rotate(45deg) !important;
    }

    .header__nav-icon button#open_offcanvas .menu-close-icon span:last-child {
        transform: rotate(-45deg) !important;
    }

    body.mobile-drawer-open .header__nav-icon button#open_offcanvas .menu-close-icon {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translate(-50%, -50%) rotate(0) scale(1) !important;
    }

    /* Menü açıkken alt floating öğeleri gizle */
    body.mobile-drawer-open #myDiv,
    body.mobile-drawer-open .venom-button,
    body.mobile-drawer-open #pcb-manage-btn,
    body.mobile-drawer-open .nagdos-consent-fab,
    body.mobile-drawer-open .cc-revoke,
    body.mobile-drawer-open .nagdos-ai-launcher {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .mobile-drawer__header {
        display: none;
    }

    .mobile-drawer__brand {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    .mobile-drawer__brand img {
        display: block;
        width: 134px;
        height: auto;
    }

    .mobile-drawer__close,
    .mobile-drawer__expand {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--drawer-border);
        color: #fff;
        background: rgba(255, 255, 255, 0.05);
        cursor: pointer;
    }

    .mobile-drawer__close {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        font-size: 24px;
    }

    .mobile-drawer__nav {
        flex: 0 0 auto;
        margin: 0;
        overflow: visible;
        border-top: 1px solid var(--drawer-border);
    }

    .mobile-drawer__link,
    .mobile-drawer__group-heading {
        min-height: 48px;
        border-bottom: 1px solid var(--drawer-border);
    }

    .mobile-drawer__link {
        display: flex;
        align-items: center;
        color: #fff;
        font-size: clamp(16px, 4.2vw, 18px);
        font-weight: 700;
        letter-spacing: -0.01em;
        line-height: 1.2;
        text-decoration: none;
    }

    .mobile-drawer__link:focus-visible,
    .mobile-drawer__expand:focus-visible,
    .mobile-drawer__close:focus-visible,
    .mobile-drawer__actions a:focus-visible {
        outline: 3px solid #fff;
        outline-offset: 3px;
    }

    .mobile-drawer__group-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .mobile-drawer__group-heading .mobile-drawer__link {
        min-width: 0;
        min-height: 48px;
        flex: 1;
        border: 0;
    }

    .mobile-drawer__expand {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        border-radius: 10px;
        font-size: 15px;
    }

    .mobile-drawer__expand[aria-expanded="true"] {
        color: #fff;
        border-color: var(--drawer-primary);
        background: var(--drawer-primary);
    }

    .mobile-drawer__submenu {
        display: grid;
        gap: 1px;
        margin: 0;
        padding: 6px 0 8px 14px;
        list-style: none;
        border-bottom: 1px solid var(--drawer-border);
        border-left: 2px solid var(--drawer-primary);
    }

    .mobile-drawer__submenu[hidden] {
        display: none;
    }

    .mobile-drawer__submenu a {
        display: block;
        padding: 7px 8px;
        color: var(--drawer-muted);
        font-size: 13px;
        font-weight: 600;
        line-height: 1.25;
        text-decoration: none;
    }

    .mobile-drawer__submenu a:hover,
    .mobile-drawer__submenu a:focus-visible {
        color: #fff;
    }

    /* Alt alan: kalan yüksekliği doldurur, menüye dokunmaz */
    .mobile-drawer__actions {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        align-items: center;
        justify-content: space-evenly;
        gap: 0;
        min-height: 0;
        margin: 0;
        padding: 8px 0 0;
        border-top: 0;
    }

    .mobile-drawer__eimza {
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        width: 100%;
        min-height: 64px;
        padding: 12px 14px;
        border: 1px solid rgba(211, 47, 46, 0.42);
        border-radius: 12px;
        background: linear-gradient(135deg, rgba(211, 47, 46, 0.15), rgba(255, 255, 255, 0.03));
        color: #fff;
        text-decoration: none;
        box-sizing: border-box;
    }

    .mobile-drawer__eimza-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        color: #ff6b6b;
        background: rgba(211, 47, 46, 0.14);
    }

    .mobile-drawer__eimza strong,
    .mobile-drawer__eimza small {
        display: block;
    }

    .mobile-drawer__eimza strong {
        font-size: 14px;
        line-height: 1.2;
    }

    .mobile-drawer__eimza small {
        margin-top: 3px;
        color: var(--drawer-muted);
        font-size: 11px;
        line-height: 1.3;
    }

    .mobile-drawer__language.lang-toggle-modern {
        position: relative;
        display: inline-flex !important;
        align-items: center;
        gap: 14px;
        justify-self: center;
        margin: 0 auto;
        flex: 0 0 auto;
    }

    .mobile-drawer__language .lang-opt {
        color: var(--drawer-muted) !important;
        font-size: 12px;
        font-weight: 700;
        text-align: center;
        text-decoration: none;
        text-shadow: none !important;
    }

    .mobile-drawer__language .lang-opt.active,
    .mobile-drawer__language .lang-opt.is-active {
        color: #fff !important;
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.3) !important;
    }

    .mobile-drawer__language-toggle.toggle-switch-btn {
        position: relative !important;
        display: inline-block !important;
        width: 50px;
        height: 28px;
        padding: 0;
        border: 0;
        background: transparent;
        cursor: pointer;
    }

    .mobile-drawer__language-toggle .toggle-track {
        position: relative;
        display: block !important;
        width: 50px !important;
        height: 28px !important;
        border-radius: 30px;
        background: rgba(255, 255, 255, 0.2);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    }

    .mobile-drawer__language-handle.toggle-handle {
        position: absolute !important;
        top: 2px !important;
        left: 2px !important;
        display: block !important;
        width: 24px !important;
        height: 24px !important;
        border-radius: 50% !important;
        background: #fff !important;
        box-shadow: 0 2px 7px rgba(0, 0, 0, 0.4) !important;
        transform: translateX(var(--lang-handle-x, 0px)) scale(0.9);
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
        animation: mobile-drawer-language-glow 2.2s ease-in-out infinite;
    }

    .mobile-drawer__language-handle.toggle-handle.slided {
        --lang-handle-x: 22px;
    }

    .mobile-drawer__language-hint.interaction-hint {
        position: absolute !important;
        top: 50% !important;
        left: 14px !important;
        right: auto !important;
        z-index: 10;
        display: block !important;
        color: #fff;
        font-size: 14px;
        line-height: 1;
        opacity: 0;
        pointer-events: none !important;
        transform: translateY(-50%);
    }

    .mobile-drawer__language-hint.interaction-hint.hint-en {
        left: auto !important;
        right: 14px !important;
    }

    .mobile-drawer__customer-wrap {
        position: relative !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        justify-self: center;
        flex: 0 0 auto;
        margin: 0 auto !important;
        padding-top: 32px !important;
    }

    .mobile-drawer__customer.customer-panel-btn {
        position: relative !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 42px;
        padding: 0 22px !important;
        border: 1px solid rgba(211, 47, 46, 0.65) !important;
        border-radius: 999px !important;
        color: #fff !important;
        font-size: 13px;
        font-weight: 700;
        text-decoration: none;
        background: transparent !important;
    }

    .mobile-drawer__customer i {
        color: var(--drawer-primary);
    }

    .mobile-drawer__customer-badge.npanel-tooltip {
        position: absolute !important;
        top: 0 !important;
        right: auto !important;
        bottom: auto !important;
        left: 50% !important;
        z-index: 2;
        display: inline-block !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 4px 9px !important;
        border: 0 !important;
        border-radius: 6px !important;
        color: #fff !important;
        background: var(--drawer-primary) !important;
        font-size: 9px !important;
        font-weight: 700 !important;
        letter-spacing: 0.08em;
        line-height: 1.1 !important;
        text-transform: uppercase;
        white-space: nowrap;
        transform: translateX(-50%) !important;
        box-shadow: 0 6px 14px rgba(211, 47, 46, 0.35);
        animation: npanelFloat 2.2s ease-in-out infinite !important;
        pointer-events: none;
    }

    .mobile-drawer__customer-badge.npanel-tooltip::after {
        position: absolute;
        top: 100%;
        left: 50%;
        border: 5px solid transparent;
        border-top-color: var(--drawer-primary);
        content: '' !important;
        transform: translateX(-50%);
    }

    .mobile-drawer__socials {
        display: flex;
        flex: 0 0 auto;
        justify-content: center;
        gap: 8px;
        margin-top: 0;
        padding: 4px 0 0;
    }

    .mobile-drawer__socials a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border: 1px solid var(--drawer-border);
        border-radius: 50%;
        color: var(--drawer-muted);
        text-decoration: none;
        transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
    }

    .mobile-drawer__socials a:hover,
    .mobile-drawer__socials a:focus-visible {
        border-color: var(--drawer-primary);
        color: #fff;
        background: rgba(211, 47, 46, 0.16);
    }

    .mobile-drawer__x-icon {
        font-family: Arial, sans-serif;
        font-size: 15px;
        font-weight: 800;
        line-height: 1;
    }

    body.mobile-drawer-open,
    html.mobile-drawer-open {
        overflow: hidden !important;
    }
}

@keyframes mobile-drawer-language-glow {
    0%,
    100% {
        box-shadow: 0 2px 7px rgba(0, 0, 0, 0.4);
    }

    50% {
        box-shadow: 0 2px 7px rgba(0, 0, 0, 0.4), 0 0 12px rgba(255, 255, 255, 0.32);
    }
}

/* Orta yükseklik: sosyal ikonları alttan kaldır */
@media (max-width: 991px) and (max-height: 760px) {
    .mobile-drawer__socials {
        display: none;
    }
}

/* Daha kısa: dil + nPanel yan yana birleşir */
@media (max-width: 991px) and (max-height: 680px) {
    .mobile-drawer__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-content: space-evenly;
        align-items: end;
        justify-items: center;
        gap: 14px 12px;
        padding-top: 10px;
    }

    .mobile-drawer__eimza {
        grid-column: 1 / -1;
        min-height: 56px;
        padding: 10px 12px;
    }

    .mobile-drawer__language.lang-toggle-modern {
        margin: 0;
        gap: 10px;
    }

    .mobile-drawer__customer-wrap {
        margin: 0 !important;
        padding-top: 28px !important;
    }
}

/* Çok kısa: rozeti küçült, boşlukları sıkı tut */
@media (max-width: 991px) and (max-height: 600px) {
    .mobile-drawer__actions {
        gap: 10px 10px;
        padding-top: 6px;
    }

    .mobile-drawer__eimza {
        min-height: 50px;
        padding: 8px 10px;
    }

    .mobile-drawer__eimza small {
        display: none;
    }

    .mobile-drawer__customer-badge.npanel-tooltip {
        padding: 3px 7px !important;
        font-size: 8px !important;
    }

    .mobile-drawer__customer-wrap {
        padding-top: 24px !important;
    }

    .mobile-drawer__customer.customer-panel-btn {
        min-height: 38px;
        padding: 0 16px !important;
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-drawer {
        transition: none;
    }

    .mobile-drawer__customer-badge.npanel-tooltip {
        animation: none;
    }

    .mobile-drawer__language-handle {
        animation: none;
    }

    .mobile-drawer__language-hint {
        animation: none;
    }
}
