/* ============================================================
   Reset + document foundations (RTL Arabic first)
   ============================================================ */

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

/* The UA's `[hidden] { display: none }` loses to any author rule that sets
   display (.alert, .order-layout, .cart-bar …), which silently breaks every
   `node.hidden = true` in the app. Restore the guarantee once, globally. */
[hidden] {
  display: none !important;
}

* {
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  /* A single site-wide guarantee against horizontal scroll on phones. */
  overflow-x: hidden;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.28;
  color: var(--forest);
  text-wrap: balance;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); }

p { text-wrap: pretty; }

a {
  color: var(--forest);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

a:hover { color: var(--terracotta); }

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { background: none; border: none; cursor: pointer; }

ul, ol { list-style: none; }

:focus-visible {
  outline: 3px solid var(--fresh);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--saffron);
  color: var(--forest-deep);
}

/* Warm-tinted scrollbar so even the chrome feels on-brand */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--cream-deep); }
::-webkit-scrollbar-thumb {
  background: var(--saffron-deep);
  border-radius: var(--radius-pill);
  border: 2px solid var(--cream-deep);
}

/* ---------------------------------------------------- layout */

.shell {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(2.5rem, 7vw, 5rem);
}

.section--tight { padding-block: clamp(1.75rem, 5vw, 3rem); }

.stack > * + * { margin-top: var(--sp-4); }
.stack-sm > * + * { margin-top: var(--sp-2); }
.stack-lg > * + * { margin-top: var(--sp-6); }

.grid {
  display: grid;
  gap: var(--sp-4);
}

.center-text { text-align: center; }

/* ------------------------------------------------- utilities */

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

.skip-link {
  position: absolute;
  inset-inline-start: 50%;
  top: -100px;
  transform: translateX(50%);
  background: var(--forest);
  color: var(--saffron);
  padding: 0.7rem 1.4rem;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 200;
  transition: top 0.2s var(--ease);
}

.skip-link:focus { top: 0; color: var(--saffron); }

.hide-desktop { display: initial; }
.hide-mobile { display: none; }

@media (min-width: 900px) {
  .hide-desktop { display: none; }
  .hide-mobile { display: initial; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
