/**
 * Base — reset + عناصر أساسية + أدوات الوصول.
 * لا يحتوي على أي مكوّن (أزرار، بطاقات...) — كل مكوّن في ملفه داخل components/.
 */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  direction: rtl;   /* المتجر عربي فقط، نفس السلوك القديم */
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line);
  font-weight: var(--md-sys-typescale-body-medium-weight);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, video, canvas { max-width: 100%; height: auto; display: block; }
svg { max-width: 100%; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; }
table { border-collapse: collapse; border-spacing: 0; }
[hidden] { display: none !important; }

/* ───── Focus (MD3: حلقة واضحة للوحة المفاتيح فقط) ───── */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--md-sys-color-secondary);
  outline-offset: 2px;
  border-radius: var(--md-sys-shape-corner-extra-small);
}

::selection {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

/* ───── Layout ───── */
.zolna-container {
  width: 100%;
  max-width: var(--zolna-container);
  margin-inline: auto;
  padding-inline: var(--zolna-gutter);
}

/* ───── Typescale utilities ───── */
.md-display-large   { font-size: var(--md-sys-typescale-display-large-size);   line-height: var(--md-sys-typescale-display-large-line);   font-weight: var(--md-sys-typescale-display-large-weight); }
.md-display-medium  { font-size: var(--md-sys-typescale-display-medium-size);  line-height: var(--md-sys-typescale-display-medium-line);  font-weight: var(--md-sys-typescale-display-medium-weight); }
.md-display-small   { font-size: var(--md-sys-typescale-display-small-size);   line-height: var(--md-sys-typescale-display-small-line);   font-weight: var(--md-sys-typescale-display-small-weight); }
.md-headline-large  { font-size: var(--md-sys-typescale-headline-large-size);  line-height: var(--md-sys-typescale-headline-large-line);  font-weight: var(--md-sys-typescale-headline-large-weight); }
.md-headline-medium { font-size: var(--md-sys-typescale-headline-medium-size); line-height: var(--md-sys-typescale-headline-medium-line); font-weight: var(--md-sys-typescale-headline-medium-weight); }
.md-headline-small  { font-size: var(--md-sys-typescale-headline-small-size);  line-height: var(--md-sys-typescale-headline-small-line);  font-weight: var(--md-sys-typescale-headline-small-weight); }
.md-title-large     { font-size: var(--md-sys-typescale-title-large-size);     line-height: var(--md-sys-typescale-title-large-line);     font-weight: var(--md-sys-typescale-title-large-weight); }
.md-title-medium    { font-size: var(--md-sys-typescale-title-medium-size);    line-height: var(--md-sys-typescale-title-medium-line);    font-weight: var(--md-sys-typescale-title-medium-weight); }
.md-title-small     { font-size: var(--md-sys-typescale-title-small-size);     line-height: var(--md-sys-typescale-title-small-line);     font-weight: var(--md-sys-typescale-title-small-weight); }
.md-label-large     { font-size: var(--md-sys-typescale-label-large-size);     line-height: var(--md-sys-typescale-label-large-line);     font-weight: var(--md-sys-typescale-label-large-weight); }
.md-label-medium    { font-size: var(--md-sys-typescale-label-medium-size);    line-height: var(--md-sys-typescale-label-medium-line);    font-weight: var(--md-sys-typescale-label-medium-weight); }
.md-label-small     { font-size: var(--md-sys-typescale-label-small-size);     line-height: var(--md-sys-typescale-label-small-line);     font-weight: var(--md-sys-typescale-label-small-weight); }
.md-body-large      { font-size: var(--md-sys-typescale-body-large-size);      line-height: var(--md-sys-typescale-body-large-line);      font-weight: var(--md-sys-typescale-body-large-weight); }
.md-body-medium     { font-size: var(--md-sys-typescale-body-medium-size);     line-height: var(--md-sys-typescale-body-medium-line);     font-weight: var(--md-sys-typescale-body-medium-weight); }
.md-body-small      { font-size: var(--md-sys-typescale-body-small-size);      line-height: var(--md-sys-typescale-body-small-line);      font-weight: var(--md-sys-typescale-body-small-weight); }

/* ───── Accessibility ───── */
.screen-reader-text,
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  inset-block-start: var(--zolna-space-2);
  inset-inline-start: var(--zolna-space-2);
  z-index: 10000;
  padding: var(--zolna-space-3) var(--zolna-space-4);
  border-radius: var(--md-sys-shape-corner-small);
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  transform: translateY(-200%);
  transition: transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}
.skip-link:focus { transform: none; }

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

.page-spacer { margin-top: 30px; }

/* ───── لمسة أناقة عامة ───── */
body { background: linear-gradient(180deg, var(--md-sys-color-surface-container-low) 0, var(--md-sys-color-background) 360px) no-repeat, var(--md-sys-color-background); }
.tile, .acc-link, .cart-item, .wt-card, .pd-shell, .buy-box { box-shadow: 0 1px 2px rgb(0 40 48 / .04), 0 4px 16px rgb(0 40 48 / .04); }
::selection { background: var(--md-sys-color-primary-container); }
:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; }
