/* ============================================================
   e-Guide Header Styles v2  —  mobile-first
   ============================================================ */

/* ---- Base header bar ---- */
.eguide-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    font-family: 'Nunito', sans-serif;
}

.eguide-header i {
    margin-right: 0px;
}

.eguide-header__bar {
    display: flex;
    align-items: center;
    height: 72px;
    padding: 0 6px 0 2px;
    background: #fff;
    box-shadow: 0 2px 12px -1px rgba(0, 0, 0, 0.16);
    position: relative;
    z-index: 1031;
}

/* ---- LEFT: back arrow + brand ---- */
.eguide-header__left {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.eguide-header__left--placeholder {
    min-width: calc(34px + 8px); /* same as brand: logo 34px + padding 8px */
}

.eguide-header__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #15467c;
    font-size: 16px;
    border-radius: 50%;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.eguide-header__back:hover,
.eguide-header__back:focus {
    background: rgba(21, 70, 124, 0.1);
    color: #15467c;
    text-decoration: none;
    outline: none;
}

.eguide-header__brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 0 4px;
}

.eguide-header__brand img {
    height: 34px;
    width: auto;
    border-radius: 6px;
}

/* ---- CENTER: action icon buttons ---- */
.eguide-header__actions {
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-width: 0;
    padding: 0 2px;
}

.eguide-header__center-spacer {
    flex: 1 1 auto;
}

.eguide-header__action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 4px 5px;
    border: none;
    background: transparent;
    color: #444;
    cursor: pointer;
    border-radius: 8px;
    gap: 3px;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.eguide-header__action-btn i {
    font-size: 17px;
    line-height: 1;
    color: #15467c;
}

.eguide-header__action-logo {
    height: 17px;
    width: auto;
    border-radius: 3px;
}

.eguide-header__action-btn span {
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
    color: #333;
    font-family: 'Nunito', sans-serif;
    letter-spacing: -0.02em;
}

.eguide-header__action-btn:hover,
.eguide-header__action-btn:focus {
    background: rgba(21, 70, 124, 0.07);
    outline: none;
}

.eguide-header__action-btn.is-active {
    background: rgba(21, 70, 124, 0.1);
}

.eguide-header__action-btn.is-active i,
.eguide-header__action-btn.is-active span {
    color: #15467c;
}

/* ---- RIGHT: hamburger — same min-width as .eguide-header__left for symmetry ---- */
.eguide-header__right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: calc(34px + 8px); /* back(36) + logo(34) + padding(8) */
}

.eguide-header__hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: #5f5f5f;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.eguide-header__hamburger:hover,
.eguide-header__hamburger:focus {
    background: rgba(0, 0, 0, 0.06);
    color: #15467c;
    outline: none;
}

.eguide-header__hamburger.is-active {
    background: rgba(21, 70, 124, 0.1);
    color: #15467c;
}

/* ---- Panels (right-side drawers) ---- */
.eguide-header__panel {
    position: fixed;
    top: 72px;
    right: 0;
    width: 280px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 0 12px;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    z-index: 1029;
    pointer-events: none;
    overflow: hidden;
}

.eguide-header__panel.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* Scrollable nav body — direct child or wrapped in panel-body */
.eguide-header__panel > .eguide-header__nav,
.eguide-header__panel-body > .eguide-header__nav {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.eguide-header__panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.eguide-header__panel > .eguide-header__nav--border-top,
.eguide-header__panel-body > .eguide-header__nav--border-top {
    flex-shrink: 0;
    margin-top: auto;
}

/* Tile icon inside nav item */
.eguide-header__nav-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Panel head stays fixed, nav scrolls */
.eguide-header__panel-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.eguide-header__panel-title {
    font-size: 14px;
    font-weight: 700;
    color: #15467c;
    display: flex;
    align-items: center;
    gap: 8px;
}

.eguide-header__panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.eguide-header__panel-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}

/* ---- Nav items (inside panels) ---- */
.eguide-header__nav {
    display: flex;
    flex-direction: column;
    padding: 6px 0;
}

.eguide-header__nav--border-top {
    border-top: 1px solid #f0f0f0;
    padding-top: 4px;
}

