/**
 * ATC mobile navigation drawer – isolated from Bootstrap (load after bootstrap + style.css)
 */

:root {
    --atc-navbar-height: 72px;
}

body.atc-mnav-open {
    overflow: hidden;
    touch-action: none;
}

/* Sticky mobile header – logo + toggle always visible */
@media (max-width: 991.98px) {
    body {
        padding-top: var(--atc-navbar-height);
    }

    .navbar-atc {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1100;
        min-height: var(--atc-navbar-height);
        padding: 0.5rem 0 !important;
        background: rgba(13, 17, 23, 0.96) !important;
        backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    }

    .navbar-atc .navbar-atc__inner {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        gap: 0.75rem;
        min-height: calc(var(--atc-navbar-height) - 1rem);
        max-width: 100%;
        padding-right: 3.75rem;
        overflow: hidden;
    }

    .navbar-atc .navbar-brand {
        flex: 0 1 auto;
        min-width: 0;
        max-width: calc(100% - 3.75rem);
        margin-right: 0;
        padding: 0;
    }

    .navbar-atc .navbar-brand .navbar-logo {
        height: 40px;
        max-width: 100%;
        width: auto;
    }

    .navbar-atc #navbarNavDesktop {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute !important;
        visibility: hidden !important;
    }

    /* Pin toggle to viewport – always visible, no horizontal scroll needed */
    .atc-mnav-toggle {
        position: fixed !important;
        top: calc((var(--atc-navbar-height) - 46px) / 2);
        right: max(0.75rem, env(safe-area-inset-right, 0px));
        margin-left: 0;
        z-index: 1102;
    }

    .page-hero {
        padding-top: 2.5rem;
    }

    .hero-section {
        padding-top: 2rem;
    }
}

/* Toggle in header */
.atc-mnav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    margin-left: auto;
    position: relative;
    z-index: 1101;
    width: 46px;
    height: 46px;
    padding: 10px;
    border: 2px solid #d4a64a;
    border-radius: 12px;
    background: rgba(212, 166, 74, 0.18);
    box-shadow: 0 0 16px rgba(212, 166, 74, 0.3);
    cursor: pointer;
    transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}

.atc-mnav-toggle:hover,
.atc-mnav-toggle:focus {
    background: rgba(212, 166, 74, 0.32);
    box-shadow: 0 0 22px rgba(212, 166, 74, 0.45);
    outline: none;
}

.atc-mnav-toggle__bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #d4a64a;
    border-radius: 2px;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.atc-mnav-toggle[aria-expanded="true"] .atc-mnav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.atc-mnav-toggle[aria-expanded="true"] .atc-mnav-toggle__bar:nth-child(2) {
    opacity: 0;
}

.atc-mnav-toggle[aria-expanded="true"] .atc-mnav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Root wrapper – clip drawer so it never widens the page */
.atc-mnav {
    position: fixed;
    inset: 0;
    z-index: 1090;
    pointer-events: none;
    visibility: hidden;
    overflow: hidden;
    max-width: 100vw;
    clip-path: inset(0);
}

.atc-mnav.is-active {
    pointer-events: auto;
    visibility: visible;
}

/* Backdrop */
.atc-mnav__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.atc-mnav.is-active .atc-mnav__backdrop {
    opacity: 1;
}

/* Drawer panel */
.atc-mnav__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 100vw);
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    background: #0d1117;
    background: linear-gradient(165deg, #062b57 0%, #0d1117 42%, #161b22 100%);
    border-left: 1px solid rgba(212, 166, 74, 0.4);
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.65);
    transform: translate3d(100%, 0, 0);
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
    will-change: transform;
}

.atc-mnav.is-active .atc-mnav__panel {
    transform: translate3d(0, 0, 0);
}

.atc-mnav:not(.is-active) .atc-mnav__panel {
    pointer-events: none;
}

.atc-mnav__panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #d4a64a, #e8c06a, #d4a64a);
    z-index: 3;
}

