/* ============================================================
   mobile.css — Mobile drawer, search overlay & app-style bottom nav
   ============================================================ */

/* ── Mobile drawer (slide menu) ── */
.mobile-drawer { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.mobile-drawer .drawer-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s var(--ease); }
.mobile-drawer.is-open { pointer-events: auto; }
.mobile-drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer-panel {
    position: absolute; top: 0; right: 0; bottom: 0; width: min(82vw, 340px);
    background: #fff; box-shadow: -10px 0 40px rgba(15,23,42,.25);
    transform: translateX(100%); transition: transform .32s var(--ease);
    display: flex; flex-direction: column; overflow-y: auto;
}
.mobile-drawer.is-open .drawer-panel { transform: none; }
.drawer-head { background: linear-gradient(135deg, var(--brand-900), var(--brand-700)); color: #fff; padding: 22px 20px; display: flex; align-items: center; gap: 12px; }
.drawer-head .nav-logo { width: 44px; height: 44px; }
.drawer-head strong { font-family: 'Kanit',sans-serif; font-size: 16px; }
.drawer-head small { display: block; opacity: .8; font-size: 12px; }
.drawer-close { margin-left: auto; width: 38px; height: 38px; border-radius: 10px; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 20px; }
.drawer-menu { padding: 12px; }
.drawer-menu a { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-radius: 12px; color: var(--ink-soft); font-weight: 500; font-size: 15.5px; }
.drawer-menu a i { font-size: 19px; color: var(--brand-500); width: 24px; }
.drawer-menu a:active, .drawer-menu a.is-active { background: var(--brand-50); color: var(--brand-700); }
.drawer-foot { margin-top: auto; padding: 18px; border-top: 1px solid var(--line); }

/* ── Search overlay (fullscreen) ── */
.search-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(255,255,255,.99); display: none; flex-direction: column; }
.search-overlay.is-open { display: flex; animation: fadeDown .25s var(--ease); }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.search-form { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.search-form button { width: 46px; height: 46px; border-radius: 12px; border: 0; background: var(--brand-50); color: var(--brand-700); font-size: 20px; flex-shrink: 0; }
.search-form button[type=submit] { background: var(--brand-600); color: #fff; }
.search-form input { flex: 1; border: 0; font-size: 19px; font-family: inherit; outline: none; background: transparent; color: var(--ink); }
.search-suggest { padding: 22px 24px; }
.search-suggest h4 { font-size: 14px; color: var(--ink-muted); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .04em; }
.search-suggest a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-size: 14.5px; margin: 0 8px 10px 0; }

/* ── App-style Bottom Nav (≤768px) ── */
.bottom-nav { display: none; }
@media (max-width: 768px) {
    .bottom-nav {
        position: fixed; bottom: 0; left: 0; right: 0; z-index: 55;
        background: rgba(255,255,255,.97); backdrop-filter: blur(20px);
        border-top: 1px solid var(--line);
        padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
        display: flex; justify-content: space-around; align-items: center;
        box-shadow: 0 -4px 24px rgba(15,23,42,.08);
    }
    body.has-bottomnav { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
    .bn-item {
        display: flex; flex-direction: column; align-items: center; gap: 3px;
        padding: 6px 10px; min-width: 56px; min-height: 44px;
        color: var(--ink-muted); font-size: 11px; font-weight: 500; position: relative;
        transition: color .2s;
    }
    .bn-item i { font-size: 21px; }
    .bn-item.is-active { color: var(--brand-700); }
    .bn-item.is-active::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 3px; background: var(--gold-500); border-radius: 0 0 4px 4px; }
    .bn-item:active { transform: scale(.92); }
    .bn-fab { margin-top: -24px; }
    .bn-fab .bn-fab-circle {
        width: 56px; height: 56px; border-radius: 50%;
        background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
        color: #422006; display: grid; place-items: center; font-size: 25px;
        box-shadow: 0 8px 20px rgba(245,158,11,.5); border: 4px solid #fff;
    }
    .fab-stack { bottom: calc(82px + env(safe-area-inset-bottom)); inset: auto 22px calc(82px + env(safe-area-inset-bottom)) auto; }
}
