/**
 * LOADRYX Design System — Base / reset / typography
 *
 * RTL rule for the whole codebase: logical properties only.
 * No `left`, no `right`, no `margin-left`. Use inline-start / inline-end.
 * Flipping the site to LTR then costs nothing.
 */

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

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

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

body {
  margin: 0;
  background-color: var(--lx-ink-000);
  color: var(--lx-fg);
  font-family: var(--lx-font-ar);
  font-size: var(--lx-fs-base);
  font-weight: var(--lx-fw-normal);
  line-height: var(--lx-lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------------------------------------------------------------------
   Headings
   --------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--lx-font-display);
  font-weight: var(--lx-fw-bold);
  line-height: var(--lx-lh-heading);
  color: var(--lx-fg);
  text-wrap: balance;
}

h1 {
  font-size: var(--lx-fs-h1);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: var(--lx-fw-black);
}
h2 {
  font-size: var(--lx-fs-h2);
  letter-spacing: -0.005em;
}
h3 {
  font-size: var(--lx-fs-h3);
}
h4 {
  font-size: var(--lx-fs-lg);
}

p {
  margin: 0;
  max-width: var(--lx-measure);
}

/* ---------------------------------------------------------------------
   Links
   --------------------------------------------------------------------- */

a {
  color: inherit;
  text-decoration: none;
}

a:not([class]) {
  color: var(--lx-accent);
  border-bottom: 1px solid var(--lx-accent-line);
  transition: border-color var(--lx-dur) var(--lx-ease);
}

a:not([class]):hover {
  border-bottom-color: var(--lx-accent);
}

/* ---------------------------------------------------------------------
   Focus — visible everywhere, removed nowhere.
   --------------------------------------------------------------------- */

:focus-visible {
  outline: var(--lx-focus-ring);
  outline-offset: var(--lx-focus-offset);
  border-radius: var(--lx-radius-sm);
}

/* Only suppress the ring for pointer users who already got a hover cue. */
:focus:not(:focus-visible) {
  outline: none;
}

/* ---------------------------------------------------------------------
   Media — every image reserves its box before it loads.
   --------------------------------------------------------------------- */

img,
picture,
video,
canvas,
svg,
iframe {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

/* Any image that ships width/height attributes keeps its ratio when fluid. */
img[width][height] {
  height: auto;
}

/* ---------------------------------------------------------------------
   Forms — inherit the type stack, never the browser's.
   --------------------------------------------------------------------- */

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

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

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: start;
}

/* ---------------------------------------------------------------------
   Numerals — prices, quantities, SKUs line up in columns.
   --------------------------------------------------------------------- */

.lx-num,
.lx-price,
td[data-numeric],
.lx-mono {
  font-family: var(--lx-font-display);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}

/* Mono labels: uppercase, tracked, small. Always LTR-isolated so an
   Arabic sentence around them does not reorder the Latin. */
.lx-label {
  font-family: var(--lx-font-mono);
  font-size: var(--lx-fs-2xs);
  letter-spacing: var(--lx-tracking-label);
  text-transform: uppercase;
  color: var(--lx-fg-dim);
  direction: ltr;
  unicode-bidi: isolate;
}

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

/* Visually hidden but available to assistive tech. */
.lx-sr-only {
  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.
 * The audit found production shipping this as a 1x1px element — present in
 * the DOM but impossible to use. Here it is genuinely hidden until focused,
 * then rendered at full size.
 */
.lx-skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: var(--lx-space-4);
  z-index: var(--lx-z-toast);
  padding: var(--lx-space-3) var(--lx-space-5);
  min-height: var(--lx-tap-min);
  display: inline-flex;
  align-items: center;
  background-color: var(--lx-accent);
  color: var(--lx-on-accent);
  font-weight: var(--lx-fw-semibold);
  border-radius: 0 0 var(--lx-radius-md) var(--lx-radius-md);
}

.lx-skip-link:focus {
  inset-block-start: 0;
}

/* ---------------------------------------------------------------------
   Layout primitives
   --------------------------------------------------------------------- */

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

.lx-section {
  padding-block: var(--lx-space-7);
}

@media (min-width: 768px) {
  .lx-section {
    padding-block: var(--lx-space-8);
  }
}

/* Section heading block: eyebrow + title + optional lead */
.lx-section-head {
  display: flex;
  flex-direction: column;
  gap: var(--lx-space-2);
  margin-block-end: var(--lx-space-5);
}

.lx-section-head__lead {
  color: var(--lx-fg-mid);
  font-weight: var(--lx-fw-light);
}

/* A head with an action on the far side */
.lx-section-head--split {
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--lx-space-4);
  flex-wrap: wrap;
}

/* Wide content that may exceed the viewport gets its own scroller,
   so the page body never scrolls sideways. */
.lx-scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
