/* Header — modern, glass-on-scroll, segmented flag switch.
 *
 * Zones (logical order):
 *   ─ brand (Q-mark + wordmark)
 *   ─ nav (six links inside a soft glass pill)
 *   ─ actions (segmented flag switch + cyan Owner pill)
 *
 * The nav links now sit inside a translucent "pill capsule" so
 * the whole row has structure instead of feeling like loose
 * text. On scroll the header gains a frosted backdrop and the
 * capsule's separator deepens.
 */

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: var(--z-header);
  padding-block: 16px;
  transition: background var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out),
              backdrop-filter var(--t-base) var(--ease-out),
              padding var(--t-base) var(--ease-out);
}
.site-header.is-scrolled {
  background: rgba(13, 16, 20, 0.78);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-block-end: 1px solid var(--line);
  padding-block: 10px;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-1);
}
.brand__mark {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(19, 181, 243, 0.35));
  transition: transform var(--t-base) var(--ease-out);
}
.brand:hover .brand__mark { transform: scale(1.05); }
.brand__word {
  font-family: var(--font-en);
  font-weight: 900;
  letter-spacing: 0.18em;
  font-size: 1.02rem;
  color: var(--text-1);
}

/* The nav capsule — a soft glass pill that holds the 6 links.
 * Gives the row a clear, contained shape so it doesn't read as
 * loose text. */
.nav-primary {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-inline-start: auto;
  padding: 5px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.site-header.is-scrolled .nav-primary {
  background: rgba(255, 255, 255, 0.04);
}
.nav-primary__link {
  position: relative;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-2);
  border-radius: var(--r-pill);
  transition: color var(--t-base) var(--ease-out),
              background var(--t-base) var(--ease-out);
}
.nav-primary__link:hover { color: var(--text-1); background: rgba(255, 255, 255, 0.04); }
.nav-primary__link.is-active { color: var(--text-1); background: var(--surface-2); }

/* Privacy + Delete sit under a softer treatment — same capsule,
 * smaller text weight, with a subtle leading separator. */
.nav-primary__sep {
  width: 1px;
  height: 18px;
  background: var(--line-2);
  margin-inline: 4px;
}
.nav-primary__link--legal {
  font-size: 0.82rem;
  color: var(--text-3);
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* ─── Segmented flag switch ─────────────────────────────── */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: border-color var(--t-base) var(--ease-out);
}
.lang-switch:hover { border-color: var(--line-strong); }

/* Language flag chip — passport-style miniature with a thin
 * white inner frame so the saturated flag colours don't bleed
 * into the dark page background. Inactive state stays
 * recognisable (55 % opacity, not muted to grey); active state
 * pops with a brighter cyan ring + small lift. */
.lang-flag {
  width: 42px;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: stretch;
  position: relative;
  transition: opacity var(--t-base) var(--ease-out),
              transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
  opacity: 0.55;
  /* thin white inner stroke clarifies the chip's edge against
   * the dark canvas without competing for attention. */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.20) inset;
  cursor: pointer;
}
.lang-flag img,
.lang-flag svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lang-flag + .lang-flag { margin-inline-start: 8px; }
.lang-flag:hover { opacity: 0.85; transform: translateY(-1px); }

/* Active flag — full opacity + a confident cyan ring around
 * the chip + a soft brand-tinted outer glow so the user sees
 * at a glance which language is currently rendered. */
[dir="rtl"] .lang-flag[data-lang="ar"],
[dir="ltr"] .lang-flag[data-lang="en"] {
  opacity: 1;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.20) inset,
    0 0 0 2px var(--brand),
    0 0 0 6px rgba(19, 181, 243, 0.18);
  transform: scale(1.06) translateY(-1px);
}

/* ─── Owner CTA pill ─────────────────────────────────────
 * Slightly larger, more elegant pill with a refined glass-edge
 * inner highlight + the continuous motion:
 *   - a soft cyan halo pulses outward every 2.6s
 *   - a thin diagonal sheen sweeps across the pill every 4.5s
 *   - the arrow icon nudges forward and back gently
 * Hover pauses the sheen so the label reads cleanly. */
.owner-cta {
  position: relative;
  height: 50px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  /* Three-layer background: top-of-pill white highlight (depth),
   * a darker inner core ring that gives the pill a "cut-out"
   * dimensional feel, and the brand cyan gradient as the actual
   * fill. The dark ring is what makes the pill feel premium
   * rather than just a flat cyan tab. */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, transparent 38%),
    radial-gradient(120% 180% at 50% 130%, rgba(6, 16, 24, 0.35) 0%, transparent 55%),
    linear-gradient(135deg, var(--brand) 0%, #29c5ff 55%, var(--brand) 100%);
  background-size: auto, auto, 220% 100%;
  background-position: center, center, 0 0;
  color: #061018;
  font-weight: 800;
  font-size: 0.94rem;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--t-fast) var(--ease-out),
              filter var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 0 0 1px rgba(19, 181, 243, 0.55),
    0 18px 40px -18px rgba(19, 181, 243, 0.7),
    0 0 0 0 rgba(19, 181, 243, 0.4);
  /* Animations are slower than before — `cta-pulse` was the
   * "look at me" pulse on a 2.6s loop, which read as needy.
   * 4s feels like a confident heartbeat instead. Sheen and
   * background-shift are similarly slowed for a calmer feel. */
  animation: cta-pulse 4s var(--ease-soft) infinite,
             cta-bg 9s var(--ease-soft) infinite;
}
.owner-cta::before {
  /* Slow diagonal sheen — sweeps across the pill on a 6s loop
   * (was 4.5s). Slower = more refined; pulled width down to
   * 32% so the highlight reads as a focused glint, not a wide
   * stripe. */
  content: "";
  position: absolute;
  inset-block: -1px;
  inset-inline-start: -40%;
  width: 32%;
  background: linear-gradient(
    115deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 100%
  );
  pointer-events: none;
  animation: cta-sheen 6s var(--ease-soft) infinite;
}
.owner-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 0 0 1px rgba(19, 181, 243, 0.7),
    0 22px 44px -18px rgba(19, 181, 243, 0.75);
  animation-play-state: paused;
}
.owner-cta:hover::before { animation-play-state: paused; }
/* Leading icon — the small storefront glyph that gives the
 * button context ("this is for businesses"). Static; no
 * animation so the trailing arrow remains the kinetic
 * affordance. */
