/* ============================================================================
   Unified site header, al-hokail.com
   ----------------------------------------------------------------------------
   Every selector is prefixed .sh so nothing here can collide with a page's own
   styles. Crucially the header carries its OWN language classes, .sh-en and
   .sh-ar, rather than reusing .lang-en / .lang-ar: those are defined
   differently per page (display:block on some, display:inline on others) and
   an element-qualified display rule on them silently leaks the hidden language
   into the visible page. .sh-* is untouched by any page rule.

   Language switching keys off `body.ar`, which every page's applyLang() sets,
   so the header needs no per-page JavaScript to translate itself.
============================================================================ */

.sh {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(248, 246, 242, 0.94);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line, #e2ddd6);
}

.sh-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  height: 64px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* ---------- language visibility ---------- */
.sh-ar { display: none; font-family: 'Noto Kufi Arabic', sans-serif; }
body.ar .sh-en { display: none; }
body.ar .sh-ar { display: inline; }

/* ---------- logo ---------- */
.sh-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--ink, #0e0e0e);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
body.ar .sh-logo { font-size: 1rem; }

/* ---------- link row ---------- */
.sh-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin-inline-start: 1.5rem;
}

.sh-item {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted, #9a9a9a);
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s;
}
.sh-item:hover { color: var(--ink, #0e0e0e); }
body.ar .sh-item {
  font-family: 'Noto Kufi Arabic', sans-serif;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.86rem;
}

/* ---------- services dropdown ---------- */
.sh-group { position: relative; }

.sh-toggle { display: inline-flex; align-items: center; gap: 0.35rem; }
.sh-toggle::after {
  content: '';
  width: 0; height: 0;
  border-inline-start: 3.5px solid transparent;
  border-inline-end: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform 0.2s;
}
.sh-group:hover .sh-toggle::after,
.sh-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }

.sh-menu {
  position: absolute;
  top: calc(100% + 0.6rem);
  inset-inline-start: -0.75rem;
  min-width: 270px;
  background: #fff;
  border: 1px solid var(--line, #e2ddd6);
  border-radius: var(--radius, 2px);
  box-shadow: 0 8px 28px rgba(14, 14, 14, 0.08);
  padding: 0.4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.16s, transform 0.16s, visibility 0.16s;
}
.sh-group:hover .sh-menu,
.sh-menu.sh-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sh-menu a {
  display: block;
  padding: 0.7rem 0.85rem;
  text-decoration: none;
  border-radius: var(--radius, 2px);
  transition: background 0.15s;
}
.sh-menu a:hover { background: var(--accent-light, #f5f0e8); }
.sh-menu strong {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink, #0e0e0e);
}
.sh-menu em {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-style: normal;
  font-size: 0.78rem;
  color: var(--ink-muted, #9a9a9a);
  margin-top: 0.15rem;
  line-height: 1.5;
}
body.ar .sh-menu strong,
body.ar .sh-menu em { font-family: 'Noto Kufi Arabic', sans-serif; }

/* ---------- actions ---------- */
.sh-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-inline-start: auto;
  flex-shrink: 0;
}

.sh-cta {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent, #b8860b);
  text-decoration: none;
  border: 1px solid var(--accent, #b8860b);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius, 2px);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.sh-cta:hover { background: var(--accent, #b8860b); color: var(--paper, #f8f6f2); }
body.ar .sh-cta {
  font-family: 'Noto Kufi Arabic', sans-serif;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.84rem;
}

.sh-lang {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted, #9a9a9a);
  background: none;
  border: 1px solid var(--line, #e2ddd6);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius, 2px);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.sh-lang:hover { color: var(--ink, #0e0e0e); border-color: var(--ink-muted, #9a9a9a); }

/* ---------- hamburger ---------- */
.sh-burger {
  display: none;
  width: 34px; height: 34px;
  background: none;
  border: 1px solid var(--line, #e2ddd6);
  border-radius: var(--radius, 2px);
  cursor: pointer;
  padding: 0;
  position: relative;
  flex-shrink: 0;
}
.sh-burger span {
  position: absolute;
  inset-inline: 8px;
  height: 1px;
  background: var(--ink, #0e0e0e);
  transition: transform 0.2s, opacity 0.2s;
}
.sh-burger span:nth-child(1) { top: 12px; }
.sh-burger span:nth-child(2) { top: 16.5px; }
.sh-burger span:nth-child(3) { top: 21px; }
.sh[data-open="true"] .sh-burger span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.sh[data-open="true"] .sh-burger span:nth-child(2) { opacity: 0; }
.sh[data-open="true"] .sh-burger span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

/* anything scrolled to needs to clear the 64px bar. Pages that set their own
   (section[id], .offer[id]) are more specific and keep their value. */
[id] { scroll-margin-top: 5rem; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .sh-burger { display: block; }
  .sh-inner { gap: 0.75rem; }

  .sh-nav {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    margin-inline-start: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper, #f8f6f2);
    border-bottom: 1px solid var(--line, #e2ddd6);
    padding: 0.5rem clamp(1.25rem, 4vw, 3rem) 1rem;
    display: none;
  }
  .sh[data-open="true"] .sh-nav { display: flex; }

  .sh-nav > .sh-item,
  .sh-group > .sh-toggle {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line, #e2ddd6);
    width: 100%;
    text-align: start;
  }
  .sh-nav > .sh-item:last-child { border-bottom: none; }

  /* the submenu is always open inside the panel, no nested collapse */
  .sh-group { position: static; }
  .sh-toggle { display: none; }
  .sh-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    min-width: 0;
    border: none;
    box-shadow: none;
    background: none;
    padding: 0;
  }
  .sh-menu a { padding: 0.85rem 0; border-bottom: 1px solid var(--line, #e2ddd6); border-radius: 0; }
  .sh-menu a:hover { background: none; }

  .sh-cta { font-size: 0.68rem; padding: 0.4rem 0.7rem; }
  body.ar .sh-cta { font-size: 0.8rem; }
}

@media (max-width: 400px) {
  .sh-logo { font-size: 1.05rem; }
  body.ar .sh-logo { font-size: 0.92rem; }
  .sh-actions { gap: 0.5rem; }
}
