/* AllHost header – allhost-header.css
   Scoped to .ah-* classes so it does not touch the rest of the site. */

.ah-skip,
.ah-announce,
.ah-header {
  --ah-navy: #0B1220;
  --ah-blue: #2563EB;
  --ah-blue-dark: #1D4ED8;
  --ah-accent: #38BDF8;
  --ah-accent-light: #7DD3FC;
  --ah-bg: #FFFFFF;
  --ah-bg-alt: #F8FAFC;
  --ah-text: #111827;
  --ah-muted: #64748B;
  --ah-green: #16A34A;
  --ah-border: #E2E8F0;
  --ah-bar-h: 64px;
  --ah-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Devanagari", sans-serif;
}

.ah-announce *,
.ah-header *,
.ah-header *::before,
.ah-header *::after { box-sizing: border-box; }

/* ---------- utilities ---------- */
.ah-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ah-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.ah-i {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.ah-i--wa { color: var(--ah-green); }

.ah-skip {
  position: fixed; left: 12px; top: -120px; z-index: 1100;
  padding: 10px 16px; border-radius: 10px;
  background: var(--ah-navy); color: #fff;
  font: 600 14px/1.2 var(--ah-font); text-decoration: none;
}
.ah-skip:focus { top: 12px; outline: 2px solid var(--ah-accent); outline-offset: 2px; }

/* ---------- announcement bar ---------- */
.ah-announce {
  background: var(--ah-navy); color: #fff;
  font-family: var(--ah-font); font-size: 13.5px; line-height: 1.45;
  text-align: center; padding: 8px 16px;
}
.ah-announce__text { margin: 0; }
.ah-announce__link {
  margin-left: 4px; color: var(--ah-accent); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; border-radius: 4px;
}
.ah-announce__link:hover { color: var(--ah-accent-light); }
.ah-announce__link:focus-visible { outline: 2px solid var(--ah-accent); outline-offset: 3px; }

/* ---------- header shell ---------- */
.ah-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--ah-bg); color: var(--ah-text);
  border-bottom: 1px solid var(--ah-border);
  font-family: var(--ah-font); font-size: 15px; line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}
.ah-header--static { position: relative; }
/* Only the shadow changes on scroll, so nothing moves (no layout shift). */
.ah-header.is-scrolled { box-shadow: 0 10px 24px -14px rgba(15, 23, 42, .22); }

.ah-header a { text-decoration: none; }
.ah-header :focus-visible { outline: 2px solid var(--ah-blue); outline-offset: 2px; }

.ah-bar {
  display: flex; align-items: stretch; gap: 8px;
  max-width: 1240px; margin: 0 auto; padding: 0 16px;
  height: var(--ah-bar-h);
}

/* ---------- logo ---------- */
.ah-logo {
  display: flex; align-items: center; min-width: 0; flex: 0 1 auto;
  color: var(--ah-navy); border-radius: 8px;
}
.ah-logo__img { display: block; width: auto; height: auto; max-width: 100%; max-height: 36px; }
.ah-logo__mark {
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--ah-blue); color: #fff;
}
.ah-logo__word {
  margin-left: 10px; font-size: 22px; line-height: 1;
  font-weight: 800; letter-spacing: -.02em; color: var(--ah-navy);
}
.ah-logo__word span { font-weight: 500; }

