/* =====================================================================
   MT-Themes v2 — base: reset, type, layout utilities, header, footer,
   buttons, links, chips, forms, section rhythm. (DESIGN.md §3–§4)
   Logical properties only. Direction-aware icons mirror via .icon-dir.
   ===================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ar);
  font-size: var(--fs-1);
  line-height: var(--lh-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 1200px) {
  body {
    font-size: 1.0625rem;
  }
}

html[lang='en'] body {
  font-family: var(--font-lat);
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: var(--lh-tight);
  font-weight: 700;
  text-wrap: balance;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.125rem, 4.4vw, var(--fs-7));
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(var(--fs-4), 3vw, var(--fs-5));
  color: var(--blue-ink);
}

h3 {
  font-size: var(--fs-3);
  font-weight: 600;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

figure,
blockquote,
dl,
dd {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

/* ---- Utilities ---- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.lat {
  font-family: var(--font-lat);
}

/* Numbers never flip: LTR isolate with tabular mono digits. */
.num,
.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}

/* Word-month dates follow the page direction inside an isolate; digits stay Western. */
time {
  unicode-bidi: isolate;
  white-space: nowrap;
}

/* Grid and flex children never force a column wider than the viewport. */
.hero-grid > *,
.band-grid > *,
.apps-grid > *,
.services-grid > *,
.faq-grid > *,
.foot-grid > * {
  min-width: 0;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  inset-inline-start: var(--s-4);
  top: -100px;
  background: var(--blue-deep);
  color: #fff;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-1);
  z-index: 100;
  text-decoration: none;
  font-weight: 600;
}

.skip:focus {
  top: var(--s-2);
}

/* Directional icons: drawn pointing inline-end, mirrored once in RTL.
   Non-directional icons (search, phone, check, star, external) never carry .icon-dir. */
.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

[dir='rtl'] .icon-dir {
  transform: scaleX(-1);
}

/* ---- Buttons and links ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-5);
  border-radius: var(--r-2);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.btn-primary {
  background: var(--blue-deep);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--blue-ink);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  border-color: var(--blue-ink);
}

.btn-ghost {
  background: transparent;
  color: var(--link);
  padding-inline: var(--s-3);
}

.btn-ghost:hover {
  background: var(--paper-2);
}

.btn-lg {
  min-height: 56px;
  padding-inline: var(--s-6);
  font-size: var(--fs-2);
}

.btn-sm {
  min-height: 44px;
  padding-inline: var(--s-4);
}

.btn .icon {
  width: 20px;
  height: 20px;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
  min-height: 44px;
  white-space: nowrap;
}

.link-arrow:hover {
  text-decoration: underline;
}

.link-arrow .icon {
  width: 18px;
  height: 18px;
}

/* ---- Chips ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  min-height: 26px;
  padding: 0 var(--s-3);
  border-radius: var(--r-1);
  font-size: var(--fs-0);
  font-weight: 600;
  line-height: 1.2;
  background: var(--blue-tint);
  color: var(--blue-ink);
  white-space: nowrap;
}

.chip-quiet {
  background: var(--paper-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

/* Platform chips wear the platform's own brand colour (white text ≥ 4.5:1 on each). */
.chip-p {
  color: #fff;
  border: 0;
}

.chip-p-zid {
  background: #6c2bd9; /* Zid purple */
}

.chip-p-salla {
  background: #004d5a; /* Salla deep teal */
}

.chip-p-shopify {
  background: #008060; /* Shopify green */
}

.chip-p-private {
  background: var(--navy); /* made-to-order */
}

.chip-p-desktop {
  background: #1e3a8a; /* fixed: --blue-ink turns light in dark mode (white text on it was 1.7:1) */
}

.chip-ok {
  background: var(--ok);
  color: #fff;
}

.chip-ab {
  background: var(--autoblog-tint);
  color: var(--autoblog-ink);
}

/* ---- Price: digits isolated, currency outside the isolate ---- */
.price {
  font-family: var(--font-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 0.25em;
}

/* The currency label is smaller than the digits but never below the 14px
   caption floor (DESIGN.md §3): "ر.س" at 11px was the one unreadable part. */
.price-cur {
  font-family: inherit;
  font-size: max(0.8em, 0.875rem);
  color: var(--ink-2);
  font-weight: 500;
}

html[lang='ar'] .price-cur {
  font-family: var(--font-ar);
}

/* The struck was-price is a whole money() — digits isolated, currency outside
   the isolate — so it reads in the same direction as the live price ("920 ر.س
   1,840 ر.س", never "ر.س 920 1,840 ر.س"). The strike is drawn on the inner
   .price (an atomic inline-flex does not inherit the <del>'s decoration). */
.price-was {
  font-size: var(--fs-0);
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
}

.price-was .price {
  font-size: inherit;
  color: inherit;
  text-decoration: line-through;
}

.price-was .price-cur {
  color: inherit;
}

.price-note {
  font-size: var(--fs-0);
  color: var(--ink-3);
}

/* ---- Section rhythm: more space above a heading than below ---- */
.section {
  padding-block: var(--section-y);
}

.section-dense {
  padding-block: calc(var(--section-y) * 0.6);
}

.section-quiet {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--s-3) var(--s-6);
  margin-bottom: var(--s-6);
}

