/* ============================================================
   Indiagram — Mobile nav mega menu + touch polish
   Loaded after redesign.css
   ============================================================ */

/* ---- Mobile drawer close control ---- */
.sb-sidebar__close {
    display: none;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: var(--sb-surface-2);
    color: var(--sb-ink);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* ---- Mega quick-links (platform grid at top of drawer) ---- */
.sb-mega {
    display: none;
    padding: 0 10px 12px;
    border-bottom: 1px solid var(--sb-border);
    margin-bottom: 6px;
}
.sb-mega__label {
    display: block;
    padding: 8px 12px 6px;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--sb-muted);
    font-weight: 600;
}
.sb-mega__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0 4px;
}
.sb-mega__chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 72px;
    padding: 10px 6px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--sb-ink);
    background: var(--sb-surface-2);
    border: 1px solid var(--sb-border);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    transition: transform .2s var(--sb-ease), border-color .2s var(--sb-ease), background .2s var(--sb-ease);
}
.sb-mega__chip i {
    font-size: 20px;
    color: var(--sb-brand);
}
.sb-mega__chip:active {
    transform: scale(.97);
    background: var(--sb-grad-soft);
    border-color: rgba(251, 95, 20, .35);
}

/* ---- Nav search / filter ---- */
.sb-nav-search {
    display: none;
    padding: 8px 10px 4px;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--sb-sidebar-bg);
}
.sb-nav-search input {
    width: 100%;
    font-family: var(--sb-font-body);
    font-size: 16px;
    padding: 11px 14px 11px 38px;
    border-radius: 12px;
    border: 1px solid var(--sb-border);
    background: var(--sb-surface-2);
    color: var(--sb-ink);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2376728c' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
}
.sb-nav-search input:focus {
    outline: none;
    border-color: #FB5F14;
    box-shadow: 0 0 0 3px rgba(251, 95, 20, .15);
}
.sb-nav-search input::placeholder { color: var(--sb-muted); }

.sb-group.is-filter-hidden,
.sb-item.is-filter-hidden {
    display: none !important;
}
.sb-nav-empty {
    display: none;
    padding: 20px 16px;
    text-align: center;
    color: var(--sb-muted);
    font-size: 14px;
}

/* ---- Mobile-only drawer enhancements ---- */
@media (max-width: 992px) {
    .sb-sidebar__close { display: inline-flex; }
    .sb-mega { display: block; }
    .sb-nav-search { display: block; }

    .sb-sidebar {
        width: min(92vw, 340px) !important;
    }
    .sb-sidebar__header {
        padding: 10px 12px;
        gap: 8px;
    }
    .sb-sidebar__header .sb-theme-toggle {
        display: none;
    }
    .sb-nav {
        padding-top: 4px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .sb-group__label {
        position: sticky;
        top: 52px;
        z-index: 1;
        background: var(--sb-sidebar-bg);
        padding-top: 10px;
        padding-bottom: 6px;
        margin-top: 4px;
    }
    .sb-submenu .sb-item {
        padding-left: 20px;
        min-height: 46px;
    }
    .sb-item__icon {
        flex: 0 0 26px;
        width: 26px;
        font-size: 17px;
    }
    .sb-topbar {
        padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
        height: calc(var(--sb-topbar-h) + env(safe-area-inset-top, 0px));
        padding-top: env(safe-area-inset-top, 0px);
    }
    body.sb-shell {
        padding-top: calc(var(--sb-topbar-h) + env(safe-area-inset-top, 0px));
    }
    .sb-topbar__btn,
    .sb-theme-toggle {
        min-width: 44px;
        min-height: 44px;
    }

    /* Policy / legacy content pages */
    #ifeatures .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    .row-title {
        font-size: clamp(22px, 6vw, 32px) !important;
        margin-bottom: 20px !important;
    }
    .form_group .form-control,
    .form_group textarea {
        font-size: 16px;
        min-height: 48px;
    }
}

@media (max-width: 680px) {
    .sb-mega__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .sb-mega__chip {
        min-height: 68px;
        font-size: 10px;
    }
}

/* Safe area for drawer footer */
.sb-sidebar__footer {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
}

/* Reduce motion on marquee for mobile battery */
@media (max-width: 992px) and (prefers-reduced-motion: no-preference) {
    .sbx .marquee__track {
        animation-duration: 28s;
    }
}