.owner-cta__lead {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.92;
}
/* Trailing arrow — gentle forward nudge so the affordance
 * reads as "go". 4s loop matches the pulse cadence. */
.owner-cta__trail {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  animation: cta-nudge 4s var(--ease-soft) infinite;
}
[dir="rtl"] .owner-cta__trail { animation-name: cta-nudge-rtl; transform: scaleX(-1); }

@keyframes cta-pulse {
  0%, 100% {
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.45) inset,
      0 0 0 1px rgba(19, 181, 243, 0.55),
      0 18px 40px -18px rgba(19, 181, 243, 0.7),
      0 0 0 0 rgba(19, 181, 243, 0.4);
  }
  60% {
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.45) inset,
      0 0 0 1px rgba(19, 181, 243, 0.55),
      0 18px 40px -18px rgba(19, 181, 243, 0.7),
      0 0 0 16px rgba(19, 181, 243, 0);
  }
}
@keyframes cta-bg {
  0%, 100% { background-position: center, center, 0% 0; }
  50%      { background-position: center, center, 100% 0; }
}
@keyframes cta-sheen {
  0%, 10% { inset-inline-start: -40%; }
  55%, 100% { inset-inline-start: 130%; }
}
@keyframes cta-nudge {
  0%, 60%, 100% { transform: translateX(0); }
  72%, 88%      { transform: translateX(3px); }
}
@keyframes cta-nudge-rtl {
  0%, 60%, 100% { transform: translateX(0) scaleX(-1); }
  72%, 88%      { transform: translateX(-3px) scaleX(-1); }
}

@media (prefers-reduced-motion: reduce) {
  .owner-cta,
  .owner-cta::before,
  .owner-cta__trail { animation: none; }
}

/* ─── Refined hamburger ─────────────────────────────────── */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--text-1);
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color var(--t-base) var(--ease-out),
              background var(--t-base) var(--ease-out);
}
.menu-toggle:hover { border-color: var(--line-strong); background: var(--surface-2); }
.menu-toggle__bars {
  position: relative;
  width: 16px;
  height: 10px;
}
.menu-toggle__bars span {
  position: absolute;
  inset-inline: 0;
  height: 1.5px;
  background: var(--text-1);
  border-radius: 2px;
  transition: transform var(--t-base) var(--ease-out),
              opacity var(--t-base) var(--ease-out),
              top var(--t-base) var(--ease-out);
}
.menu-toggle__bars span:nth-child(1) { top: 0; }
.menu-toggle__bars span:nth-child(2) { top: 4px; width: 70%; }
.menu-toggle__bars span:nth-child(3) { top: 8px; }
.menu-toggle.is-open .menu-toggle__bars span:nth-child(1) { top: 4px; transform: rotate(45deg); }
.menu-toggle.is-open .menu-toggle__bars span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open .menu-toggle__bars span:nth-child(3) { top: 4px; transform: rotate(-45deg); }

/* ─── Mobile drawer (redesigned) ───────────────────────── */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  background: rgba(7, 9, 13, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mobile-drawer.is-open { opacity: 1; pointer-events: auto; }

.mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  border-block-end: 1px solid var(--line);
}

.mobile-drawer__body {
  flex: 1;
  padding: 28px var(--gutter) 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
/* Push the lang switch + CTA toward the bottom of the drawer
 * so the link groups breathe and the action block reads as a
 * dedicated foot section. */
.mobile-drawer__body .mobile-drawer__lang { margin-block-start: auto; }

.mobile-drawer__group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-drawer__group-label {
  font-family: var(--font-en);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-4);
  font-weight: 700;
  padding-inline-start: 18px;
  margin-block-end: 8px;
}
[lang="ar"] .mobile-drawer__group-label { text-transform: none; letter-spacing: 0.04em; }

.mobile-drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-1);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color var(--t-base) var(--ease-out),
              background var(--t-base) var(--ease-out);
}
.mobile-drawer__link:hover,
.mobile-drawer__link:active {
  border-color: var(--line-strong);
  background: var(--surface);
}
.mobile-drawer__link svg {
  width: 16px; height: 16px;
  color: var(--text-3);
  transition: color var(--t-base) var(--ease-out),
              transform var(--t-base) var(--ease-out);
}
.mobile-drawer__link:hover svg { color: var(--brand); transform: translateX(2px); }
[dir="rtl"] .mobile-drawer__link:hover svg { transform: translateX(-2px); }

/* Lang chips inside the drawer — no container, no border, no
 * background. The two flag chips sit centred on the drawer
 * canvas and blend in. */
.mobile-drawer__lang {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  background: transparent;
  border: 0;
}
.mobile-drawer__lang .lang-switch {
  background: transparent;
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.mobile-drawer__lang .lang-flag {
  width: 52px;
  height: 36px;
  border-radius: 9px;
}

/* Owner CTA pinned at the drawer foot — slightly larger pill
 * with breathing room above. */
.mobile-drawer__cta {
  margin-block-start: 16px;
  width: 100%;
  justify-content: center;
  height: 58px;
  font-size: 1.05rem;
  letter-spacing: 0;
}