/* ---------- buttons ---------- */
.ah-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px;
  font: 600 14.5px/1 var(--ah-font); white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.ah-btn--primary { background: var(--ah-blue); color: #fff; }
.ah-btn--primary:hover { background: var(--ah-blue-dark); }
.ah-btn--accent { background: var(--ah-accent); color: var(--ah-navy); }
.ah-btn--accent:hover { background: var(--ah-accent-light); }
.ah-btn--ghost { background: var(--ah-bg); border-color: var(--ah-border); color: var(--ah-text); }
.ah-btn--ghost:hover { background: var(--ah-bg-alt); }
.ah-btn--onnavy { border-color: rgba(255, 255, 255, .28); color: #fff; }
.ah-btn--onnavy:hover { background: rgba(255, 255, 255, .08); }
.ah-btn--block { width: 100%; height: 48px; }

.ah-iconbtn {
  position: relative; display: inline-grid; place-items: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px;
  background: none; color: var(--ah-text); cursor: pointer;
  transition: background-color .15s;
}
.ah-iconbtn:hover { background: var(--ah-bg-alt); }
.ah-cart__count {
  position: absolute; top: 4px; right: 1px;
  display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--ah-blue); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
}

.ah-login {
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 12px; border-radius: 10px;
  color: var(--ah-text); font-weight: 600; white-space: nowrap;
  transition: background-color .15s;
}
.ah-login:hover { background: var(--ah-bg-alt); }

.ah-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.ah-toggle .ah-toggle__close { display: none; }
.ah-toggle[aria-expanded="true"] .ah-toggle__open { display: none; }
.ah-toggle[aria-expanded="true"] .ah-toggle__close { display: block; }

/* ---------- menu items (shared) ---------- */
.ah-menu { display: flex; margin: 0; padding: 0; list-style: none; }
.ah-menu__item { display: flex; }   /* stays static so .ah-mega positions against the header */

.ah-menu__btn,
.ah-menu__link {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  margin: 0; border: 0; border-radius: 0; background: none;
  color: var(--ah-text); font: 600 15px/1.2 var(--ah-font); cursor: pointer;
}
.ah-menu__btn:focus-visible,
.ah-menu__link:focus-visible { outline-offset: -4px; border-radius: 10px; }
.ah-menu__link.is-disabled { cursor: default; color: var(--ah-muted); }

.ah-chev { width: 16px; height: 16px; color: var(--ah-muted); transition: transform .2s; }
.is-open > .ah-menu__btn .ah-chev { transform: rotate(180deg); }

.ah-badge {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px;
  background: #F1F5F9; color: #475569;
  font-size: 12px; font-weight: 600; line-height: 1.3; vertical-align: 1px;
}

/* ---------- mega panel content (shared) ---------- */
.ah-mega__heading { margin: 0 0 8px 12px; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--ah-muted); }
.ah-mega__list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }

