/* Base element styles and a few shared building blocks. Component styles live next to their
   components (.razor.css). Logical properties throughout so Arabic mirrors (DESIGN.md section 9). */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  /* Keep text the same visual size while the web font swaps in. */
  font-size-adjust: from-font;
}

main { flex: 1 0 auto; }

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

a { color: inherit; }

h1, h2, h3 { margin: 0; font-weight: 500; text-wrap: balance; }

p { margin: 0; text-wrap: pretty; }

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

:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* Prices, counts and totals line up (DESIGN.md section 4). */
.num { font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
}


/* Things that must never mirror or reorder inside Arabic text: phones, SKUs, codes. */
.ltr { direction: ltr; unicode-bidi: isolate; }

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

/* Not found and error pages. */
.status-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-4);
    padding-block-start: var(--s-16);
    text-align: center;
}
.status-page h1 { font-size: 28px; letter-spacing: var(--heading-track); }
.status-page p { max-width: 460px; color: var(--ink-2); }
.status-page .request-id { font-size: 13px; color: var(--ink-3); }

/* Phones: room under the page for the bars fixed to the bottom (product Add to cart, cart total). */
@media (max-width: 639.98px) {
  body:has(.fixed-bar) { padding-block-end: 80px; }
}

/* Skip link, shared by the store and sign-in layouts. */
.skip-link {
  position: absolute;
  inset-inline-start: var(--s-4);
  top: -100px;
  z-index: 10;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-control);
  background: var(--ink);
  color: var(--surface);
  text-decoration: none;
}

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

/* Direction-bound icons (arrows, sign out) point the other way in right-to-left pages. */
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
