
/* =========================================
   KWICK FIN SOLUTIONS - MOBILE SIDE DRAWER
========================================= */

/* Overlay */

.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 1090;

    background: rgba(4, 13, 28, 0.58);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);

    opacity: 0;
    visibility: hidden;

    transition: var(--transition-normal);
}

.drawer-overlay.show {
    opacity: 1;
    visibility: visible;
}


/* Drawer */

.mobile-side-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;

    z-index: 1100;

    width: min(340px, 88vw);
    height: 100vh;
    height: 100dvh;
    
    display: flex;
    flex-direction: column;

    background: var(--bg-surface);
    color: var(--text-primary);

    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);

    transform: translateX(-105%);
    visibility: hidden;

    transition:
        transform 0.35s cubic-bezier(.22,.61,.36,1),
        visibility 0.35s ease;
}

.mobile-side-drawer.open {
    transform: translateX(0);
    visibility: visible;
}


/* Drawer Header */

.drawer-header {
    min-height: 76px;
    padding: 12px 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border-color);
}

.drawer-close {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border-color);
    border-radius: 10px;

    background: var(--bg-soft);
    color: var(--text-primary);

    font-size: 17px;
    transition: var(--transition-fast);
}

.drawer-close:hover {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}


/* Welcome Card */

.drawer-welcome {
    display: flex;
    align-items: center;
    gap: 13px;

    margin: 18px 16px;
    padding: 16px;

    background: var(--bg-soft);
    border-radius: var(--radius-md);
}

.drawer-welcome-icon {
    width: 45px;
    height: 45px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: var(--primary);
    color: #FFFFFF;

    font-size: 21px;
}

.drawer-welcome h5 {
    font-size: 14px;
    margin-bottom: 3px;
}

.drawer-welcome p {
    margin: 0;
    font-size: 11px;
}


/* Drawer Scroll Area */

.drawer-body {
    flex: 1;
    min-height: 0;

    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 5px 16px 15px;
}

.drawer-label {
    display: block;

    margin: 8px 10px 10px;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.3px;

    color: var(--text-muted);
}

.drawer-label-spaced {
    margin-top: 24px;
}


/* Navigation Links */

.drawer-navigation {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.drawer-link {
    min-height: 48px;

    display: flex;
    align-items: center;
    gap: 13px;

    padding: 10px 12px;

    color: var(--text-secondary);

    font-size: 13px;
    font-weight: 650;

    border-radius: 10px;

    transition: var(--transition-fast);
}

.drawer-link > i:first-child {
    width: 23px;
    flex-shrink: 0;

    font-size: 19px;
    color: var(--secondary);
}

.drawer-link:hover {
    color: var(--primary);
    background: var(--bg-soft);
}

.drawer-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.drawer-link.active > i:first-child {
    color: var(--secondary);
}

[data-theme="dark"] .drawer-link.active {
    color: var(--text-primary);
    background: var(--bg-soft);
}

.drawer-arrow {
    margin-left: auto;
    font-size: 11px !important;
    color: var(--text-muted) !important;
}


/* Drawer Footer */

.drawer-footer {
    flex-shrink: 0;

    padding: 15px 18px 10px;

    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.drawer-theme-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 14px;
}

.drawer-theme-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drawer-theme-info > i {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;
    background: var(--bg-soft);

    color: var(--secondary);
    font-size: 19px;
}

.drawer-theme-info div {
    display: flex;
    flex-direction: column;
}

.drawer-theme-info strong {
    font-size: 13px;
    color: var(--text-primary);
}

.drawer-theme-info small {
    font-size: 11px;
    color: var(--text-muted);
}


/* Apply Button */

.drawer-apply-btn {
    min-height: 48px;
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    background: var(--btn-primary-bg);
    color: #FFFFFF;

    border-radius: var(--radius-pill);

    font-size: 14px;
    font-weight: 700;

    transition: var(--transition-normal);
}

.drawer-apply-btn:hover {
    color: #FFFFFF;
    background: var(--secondary);
}

.drawer-copyright {
    margin: 12px 0 0;
    text-align: center;

    color: var(--text-muted);
    font-size: 10px;
}


/* Drawer only on mobile/tablet */

@media (min-width: 992px) {

    .drawer-overlay,
    .mobile-side-drawer {
        display: none;
    }

}


/* Small Mobile */

@media (max-width: 380px) {

    .mobile-side-drawer {
        width: min(320px, 90vw);
    }

    .drawer-welcome {
        padding: 13px;
    }

}



/* Prevent background scrolling when drawer is open */

body.drawer-open {
    overflow: hidden;
    touch-action: none;
}

/* Allow scrolling inside drawer */

.mobile-side-drawer {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.drawer-body {
    touch-action: pan-y;
}

/* Reduced motion accessibility */

@media (prefers-reduced-motion: reduce) {

    .mobile-side-drawer,
    .drawer-overlay,
    .drawer-link,
    .mobile-menu-toggle span {
        transition: none;
    }

}
