/* ── Site header , "1A refined single row" (Claude Design: Topbar Navbar Redesign)
   Markup: components/header.blade.php, components/menu*.blade.php,
           components/banner-component.blade.php.
   One accent (brand indigo), 40px targets, logical properties so Arabic mirrors.
   Phones (< 992px) keep logo + search + bell + Menu; the drawer is unchanged. */

.mgh, .mgh-bar {
    --mgh-ink: #17162a;
    --mgh-body: #3a3852;
    --mgh-muted: #8b89a6;
    --mgh-accent: #4f46e5;
    --mgh-accent-ink: #3730a3;
    --mgh-accent-bg: #f1f0ff;
    --mgh-hover: #f4f4f8;
    --mgh-line: #ecebf3;
    --mgh-field: #f8f8fb;
    --mgh-field-line: #e4e3ee;
    --mgh-bar: #1e1b4b;
}
.mgh [x-cloak] { display: none !important; }

/* ── Announcement bar ── */
.mgh-bar {
    position: relative; display: flex; align-items: center; justify-content: center;
    min-height: 40px; padding-block: 6px; padding-inline: 48px;
    background: var(--mgh-bar-bg, var(--mgh-bar)); color: #f4f3ff; font-size: 14px; line-height: 1.4;
}
/* Admin picked light colours: dark text, so it stays readable. */
.mgh-bar.is-light { color: var(--mgh-ink); }
.mgh-bar.is-light :is(.mgh-bar__text :is(b, strong, a), .mgh-bar__link, .mgh-bar__link:hover) { color: var(--mgh-ink); }
.mgh-bar.is-light .mgh-bar__pill { background: var(--mgh-ink); }
.mgh-bar.is-light .mgh-bar__close { color: var(--mgh-body); }
.mgh-bar.is-light .mgh-bar__close:hover { background: rgba(0, 0, 0, .08); color: var(--mgh-ink); }
.mgh-bar.is-light :is(a, button):focus-visible { outline-color: var(--mgh-ink); }
.mgh-bar__inner { display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 0; max-width: 1200px; }
.mgh-bar__pill {
    flex: none; padding: 2px 8px; border-radius: 999px;
    background: rgba(0, 0, 0, .28); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.4;
}
.mgh-bar__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgh-bar__text :is(b, strong) { color: #fff; }
.mgh-bar__text a { color: #fff; text-decoration: underline; }
.mgh-bar__text p { display: inline; margin: 0; }
.mgh-bar__link {
    flex: none; display: inline-flex; align-items: center; gap: 4px;
    color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap;
}
.mgh-bar__link i { font-size: 13px; line-height: 1; }
.mgh-bar__link:hover { color: #fff; text-decoration-thickness: 2px; }
.mgh-bar__close {
    position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
    border: 0; border-radius: 8px; background: transparent; color: inherit; opacity: .8; font-size: 16px; line-height: 1; cursor: pointer;
}
.mgh-bar__close:hover { background: rgba(255, 255, 255, .14); color: #fff; opacity: 1; }
.mgh-bar :is(a, button):focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ── Header row ── */
.header.mgh { position: relative; z-index: 99; padding: 0; background: #fff; border-bottom: 1px solid var(--mgh-line); }
.header.mgh.fixed-header { background: rgba(255, 255, 255, .92); }
.mgh .mgh-row { display: flex; align-items: center; gap: 24px; height: 68px; }
.mgh .mgh-logo { flex: none; display: flex; align-items: center; }
.mgh .mgh-logo img { display: block; height: 30px; width: auto; max-width: 200px; }
.mgh-desktop { flex: none; display: flex; align-items: center; gap: 4px; height: 100%; }
.mgh-caret { font-size: 11px; line-height: 1; color: var(--mgh-muted); transition: transform .15s ease; }

/* Categories: the 2×2 mark + label opens the mega-menu. */
.mgh-cats {
    flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
    border: 0; border-radius: 8px; background: transparent;
    font-size: 15px; font-weight: 500; color: var(--mgh-ink); line-height: 1; white-space: nowrap; cursor: pointer;
}
.mgh-cats:hover, .mgh-cats.is-open { background: #eef0ff; }
.mgh-cats.is-open .mgh-caret { transform: rotate(180deg); }
.mgh-cats__icon { display: grid; grid-template-columns: 6px 6px; gap: 2px; }
.mgh-cats__icon i { width: 6px; height: 6px; border-radius: 1.5px; background: var(--mgh-accent); }
.mgh-cats__icon i:last-child { background: #a5b4fc; }
.mgh-divider { flex: none; width: 1px; height: 20px; margin: 0 6px; background: var(--mgh-field-line); }

/* Nav: the current page gets a 2px underline at the bottom edge of the row. */
.mgh-nav { display: flex; align-items: center; gap: 2px; height: 100%; margin: 0; padding: 0; list-style: none; }
.mgh-nav > li { position: relative; display: flex; align-items: center; height: 100%; }
.mgh-nav__link {
    position: relative; display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 10px;
    border: 0; border-radius: 8px; background: transparent;
    font-size: 15px; font-weight: 500; color: var(--mgh-body); line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer;
}
.mgh-nav__link:hover { background: var(--mgh-hover); color: var(--mgh-ink); }
.mgh-nav__link.is-active { color: var(--mgh-ink); font-weight: 600; }
.mgh-nav__link.is-active::after {
    content: ""; position: absolute; inset-inline: 10px; bottom: -14px; height: 2px; border-radius: 2px; background: var(--mgh-accent);
}
.mgh-nav__menu [aria-expanded="true"] .mgh-caret { transform: rotate(180deg); }
.mgh-nav__panel {
    position: absolute; top: calc(100% - 8px); inset-inline-start: 0; z-index: 30;
    min-width: 220px; margin: 0; padding: 6px; list-style: none;
    background: #fff; border: 1px solid var(--mgh-line); border-radius: 12px;
    box-shadow: 0 1px 2px rgba(20, 20, 40, .06), 0 12px 32px rgba(20, 20, 40, .12);
}
.mgh-nav__item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; color: var(--mgh-ink); text-decoration: none; }
.mgh-nav__item:hover { background: var(--mgh-hover); color: var(--mgh-ink); }
.mgh-nav__item-title { font-size: 14.5px; font-weight: 500; line-height: 1.35; }
.mgh-nav__item-hint { font-size: 13px; color: var(--mgh-muted); line-height: 1.4; }

/* ── Actions ── */
/* The search box is the row's give: it shrinks (label truncating) before anything overlaps. */
.mgh .mgh-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex: 0 1 auto; min-width: 0; justify-content: flex-end; }
.mgh .mgh-actions > :not(.mgh-search) { flex: none; }
.mgh-search {
    display: inline-flex; align-items: center; gap: 8px; flex: 0 1 240px; min-width: 120px; height: 40px; padding: 0 12px;
    border: 1px solid var(--mgh-field-line); border-radius: 10px; background: var(--mgh-field);
    color: var(--mgh-muted); font-size: 14px; line-height: 1; text-align: start; cursor: pointer;
}
.mgh-search:hover { border-color: #cfcde0; background: #fff; }
.mgh-search > i { font-size: 16px; line-height: 1; }
.mgh-search__text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgh-search__kbd {
    flex: none; padding: 3px 6px; border: 1px solid #dcdbe7; border-radius: 5px; background: #fff;
    font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--mgh-muted); direction: ltr;
}
.mgh-points {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px;
    background: var(--mgh-accent-bg); color: var(--mgh-accent-ink); font-size: 14px; font-weight: 600; line-height: 1;
    white-space: nowrap; text-decoration: none;
}
.mgh-points:hover { background: #e6e4ff; color: var(--mgh-accent-ink); }
.mgh-points img { width: 18px; height: 18px; }
.mgh-points__value { direction: ltr; font-variant-numeric: tabular-nums; }
.mgh-points__label { font-size: 13px; font-weight: 500; color: #6366f1; }

/* The bell keeps its panel; only its trigger takes the row's shape. */
.mgh .notif-bell__trigger {
    width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--mgh-body); font-size: 20px;
}
.mgh .notif-bell__trigger:hover { background: var(--mgh-hover); }
/* "9+" , not "+9": the count reads left-to-right on Arabic pages too. */
.mgh .notif-bell__badge { direction: ltr; unicode-bidi: isolate; }

.mgh-account__trigger {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding-block: 0; padding-inline: 4px 8px;
    border: 0; border-radius: 999px; background: transparent; cursor: pointer;
}
.mgh-account__trigger:hover, .mgh-account__trigger[aria-expanded="true"] { background: var(--mgh-hover); }
.mgh-avatar {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; overflow: hidden;
    border-radius: 50%; background: var(--mgh-accent); color: #fff; font-size: 13px; font-weight: 600; line-height: 1;
}
.mgh-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mgh-signin {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px;
    background: var(--mgh-accent); color: #fff; font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none;
}
.mgh-signin:hover { background: var(--mgh-accent-ink); color: #fff; }
.mgh-signin i { font-size: 16px; line-height: 1; }
.mgh-burger {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    border: 0; border-radius: 10px; background: transparent; color: var(--mgh-ink); font-size: 24px; line-height: 1;
}
.mgh-burger:hover { background: var(--mgh-hover); }
.mgh :is(.mgh-cats, .mgh-nav__link, .mgh-nav__item, .mgh-search, .mgh-points, .notif-bell__trigger, .mgh-account__trigger, .mgh-signin, .mgh-burger, .mgh-logo):focus-visible {
    outline: 2px solid var(--mgh-accent); outline-offset: 2px;
}

/* ── Account menu (Bootstrap dropdown, positioned here: data-bs-display="static") ── */
.mgh-account { position: relative; }
/* While a menu is open the header rises above the floating language bubble
   (z 1040) so nothing sits on top of it; toasts (9999) still win. */
.header.mgh:has(.mgh-cats[aria-expanded="true"], .mgh-nav__menu [aria-expanded="true"], .mgh-account__trigger[aria-expanded="true"]) { z-index: 1050; }
.mgh .mgh-menu {
    position: absolute; top: calc(100% + 10px); inset-inline-end: 0; inset-inline-start: auto; z-index: 60;
    width: 300px; margin: 0; padding: 8px;
    background: #fff; border: 1px solid var(--mgh-line); border-radius: 14px;
    box-shadow: 0 1px 2px rgba(20, 20, 40, .06), 0 16px 40px rgba(20, 20, 40, .14);
    transform: none;
}
.mgh .mgh-menu:not(.show) { display: none; }
.mgh .mgh-menu.show { display: flex; flex-direction: column; gap: 4px; }
.mgh-menu__me {
    display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px;
    color: var(--mgh-ink); text-decoration: none;
}
.mgh-menu__me:hover { background: var(--mgh-hover); color: var(--mgh-ink); }
.mgh-avatar--lg { flex: none; width: 44px; height: 44px; font-size: 16px; }
.mgh-menu__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.mgh-menu__name { font-size: 15px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgh-menu__role { font-size: 13px; line-height: 1.3; color: var(--mgh-muted); }
.mgh-menu__go { flex: none; font-size: 14px; line-height: 1; color: var(--mgh-muted); }
.mgh-menu__switch {
    display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 12px;
    border-radius: 10px; background: var(--mgh-accent-bg); color: var(--mgh-accent-ink);
    font-size: 14px; font-weight: 600; line-height: 1.2; text-decoration: none;
}
.mgh-menu__switch i { font-size: 16px; line-height: 1; }
.mgh-menu__switch:hover { background: #e6e4ff; color: var(--mgh-accent-ink); }
.mgh-menu__group { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; margin-top: 2px; border-top: 1px solid var(--mgh-line); }
.mgh .mgh-menu__item {
    display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 10px; border-radius: 8px;
    font-size: 14.5px; font-weight: 500; line-height: 1.3; color: var(--mgh-body); text-decoration: none; white-space: normal;
}
.mgh .mgh-menu__item:hover { background: var(--mgh-hover); color: var(--mgh-ink); }
.mgh .mgh-menu__item.is-danger { color: #c4373c; }
.mgh .mgh-menu__item.is-danger:hover { background: #fdecec; color: #a82d31; }
.mgh-menu__icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; font-size: 18px; line-height: 1; }
.mgh-menu__icon i { line-height: 1; }
.mgh-menu .lang-switcher-row { gap: 4px; }
.mgh-menu .lang-menu-help-btn { width: 32px; height: 32px; }
.mgh-menu :is(a, button):focus-visible { outline: 2px solid var(--mgh-accent); outline-offset: -2px; }

/* ── Categories mega-menu ── */
.mgh-mega {
    position: absolute; top: 100%; inset-inline: 0; z-index: 40;
    background: #fcfcfe; border-bottom: 1px solid var(--mgh-line); box-shadow: 0 16px 32px rgba(20, 20, 40, .08);
}
.mgh-mega__grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; padding-block: 24px 28px; }
.mgh-mega__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; }
.mgh-mega__col { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.mgh-mega__col-title { font-size: 13px; font-weight: 600; color: var(--mgh-muted); text-decoration: none; line-height: 1.3; }
.mgh-mega__col-title:hover { color: var(--mgh-accent); }
.mgh-mega__link {
    max-width: 100%; font-size: 15px; line-height: 1.4; color: var(--mgh-ink); text-decoration: none;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mgh-mega__link:hover { color: var(--mgh-accent); }
.mgh-mega__more { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--mgh-accent); text-decoration: none; }
.mgh-mega__more i { line-height: 1; font-size: 12px; }
.mgh-mega__more:hover { color: var(--mgh-accent-ink); }
.mgh-mega__feature {
    position: relative; display: flex; align-items: flex-end; min-height: 140px; overflow: hidden;
    border-radius: 12px; background: var(--mgh-bar); color: #fff; text-decoration: none;
}
.mgh-mega__feature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mgh-mega__feature-body {
    position: relative; display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 16px;
    background: linear-gradient(to top, rgba(15, 12, 40, .85), rgba(15, 12, 40, 0));
}
.mgh-mega__feature-kicker { font-size: 12px; font-weight: 600; color: #c3c6dd; }
.mgh-mega__feature-title { font-size: 15px; font-weight: 600; line-height: 1.35; color: #fff; }
.mgh-mega__feature:hover { color: #fff; }
.mgh-mega__feature:hover img { transform: scale(1.03); }
.mgh-mega__feature img { transition: transform .3s ease; }
.mgh-mega :is(a):focus-visible { outline: 2px solid var(--mgh-accent); outline-offset: 2px; }

/* ── Narrower desktops: the nav keeps one row by shedding extras first ── */
@media (max-width: 1399.98px) {
    .mgh-search { flex-basis: 200px; }
    .mgh-points__label { display: none; }
}
@media (max-width: 1279.98px) {
    .mgh .mgh-row { gap: 16px; }
    .mgh-search { flex: none; width: 40px; min-width: 0; padding: 0; justify-content: center; }
    .mgh-search__text, .mgh-search__kbd { display: none; }
    .mgh-nav__link { padding: 0 8px; font-size: 14.5px; }
    .mgh-cats { padding: 0 8px; }
    .mgh-divider { display: none; }
}
@media (max-width: 1099.98px) {
    .mgh-cats { font-size: 0; gap: 4px; }
    .mgh-cats .mgh-caret { font-size: 11px; }
    .mgh-points { padding: 0 10px; }
}

/* ── Phones and tablets: logo, search, bell, Menu ── */
@media (max-width: 991.98px) {
    .mgh .mgh-row { height: 60px; gap: 12px; }
    .mgh-desktop, .mgh-mega, .mgh-points, .mgh-account { display: none !important; }
    .mgh .mgh-actions { gap: 4px; }
    .mgh-search { flex: none; min-width: 0; width: 44px; height: 44px; padding: 0; justify-content: center; border: 0; background: transparent; color: var(--mgh-ink); }
    .mgh-search > i { font-size: 20px; }
    .mgh-search__text, .mgh-search__kbd { display: none; }
    .mgh .notif-bell__trigger { width: 44px; height: 44px; }
    .mgh .mgh-logo img { height: 26px; }
    .mgh-signin { height: 40px; padding: 0 12px; font-size: 13px; }
    .mgh-bar { padding-inline: 12px 44px; font-size: 13px; }
    .mgh-bar__inner { justify-content: flex-start; gap: 8px; }
    .mgh-bar__text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
@media (max-width: 575.98px) {
    .mgh-bar__pill { display: none; }
    .mgh-signin i { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .mgh-caret { transition: none; }
}