.sec-head h2 {
  flex: 1 1 20ch;
  max-width: 26ch;
}

.sec-head p {
  flex: 1 1 32ch;
  max-width: var(--measure);
  color: var(--ink-2);
  font-size: var(--fs-2);
}

.sec-head .link-arrow {
  flex: none;
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* ---- Wordmark (DESIGN.md §2; do not restyle) ----
   Pacifico text + 9px #0D6EFD dot at inset-inline-end:-15px; bottom:12px.
   The anchor is dir="ltr" (a Latin brand), so inline-end is the same edge in
   both languages — exactly where the legacy .logo-text::after sits. The
   line-height stays the font's normal one, as legacy: the dot is measured
   from the line box's bottom, so a tighter box would lift it off the baseline
   (1.2 moved it 9px up the letters). Header 1.9rem, footer 2rem, as legacy. */
.wordmark {
  font-family: var(--font-wordmark);
  font-weight: 400;
  font-size: 1.9rem;
  line-height: normal;
  position: relative;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline-end: 15px;
}

.wordmark::after {
  content: '';
  position: absolute;
  inset-inline-end: 0;
  bottom: 12px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--dot);
}

.wordmark-text {
  position: relative;
}

.band .wordmark {
  color: var(--on-navy);
}

.site-footer .wordmark {
  font-size: 2rem;
  color: var(--on-navy);
}

@media (max-width: 599px) {
  .wordmark {
    font-size: 1.6rem;
  }
}

/* ---- Header (owner's redesign 2026-09-28) ----
   A 36px navy strip (tagline · contact · language) over the main bar: solid
   paper, 1px line, 72px, sticky. The whole header sticks at minus the strip's
   height, so the strip scrolls away and the bar stays; shadow after scroll
   (site.js). No blur, no gradient, no glow. */
.site-header {
  --topbar-h: 36px;
  position: sticky;
  top: calc(-1 * var(--topbar-h));
  z-index: 50;
  color: var(--ink);
}

.header-bar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--dur) var(--ease);
}

.site-header.is-scrolled .header-bar {
  box-shadow: var(--shadow-1);
}

.topbar {
  background: var(--navy);
  color: var(--on-navy-2);
  font-size: var(--fs-0);
  line-height: 1.2;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  min-height: var(--topbar-h);
}

.topbar-tag {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  flex: none;
}

.topbar-links a {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--topbar-h);
  padding-inline: var(--s-3);
  color: var(--on-navy-2);
  text-decoration: none;
  white-space: nowrap;
}

.topbar-links a:hover {
  color: var(--on-navy);
  text-decoration: underline;
}

.topbar-links .icon {
  width: 16px;
  height: 16px;
}

.topbar-links .num {
  font-family: inherit;
  font-weight: 400;
}

.topbar-links .topbar-lang {
  font-weight: 600;
  color: var(--on-navy);
  border-inline-start: 1px solid var(--navy-2);
  margin-inline-start: var(--s-2);
}

@media (max-width: 599px) {
  .site-header {
    --topbar-h: 0px;
  }

  .topbar {
    display: none;
  }
}

.header-row {
  position: relative; /* the apps panel centres under the whole bar */
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: var(--header-h);
}

.nav {
  margin-inline-start: var(--s-3);
}

.nav > ul {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.nav-link:hover,
.nav-trigger[aria-expanded='true'] {
  color: var(--ink);
  background: var(--blue-tint);
}

/* Current page: link-blue text over a 2px blue-deep bar, centred under the
   label (equal logical insets, so it sits right in both directions). */
.nav-link[aria-current='page'],
.nav-link.is-current {
  color: var(--link);
}

.nav-link[aria-current='page']::after,
.nav-link.is-current::after {
  content: '';
  position: absolute;
  inset-inline: 14px;
  bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue-deep);
}

.nav-link[aria-current='page']:hover {
  background: transparent;
}

.icon-caret {
  width: 16px;
  height: 16px;
  transition: transform var(--dur) var(--ease);
}

.nav-trigger[aria-expanded='true'] .icon-caret {
  transform: rotate(180deg);
}

/* The "our apps" panel: white, --shadow-2, 12px radius, two columns. */
.menu-panel {
  display: none;
  position: absolute;
  top: calc(100% - 6px);
  inset-inline: var(--gutter);
  margin-inline: auto;
  width: min(760px, calc(100% - 2 * var(--gutter)));
  padding: var(--s-4);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  z-index: 55;
}

.nav-menu.is-open .menu-panel,
.nav-menu:not([data-js]):hover .menu-panel,
.nav-menu:not([data-js]):focus-within .menu-panel {
  display: block;
}

.menu-apps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-1);
}

.ma {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-2);
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}

.ma:hover {
  background: var(--paper-2);
}

.ma-logo {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--r-2);
  border: 1px solid var(--line);
  background: var(--paper-2);
  object-fit: contain;
}

.ma-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ma-name {
  font-weight: 600;
  line-height: 1.4;
}

