/* ============================================================
   Sabi Logistics — Off-canvas mobile drawer
   ============================================================ */

.mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 200000;
    pointer-events: none;
    visibility: hidden;
}

.mobile-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
}

/* Overlay */
.mobile-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 18, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s var(--sabi-ease, cubic-bezier(0.16, 1, 0.3, 1));
    cursor: pointer;
}

.mobile-drawer.is-open .mobile-drawer__overlay {
    opacity: 1;
}

/* Panel — slides from right */
.mobile-drawer__panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(90vw, 380px);
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #12182b 0%, #0b1020 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -24px 0 80px rgba(0, 0, 0, 0.45);
    transform: translateX(105%);
    transition: transform 0.45s var(--sabi-ease, cubic-bezier(0.16, 1, 0.3, 1));
    overflow: hidden;
}

.mobile-drawer.is-open .mobile-drawer__panel {
    transform: translateX(0);
}

/* Close button — glass circle, always visible */
.mobile-drawer__close {
    position: absolute;
    top: max(1rem, env(safe-area-inset-top, 0px));
    right: max(1rem, env(safe-area-inset-right, 0px));
    z-index: 5;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.mobile-drawer__close:hover,
.mobile-drawer__close:focus-visible {
    background: rgba(255, 107, 0, 0.15);
    border-color: rgba(255, 107, 0, 0.4);
    outline: none;
}

.mobile-drawer__close svg {
    width: 20px;
    height: 20px;
}

/* Scrollable nav area */
.mobile-drawer__scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding:
        calc(max(1.25rem, env(safe-area-inset-top, 0px)) + 56px)
        1.5rem
        max(1.5rem, env(safe-area-inset-bottom, 0px));
}

.mobile-drawer__brand {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-drawer__brand img {
    width: min(140px, 50vw);
    height: auto;
}

/* Nav list */
.mobile-drawer__nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-drawer__nav > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-drawer__item-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-drawer__nav > li > .mobile-drawer__item-row > a,
.mobile-drawer__nav > li > a {
    flex: 1;
    display: block;
    padding: 1rem 0;
    font-family: var(--font-ui, 'Poppins', sans-serif);
    font-size: clamp(1rem, 3.5vw, 1.125rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.92);
    transition: color 0.25s ease;
}

.mobile-drawer__nav a:hover,
.mobile-drawer__nav .current-menu-item > .mobile-drawer__item-row > a,
.mobile-drawer__nav .current-menu-item > a,
.mobile-drawer__nav .current-menu-ancestor > .mobile-drawer__item-row > a {
    color: #ff6b00;
}

/* Submenu accordion toggle */
.mobile-drawer__sub-toggle {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.35s ease;
}

.mobile-drawer__sub-toggle:hover,
.mobile-drawer__sub-toggle:focus-visible {
    background: rgba(255, 107, 0, 0.12);
    border-color: rgba(255, 107, 0, 0.35);
    outline: none;
}

.mobile-drawer__sub-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform 0.35s var(--sabi-ease, ease);
}

.mobile-drawer__nav .menu-item-has-children.is-open > .mobile-drawer__item-row .mobile-drawer__sub-toggle svg {
    transform: rotate(180deg);
}

/* Submenu — accordion */
.mobile-drawer__nav .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 0.5rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
        max-height 0.45s var(--sabi-ease, ease),
        opacity 0.35s ease,
        padding 0.35s ease;
}

.mobile-drawer__nav .menu-item-has-children.is-open > .sub-menu {
    max-height: 480px;
    opacity: 1;
    padding-bottom: 0.75rem;
}

.mobile-drawer__nav .sub-menu a {
    display: block;
    padding: 0.65rem 0 0.65rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
    border-left: 2px solid rgba(255, 107, 0, 0.35);
    margin-left: 0.25rem;
    transition: color 0.25s ease, border-color 0.25s ease;
}

.mobile-drawer__nav .sub-menu a:hover,
.mobile-drawer__nav .sub-menu .current-menu-item a {
    color: #ff6b00;
    border-left-color: #ff6b00;
}

/* Footer actions */
.mobile-drawer__actions {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-drawer__phone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0 1.25rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
}

.mobile-drawer__phone svg {
    color: #ff6b00;
    flex-shrink: 0;
}

.mobile-drawer__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 1.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff6b00, #ff8533);
    color: #fff !important;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 8px 28px rgba(255, 107, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mobile-drawer__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(255, 107, 0, 0.4);
}

/* Body scroll lock */
html.mobile-drawer-open,
body.mobile-drawer-open {
    overflow: hidden !important;
    touch-action: none;
}

/* Header mobile — stable bar */
@media (max-width: 991px) {
    .site-header {
        --header-h: 72px;
        padding: 14px 0;
    }

    .site-header.scrolled,
    .site-header.is-scrolled {
        padding: 10px 0;
    }

    .header-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        min-height: 44px;
    }

    .header-center {
        position: static;
        z-index: auto;
        flex: 1;
        min-width: 0;
    }

    .site-logo img {
        width: min(132px, 38vw);
        max-height: 48px;
        object-fit: contain;
    }

    .mobile-toggle {
        position: relative;
        z-index: 2;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.04);
        gap: 5px;
    }

    .mobile-toggle span {
        width: 22px;
        height: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-drawer__panel,
    .mobile-drawer__overlay,
    .mobile-drawer__nav .sub-menu,
    .mobile-drawer__sub-toggle svg {
        transition: none;
    }
}