.atc-mnav__glow {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(212, 166, 74, 0.08);
    filter: blur(60px);
    top: -60px;
    right: -40px;
    pointer-events: none;
}

/* Header */
.atc-mnav__head {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.atc-mnav__head .navbar-logo {
    height: 44px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.atc-mnav__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #e6edf3;
    font-size: 1.15rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.atc-mnav__close:hover,
.atc-mnav__close:focus {
    background: rgba(212, 166, 74, 0.2);
    border-color: rgba(212, 166, 74, 0.45);
    color: #d4a64a;
    outline: none;
}

/* Scrollable body */
.atc-mnav__body {
    position: relative;
    z-index: 2;
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.75rem 1rem 1.5rem;
    -webkit-overflow-scrolling: touch;
}

.atc-mnav__section-label {
    margin: 0 0 0.75rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #d4a64a;
}

.atc-mnav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.atc-mnav__item {
    display: block;
    width: 100%;
}

.atc-mnav__link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #e6edf3;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.22s, border-color 0.22s, color 0.22s, transform 0.22s;
}

.atc-mnav__link:hover,
.atc-mnav__link:focus {
    background: rgba(212, 166, 74, 0.12);
    border-color: rgba(212, 166, 74, 0.35);
    color: #d4a64a;
    outline: none;
}

.atc-mnav__link.active {
    background: rgba(212, 166, 74, 0.18);
    border-color: rgba(212, 166, 74, 0.5);
    color: #d4a64a;
}

.atc-mnav__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(6, 43, 87, 0.65);
    color: #d4a64a;
    font-size: 0.95rem;
}

.atc-mnav__text {
    flex: 1;
    min-width: 0;
}

.atc-mnav__arrow {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: rgba(230, 237, 243, 0.35);
    transition: color 0.22s, transform 0.22s;
}

.atc-mnav__link:hover .atc-mnav__arrow,
.atc-mnav__link:focus .atc-mnav__arrow {
    color: #d4a64a;
    transform: translateX(3px);
}

/* Footer CTA */
.atc-mnav__foot {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    padding: 1rem 1.25rem 1.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
}

.atc-mnav__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.95rem 1.25rem;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #d4a64a, #e8c06a);
    color: #062b57;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(212, 166, 74, 0.25);
    transition: transform 0.25s, box-shadow 0.25s;
}

.atc-mnav__cta:hover,
.atc-mnav__cta:focus {
    color: #062b57;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(212, 166, 74, 0.35);
}

.atc-mnav__contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
    font-size: 0.88rem;
    color: rgba(230, 237, 243, 0.65);
    text-decoration: none;
}

.atc-mnav__contact:hover {
    color: #d4a64a;
}

/* Stagger reveal when open */
.atc-mnav.is-active .atc-mnav__item {
    animation: atcMnavItemIn 0.45s ease backwards;
}

.atc-mnav.is-active .atc-mnav__item:nth-child(1) { animation-delay: 0.05s; }
.atc-mnav.is-active .atc-mnav__item:nth-child(2) { animation-delay: 0.08s; }
.atc-mnav.is-active .atc-mnav__item:nth-child(3) { animation-delay: 0.11s; }
.atc-mnav.is-active .atc-mnav__item:nth-child(4) { animation-delay: 0.14s; }
.atc-mnav.is-active .atc-mnav__item:nth-child(5) { animation-delay: 0.17s; }
.atc-mnav.is-active .atc-mnav__item:nth-child(6) { animation-delay: 0.2s; }
.atc-mnav.is-active .atc-mnav__item:nth-child(7) { animation-delay: 0.23s; }

@keyframes atcMnavItemIn {
    from {
        opacity: 0;
        transform: translateX(16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (min-width: 992px) {
    .atc-mnav-toggle {
        display: none !important;
    }

    .atc-mnav {
        display: none !important;
    }
}
