/* =================================================================
   MAS TAPE — Base Styles
   يستهلك tokens.css حصراً — لا قيم ثابتة هنا
   ================================================================= */

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

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

/* ─── Base ─── */
body {
  font-family: var(--font-body-en);
  font-size: var(--fs-base);
  font-weight: var(--fw-body);
  line-height: var(--lh-normal);
  color: var(--ink);
  background-color: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[dir="rtl"] body,
[dir="rtl"] {
  font-family: var(--font-body-ar);
}

/* ─── Headings ─── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head-en);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--ink);
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
  font-family: var(--font-head-ar);
}

/* ─── Links ─── */
a {
  color: inherit;
  text-decoration: none;
}

/* ─── Images ─── */
img, svg {
  display: block;
  max-width: 100%;
}

/* ─── Lists ─── */
ul, ol {
  list-style: none;
}

/* ─── Buttons / Inputs base ─── */
button, input, select, textarea {
  font: inherit;
}

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

/* ─── Focus visible (accessibility) ─── */
:focus-visible {
  outline: 2px solid var(--red-700);
  outline-offset: 2px;
}

/* ─── Skip to content ─── */
.skip-to-content {
  position: absolute;
  top: -100%;
  inset-inline-start: var(--space-4);
  z-index: 9999;
  padding: var(--space-3) var(--space-5);
  background: var(--red-700);
  color: var(--off-white);
  font-family: var(--font-head-en);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  letter-spacing: 0.05em;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top var(--t-fast);
}

.skip-to-content:focus {
  top: 0;
}

/* ─── Reduced motion ─── */
@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;
  }
}

/* ─── Container ─── */
.container {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (max-width: 768px) {
  .container {
    padding-inline: var(--space-4);
  }
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-5);
  height: 44px;
  font-family: var(--font-head-en);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

[dir="rtl"] .btn {
  font-family: var(--font-head-ar);
  letter-spacing: 0;
}

.btn-primary {
  background: var(--red-700);
  color: var(--off-white);
  box-shadow: var(--shadow-red);
}

.btn-primary:hover {
  background: var(--red-600);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(160, 26, 23, .38);
}

.btn-primary:active {
  background: var(--red-800);
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--navy-800);
  border: 1px solid var(--navy-700);
}

.btn-secondary:hover {
  background: var(--gray-100);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: .5;
  pointer-events: none;
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-in-stock   { background: rgba(31, 138, 76, .12);  color: var(--success); }
.badge-coming-soon { background: rgba(201, 130, 26, .12); color: var(--warning); }
.badge-out-of-stock { background: rgba(160, 26, 23, .10); color: var(--danger);  }

/* ─── Cards ─── */
.card {
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--t-normal), transform var(--t-normal);
}

@media (prefers-reduced-motion: no-preference) {
  .card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
  }
}

/* ─── Form fields ─── */
.field {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-base);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}

.field:focus {
  border-color: var(--red-700);
  box-shadow: 0 0 0 3px rgba(160, 26, 23, .12);
}

.field.error {
  border-color: var(--danger);
}