.eguide-header__nav-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: #1e3a5f;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    gap: 12px;
    height: 64px;
    overflow: hidden;
    background: linear-gradient(135deg, #f4f8fc 0%, #eaf1f8 100%);
    border: 1px solid rgba(21, 70, 126, 0.20);
    border-radius: 32px;
    margin: 3px;
    box-shadow: 0 1px 4px rgba(21, 70, 124, 0.07);
    transition: background 0.18s, color 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.eguide-header__nav-item.is-active {
    background: linear-gradient(135deg, #ddeeff 0%, #b4d5f0 100%);
    color: #15467e;
    box-shadow: inset 0 0 0 1px rgba(21, 70, 126, 0.25), 0 2px 6px rgba(21, 70, 124, 0.12);
    border-color: transparent;
}

.eguide-header__nav-item.is-active i {
    color: #15467e;
}

.eguide-header__nav-item i {
    width: 20px;
    text-align: center;
    color: #15467c;
    font-size: 16px;
    flex-shrink: 0;
}

.eguide-header__nav-item:hover {
    background: linear-gradient(135deg, #e2edf8 0%, #cfe0f0 100%);
    border-color: rgba(21, 70, 126, 0.40);
    box-shadow: 0 3px 10px rgba(21, 70, 124, 0.14);
    color: #15467c;
    text-decoration: none;
}

.eguide-header__nav-item--logout {
    color: #c0392b;
}

.eguide-header__nav-item--logout i {
    color: #c0392b;
}

.eguide-header__nav-item--logout:hover {
    background: rgba(192, 57, 43, 0.06);
    color: #c0392b;
}

/* ---- Sub-accordion (inside menu panel) ---- */
.eguide-header__sub {
    border-top: 1px solid #f0f0f0;
}

.eguide-header__sub-toggle {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 13px 18px;
    background: none;
    border: none;
    text-align: left;
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}

.eguide-header__sub-toggle:hover {
    background: #f5f8fc;
}

.eguide-header__sub-toggle > i:first-child {
    width: 18px;
    text-align: center;
    color: #15467c;
    flex-shrink: 0;
}

.eguide-header__sub-toggle > span {
    flex: 1;
}

.eguide-header__sub-arrow {
    flex-shrink: 0;
    color: #aaa;
    transition: transform 0.2s ease;
}

.eguide-header__sub-toggle[aria-expanded="true"] .eguide-header__sub-arrow {
    transform: rotate(180deg);
}

.eguide-header__sub-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    background: #f9fbfd;
}

.eguide-header__sub-list.is-open {
    max-height: 600px;
}

.eguide-header__nav-item--sub {
    padding-left: 50px;
    font-size: 14px;
    font-weight: 400;
}

/* Panel list items: allow natural height growth for long text.
   Fixed height: 64px makes sense only for action-bar tiles (square buttons).
   Inside a scrollable panel, items should expand to fit their content. */
.eguide-header__panel .eguide-header__nav-item {
    height: auto;
    min-height: 64px;
    overflow: visible;
    align-items: flex-start;
    padding-top: 14px;
    padding-bottom: 14px;
}

.eguide-header__lang-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}

/* Language block — flat 2×4 grid directly in hamburger panel */
.eguide-header__lang-block {
    padding: 10px 16px 14px;
    border-top: 1px solid #f0f0f0;
}

.eguide-header__lang-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 0;
    padding: 5px;
    border: none;
    background: none;
}

.eguide-header__lang-btn {
    padding: 5px 10px;
    border: 1px solid #dce3eb;
    border-radius: 6px;
    background: #f0f4f8;
    font-size: 12px;
    font-weight: 700;
    color: #15467c;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.eguide-header__lang-btn:hover {
    background: #e0e8f4;
    border-color: #15467c;
}

.eguide-header__lang-btn.is-active {
    background: #15467c;
    border-color: #15467c;
    color: #fff;
}

/* ---- Overlay ---- */
.eguide-header__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1028;
    cursor: pointer;
}

.eguide-header__overlay.is-visible {
    display: block;
}

/* ---- Body offset ---- */
body {
    padding-top: 72px;
}

/* ---- Responsive: >= 480px ---- */
@media (min-width: 480px) {
    .eguide-header__action-btn span {
        font-size: 11px;
    }

    .eguide-header__action-btn i {
        font-size: 19px;
    }

    .eguide-header__panel {
        top: 72px;
        width: 300px;
    }
}

/* ---- Responsive: >= 768px ---- */
@media (min-width: 768px) {
    .eguide-header__bar {
        padding: 0 12px 0 6px;
    }

    .eguide-header__action-btn span {
        font-size: 12px;
        letter-spacing: 0;
    }

    .eguide-header__panel {
        width: 320px;
    }
}
