/* ── WordPress 相容修正 ───────────────────────────────────── */

/* 修正 WordPress admin bar 造成頁面向下偏移 */
.admin-bar nav.navbar.home-top,
.admin-bar .w-100.home-top {
    margin-top: 32px;
}
@media screen and (max-width: 782px) {
    .admin-bar nav.navbar.home-top,
    .admin-bar .w-100.home-top {
        margin-top: 46px;
    }
}

/* ── 追蹤表單 flex 對齊 ───────────────────────────────────── */
.btn-group form.d-flex {
    width: 100%;
}
.btn-group form.d-flex input.form-control {
    border-radius: 0.25rem 0 0 0.25rem;
}
.btn-group form.d-flex button[type="submit"] {
    border-radius: 0 0.25rem 0.25rem 0;
    white-space: nowrap;
}

/* ── Navbar 選單連結 ──────────────────────────────────────── */
.menu-link {
    color: #151e49 !important;
    font-size: 16px;
}
.menu-link:hover,
.menu-link.active {
    color: #f48b11 !important;
    text-decoration: none;
}

/* ── Navbar 邊框 ──────────────────────────────────────────── */
nav.navbar.home-top {
    border-bottom: 1px solid #CCC !important;
    padding-top: 0;
    padding-bottom: 0;
}

/* ── Banner 查詢框 ────────────────────────────────────────── */
.wto-banner-search {
    max-width: 420px;
}
.wto-banner-search-label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    margin-bottom: 0.4rem;
}
.wto-banner-search .btn-group {
    width: 100%;
}

/* ── Banner 手機版優化 ────────────────────────────────────── */
@media (max-width: 576px) {
    .wto-banner {
        align-items: flex-start;
        background-position: 55% 15%;
    }
    .wto-banner-content {
        margin-top: 6% !important;
        padding-left: 6%;
    }
    .wto-banner-content::before {
        inset: -14px -22px;
    }
    .wto-banner-title { font-size: 24px !important; }
    .wto-banner-slogan { font-size: 13px; letter-spacing: 0.1em; }
}

/* ── Off-canvas Drawer ────────────────────────────────────── */
.drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1040;
}
.drawer-backdrop.show { display: block; }

.side-drawer {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background: #fff;
    z-index: 1050;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.side-drawer.open { left: 0; }

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #eee;
}
.drawer-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.drawer-close:hover { color: #151e49; }

.drawer-nav { flex: 1; padding: 4px 0; }
.drawer-link {
    display: block;
    padding: 14px 24px;
    color: #151e49;
    font-size: 16px;
    border-bottom: 1px solid #f4f4f4;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.drawer-link:hover,
.drawer-link.active {
    background: #f8f9fa;
    color: #f48b11;
    text-decoration: none;
}

.drawer-footer {
    padding: 20px;
    border-top: 1px solid #eee;
}

body.drawer-open { overflow: hidden; }