.ah-item {
  display: flex; align-items: flex-start; gap: 14px; padding: 12px; border-radius: 10px;
  color: var(--ah-text); transition: background-color .15s;
}
a.ah-item:hover { background: var(--ah-bg-alt); }
a.ah-item:focus-visible { outline-offset: 0; background: var(--ah-bg-alt); }
.ah-item__icon {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px;
  background: #EFF6FF; color: var(--ah-blue); transition: background-color .15s, color .15s;
}
a.ah-item:hover .ah-item__icon,
a.ah-item:focus-visible .ah-item__icon { background: var(--ah-blue); color: #fff; }
.ah-item__title { display: block; font-weight: 600; line-height: 1.3; }
.ah-item__desc { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.45; color: var(--ah-muted); }
a.ah-item[aria-current="page"] .ah-item__title { color: var(--ah-blue); }
.ah-item.is-disabled { cursor: default; }
.ah-item.is-disabled .ah-item__icon { background: #F1F5F9; color: #94A3B8; }
.ah-item.is-disabled .ah-item__title { color: #475569; }

/* Navy aside: the one deliberate contrast moment in the menu */
.ah-aside {
  position: relative; overflow: hidden; align-self: start;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 22px; border-radius: 14px; background: var(--ah-navy); color: #fff;
}
.ah-aside::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(56, 189, 248, .26) 1px, transparent 1.6px) 0 0 / 16px 16px;
  -webkit-mask-image: linear-gradient(145deg, transparent 45%, #000);
          mask-image: linear-gradient(145deg, transparent 45%, #000);
}
.ah-aside > * { position: relative; }
.ah-aside :focus-visible { outline-color: var(--ah-accent); }
.ah-aside__title { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.ah-aside__text { margin: 0; font-size: 14px; line-height: 1.5; color: #CBD5E1; }
.ah-aside__link { color: var(--ah-accent); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; border-radius: 4px; }
.ah-aside__link:hover { color: var(--ah-accent-light); }

.ah-domain { display: flex; gap: 8px; width: 100%; }
.ah-domain__input {
  flex: 1 1 auto; min-width: 0; height: 42px; padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 10px;
  background: rgba(255, 255, 255, .06); color: #fff; font: 15px var(--ah-font);
}
.ah-domain__input::placeholder { color: #94A3B8; }
.ah-domain__input:focus { border-color: var(--ah-accent); }
.ah-domain__input:focus-visible { outline: 2px solid var(--ah-accent); outline-offset: 1px; }

.ah-backdrop, .ah-drawer-foot { display: none; }

/* ======================= DESKTOP (≥1024px) ======================= */
@media (min-width: 1024px) {
  .ah-header { --ah-bar-h: 72px; }

  .ah-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: stretch; gap: 8px; padding: 0 16px; }
  .ah-logo__img { max-height: 36px; max-width: 140px; }
  .ah-logo__word { font-size: 20px; margin-left: 8px; }
  .ah-nav { justify-self: center; display: flex; min-width: 0; }
  .ah-menu { align-items: stretch; height: 100%; white-space: nowrap; }

  .ah-actions { align-self: center; gap: 0; margin-left: 0; }
  .ah-cart { width: 40px; }
  .ah-login { padding: 0 8px; }
  .ah-login .ah-i { display: none; }          /* icon returns once there is room */
  .ah-toggle { display: none; }
  .ah-login__long { display: none; }          /* compact "Login" until there is room */
  .ah-cta { margin-left: 6px; padding: 0 14px; }

  .ah-menu__btn,
  .ah-menu__link { padding: 0 7px; font-size: 14px; gap: 3px; }
  .ah-chev { width: 14px; height: 14px; }
  .ah-menu__btn::after,
  .ah-menu__link::after {
    content: ""; position: absolute; left: 7px; right: 7px; bottom: -1px; height: 2px;
    background: var(--ah-blue); transform: scaleX(0); transform-origin: left; transition: transform .2s;
  }
  .is-open > .ah-menu__btn::after,
  .is-current > .ah-menu__btn::after,
  .ah-menu__link.is-current::after { transform: scaleX(1); }
  .is-open > .ah-menu__btn { color: var(--ah-blue); }

  .ah-mega {
    white-space: normal;
    position: absolute; left: 0; right: 0; top: 100%;
    max-height: calc(100vh - var(--ah-bar-h) - 24px); overflow-y: auto;
    background: var(--ah-bg); border-top: 1px solid var(--ah-border); border-bottom: 1px solid var(--ah-border);
    box-shadow: 0 28px 48px -24px rgba(15, 23, 42, .3);
    visibility: hidden; opacity: 0; transform: translateY(-6px); pointer-events: none;
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
  }
  .is-open > .ah-mega {
    visibility: visible; opacity: 1; transform: none; pointer-events: auto;
    transition-delay: 0s;
  }
  /* Without JS, fall back to hover / keyboard focus. */
  .ah-nojs .ah-menu__item--mega:hover > .ah-mega,
  .ah-nojs .ah-menu__item--mega:focus-within > .ah-mega {
    visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition-delay: 0s;
  }

  .ah-mega__inner {
    display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px;
    max-width: 1240px; margin: 0 auto; padding: 24px 20px 28px;
  }
  .ah-mega__inner--solo { grid-template-columns: minmax(0, 1fr); }
  .ah-mega__sections { display: grid; grid-template-columns: repeat(var(--ah-sections, 1), minmax(0, 1fr)); gap: 28px; }
  .ah-mega__list { grid-template-columns: repeat(var(--ah-cols, 1), minmax(0, 1fr)); }
}

@media (min-width: 1360px) {
  .ah-bar { gap: 20px; padding: 0 24px; }
  .ah-logo__img { max-height: 38px; max-width: none; }
  .ah-logo__word { font-size: 22px; margin-left: 10px; }
  .ah-menu__btn,
  .ah-menu__link { padding: 0 13px; font-size: 15px; gap: 6px; }
  .ah-chev { width: 15px; height: 15px; }
  .ah-menu__btn::after,
  .ah-menu__link::after { left: 13px; right: 13px; }
  .ah-actions { gap: 2px; }
  .ah-cart { width: 44px; }
  .ah-login { padding: 0 12px; }
  .ah-login .ah-i { display: block; }
  .ah-login__long { display: inline; }
  .ah-cta { margin-left: 8px; padding: 0 16px; }
  .ah-mega__inner { grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; padding: 28px 24px 32px; }
}

/* ======================= MOBILE / TABLET (<1024px) ======================= */
@media (max-width: 1023.98px) {
  .ah-cta { display: none; }                  /* the CTA lives in the drawer */
  .ah-login__long { display: none; }          /* "Login" instead of "Client Login" */

  .ah-nav {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 2;
    display: block; padding: 4px 16px 20px;
    max-height: var(--ah-drawer-max, calc(100vh - var(--ah-bar-h)));
    overflow-y: auto; overscroll-behavior: contain;
    background: var(--ah-bg); border-bottom: 1px solid var(--ah-border);
    box-shadow: 0 24px 40px -24px rgba(15, 23, 42, .35);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  }
  .is-drawer-open .ah-nav { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }

  .ah-backdrop {
    display: block; position: absolute; left: 0; right: 0; top: 100%; z-index: 1; height: 100vh;
    background: rgba(11, 18, 32, .5); opacity: 0; visibility: hidden;
    transition: opacity .18s ease, visibility 0s linear .18s;
  }
  .is-drawer-open .ah-backdrop { opacity: 1; visibility: visible; transition-delay: 0s; }

  .ah-menu { flex-direction: column; }
  .ah-menu__item { display: block; border-bottom: 1px solid var(--ah-border); }
  .ah-menu__btn,
  .ah-menu__link {
    width: 100%; min-height: 54px; padding: 0 4px; justify-content: space-between; font-size: 16px;
  }
  .ah-menu__btn:focus-visible,
  .ah-menu__link:focus-visible { outline-offset: -2px; }
  .ah-menu__item.is-current > .ah-menu__btn,
  .ah-menu__link.is-current { color: var(--ah-blue); }
  .is-open > .ah-menu__btn { color: var(--ah-blue); }

  .ah-mega { display: none; padding: 0 0 12px; }
  .is-open > .ah-mega { display: block; }
  .ah-mega__inner { display: block; }
  .ah-mega__section + .ah-mega__section { margin-top: 12px; }
  .ah-mega__heading { margin-left: 4px; }
  .ah-item { padding: 10px 4px; gap: 12px; }
  a.ah-item:hover { background: none; }
  .ah-item__icon { width: 36px; height: 36px; }
  .ah-aside { display: none; }

  .ah-drawer-foot { display: grid; gap: 10px; padding-top: 18px; }
  .ah-drawer-foot__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .ah-drawer-foot__row .ah-btn { height: 46px; }

  html.ah-lock { overflow: hidden; }
}

/* Very small phones: keep Logo | Cart | Login | Menu on one row without overlap. */
@media (max-width: 359.98px) {
  .ah-bar { padding: 0 12px; gap: 6px; }
  .ah-actions { gap: 0; }
  .ah-login { width: 44px; padding: 0; justify-content: center; }
  .ah-login__label {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ah-header *, .ah-header *::before, .ah-header *::after {
    transition-duration: .01ms !important; transition-delay: 0s !important; animation: none !important;
  }
}