.ma-desc {
  color: var(--ink-3);
  font-size: var(--fs-0);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ma-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  margin-top: var(--s-1);
}

.ma-chips .chip {
  min-height: 22px;
  padding-inline: var(--s-2);
}

.menu-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--s-2);
  padding-top: var(--s-2);
  border-top: 1px solid var(--line);
}

.header-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.header-actions .btn {
  white-space: nowrap;
}

/* The menu button: a primary 44px icon button (mobile only). */
.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-2);
  background: var(--blue-deep);
  cursor: pointer;
  color: #fff;
}

.menu-btn:hover {
  background: var(--blue);
}

.drawer-head .menu-btn {
  display: inline-flex;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
}

.drawer-head .menu-btn:hover {
  border-color: var(--blue-ink);
  background: transparent;
}

/* 960–1199: the same bar, tighter, without the second button. */
@media (max-width: 1199px) {
  .nav {
    margin-inline-start: 0;
  }

  .nav-link {
    padding-inline: 10px;
  }

  .nav-link[aria-current='page']::after,
  .nav-link.is-current::after {
    inset-inline: 10px;
  }

  .header-actions .btn-primary {
    display: none;
  }
}

@media (max-width: 959px) {
  .nav,
  .header-actions .btn {
    display: none;
  }

  .menu-btn {
    display: inline-flex;
  }
}

/* Mobile drawer: full-height, 48px rows */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--paper);
  color: var(--ink);
  overflow-y: auto;
  padding: 0 var(--gutter) var(--s-6);
}

.drawer[hidden] {
  display: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s-3);
}

.drawer ul li a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 var(--s-2);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--fs-2);
  border-bottom: 1px solid var(--line);
}

.drawer ul li a[aria-current='page'] {
  color: var(--link);
}

.drawer-label {
  margin-top: var(--s-5);
  color: var(--ink-3);
  font-size: var(--fs-0);
  font-weight: 600;
}

.drawer .drawer-apps ul li a.ma-compact {
  gap: var(--s-3);
  border-radius: 0;
  font-size: var(--fs-1);
  padding-block: var(--s-1);
}

.drawer-apps .ma-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--r-1);
}

.drawer-actions {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-5);
}

.drawer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-4);
  margin-top: var(--s-5);
}

.drawer-contact a {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  color: var(--ink-2);
  text-decoration: none;
}

.drawer-contact .num {
  font-family: inherit;
}

.drawer-contact .drawer-lang {
  font-weight: 600;
  color: var(--link);
}

body.drawer-open {
  overflow: hidden;
}

/* ---- Footer: deep navy (premium close), four columns, legal line ----
   Tokens are re-scoped here so every child rule keeps using --ink/--line/--link. */
.site-footer {
  --ink: var(--on-navy);
  --ink-2: var(--on-navy-2);
  --line: var(--navy-2);
  --link: #9cc0ff;
  background: var(--navy);
  border-top: 1px solid var(--navy-2);
  padding-block: var(--s-7) var(--s-5);
  color: var(--ink-2);
  font-size: var(--fs-0);
}

.foot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5) var(--s-4);
}

.foot-brand,
.foot-contact {
  grid-column: 1 / -1;
}

.foot-contact ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s-5);
}

.foot-contact .social {
  margin-top: var(--s-3);
}

.foot-cols {
  display: block;
}

@media (min-width: 960px) {
  .foot-grid {
    grid-template-columns: 5fr 3fr 3fr 4fr;
    gap: var(--s-6);
  }

  .foot-brand,
  .foot-contact {
    grid-column: auto;
  }

  .foot-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--s-3);
  }
}

.foot-grid h3 {
  font-size: var(--fs-1);
  color: var(--ink);
  margin-bottom: var(--s-3);
}

.foot-brand p {
  max-width: 44ch;
  margin-top: var(--s-3);
}

.foot-grid li a {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  color: var(--ink-2);
  text-decoration: none;
}

.foot-grid li a:hover {
  color: var(--link);
  text-decoration: underline;
}

.foot-grid li a .icon {
  width: 18px;
  height: 18px;
}

.foot-bottom {
  margin-top: var(--s-7);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  justify-content: space-between;
  align-items: center;
}

.foot-legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  align-items: center;
}

.foot-legal a {
  color: var(--ink-2);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.social {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-1);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.social a:hover {
  color: var(--link);
  border-color: var(--blue-deep);
}

.social .icon {
  width: 18px;
  height: 18px;
}

/* ---- Forms (§4): 48px inputs on paper-2, label above, ring on focus ---- */
.field {
  display: grid;
  gap: var(--s-2);
}

.field label {
  font-weight: 600;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--s-4);
  font: inherit;
  color: var(--ink);
  background: var(--paper-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-1);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--blue-deep);
  outline: 2px solid var(--blue-deep);
  outline-offset: 2px;
}

.field input[dir='ltr'] {
  text-align: start;
}

.field-help {
  font-size: var(--fs-0);
  color: var(--ink-3);
}

.field-error {
  font-size: var(--fs-0);
  color: var(--danger);
}
