/* ==========================================================================
   EduMarket — storefront stylesheet
   Brand: navy #142D4E · yellow #FFC928 · white #FFFFFF · light blue #EAF2F8
   Logical properties throughout so Arabic (RTL) mirrors without overrides.
   ========================================================================== */

:root {
  --navy: #142d4e;
  --navy-700: #1d3c63;
  --navy-500: #2f5480;
  --yellow: #ffc928;
  --yellow-600: #f0b400;
  --yellow-soft: #fff4cd;
  --white: #ffffff;
  --light: #eaf2f8;
  --light-2: #f5f9fc;
  --ink: #0f1f33;
  --muted: #5b7290;
  --line: #dbe6ef;
  --ok: #12805c;
  --warn: #b25b00;
  --danger: #b3261e;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(20, 45, 78, 0.06), 0 2px 8px rgba(20, 45, 78, 0.05);
  --shadow-md: 0 6px 24px rgba(20, 45, 78, 0.10);
  --shadow-lg: 0 18px 48px rgba(20, 45, 78, 0.16);

  --font: "Segoe UI", system-ui, -apple-system, "Noto Sans", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
  --container: 1240px;
  --header-h: 68px;
}

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

/* [hidden] must beat component display rules (e.g. .btn { display:inline-flex }) */
[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--navy);
  text-decoration: none;
}

a:hover {
  color: var(--navy-700);
}

h1,
h2,
h3,
h4 {
  color: var(--navy);
  line-height: 1.25;
  margin: 0 0 0.4em;
  font-weight: 800;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.6rem, 1.15rem + 1.8vw, 2.6rem);
}
h2 {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
}
h3 {
  font-size: 1.08rem;
}

p {
  margin: 0 0 1em;
}

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

.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 {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  background: var(--navy);
  color: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 12px;
  color: var(--white);
}

:focus-visible {
  outline: 3px solid var(--navy-500);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ top bar */
.topbar {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.8rem;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding-block: 6px;
}

.topbar__promo {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar__promo strong {
  color: var(--yellow);
}

.topbar__links {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.topbar a {
  color: inherit;
}

.topbar a:hover {
  color: var(--yellow);
}

.lang-switch {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 2px;
  gap: 2px;
}

.lang-switch button {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font: inherit;
  font-size: 0.76rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--yellow);
  color: var(--navy);
  font-weight: 700;
}

/* ------------------------------------------------------------------- header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(20, 45, 78, 0.02);
}

.header__main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding-block: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand img {
  height: 44px;
  width: auto;
}

.brand__fallback {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--navy);
}

/* search */
.search {
  display: flex;
  align-items: center;
  background: var(--light-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px 4px 4px 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}

.search:focus-within {
  border-color: var(--navy-500);
  box-shadow: 0 0 0 4px rgba(47, 84, 128, 0.10);
  background: var(--white);
}

.search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  padding: 10px 4px;
  color: var(--ink);
}

.search input:focus {
  outline: none;
}

.search input::placeholder {
  color: var(--muted);
}

.search select {
  border: 0;
  border-inline-start: 1px solid var(--line);
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 8px 10px;
  max-width: 150px;
  cursor: pointer;
}

.search select:focus {
  outline: none;
}

.search__btn {
  flex-shrink: 0;
  border: 0;
  background: var(--yellow);
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.search__btn:hover {
  background: var(--yellow-600);
}

.search__btn:active {
  transform: scale(0.98);
}

/* header actions */
.hactions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.haction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.haction:hover {
  background: var(--light);
  color: var(--navy);
}

.haction svg {
  width: 22px;
  height: 22px;
}

.haction__badge {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--yellow);
  color: var(--navy);
  font-size: 0.68rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid var(--white);
}

.haction__badge[hidden] {
  display: none;
}

/* category nav */
.catnav {
  border-top: 1px solid var(--line);
  background: var(--white);
}

.catnav__inner {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-block: 8px;
}

.catnav a {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.catnav a img {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.catnav a:hover,
.catnav a[aria-current="page"] {
  background: var(--light);
}

.catnav a.is-deals {
  color: var(--navy);
  background: var(--yellow-soft);
}

/* -------------------------------------------------------------------- hero */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 380px at 100% 0%, rgba(255, 201, 40, 0.18), transparent 60%),
    linear-gradient(135deg, var(--navy) 0%, #1a3860 55%, #20456f 100%);
  color: var(--white);
  border-radius: 0 0 28px 28px;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 28px;
  align-items: center;
  padding-block: clamp(28px, 4vw, 56px);
}

.hero h1 {
  color: var(--white);
  font-size: clamp(1.7rem, 1.1rem + 2.6vw, 3rem);
  margin-bottom: 0.35em;
  max-width: 18ch;
}

.hero h1 span {
  color: var(--yellow);
}

.hero p {
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.08rem);
  max-width: 46ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block: 22px 18px;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.83rem;
  color: rgba(255, 255, 255, 0.75);
}

.hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero__meta svg {
  width: 16px;
  height: 16px;
  color: var(--yellow);
}

.hero__panel {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hero__tile {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 16px;
  backdrop-filter: blur(6px);
}

.hero__tile strong {
  display: block;
  font-size: 1.5rem;
  color: var(--yellow);
  line-height: 1.1;
}

.hero__tile span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.78);
}

.hero__tile--wide {
  grid-column: 1 / -1;
}

.hero__tile--wide p {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 12px 24px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  text-align: center;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--yellow);
  color: var(--navy);
  box-shadow: 0 6px 18px rgba(255, 201, 40, 0.32);
}

.btn--primary:hover {
  background: var(--yellow-600);
  color: var(--navy);
}

.btn--dark {
  background: var(--navy);
  color: var(--white);
}

.btn--dark:hover {
  background: var(--navy-700);
  color: var(--white);
}

.btn--ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--line);
}

.btn--ghost:hover {
  border-color: var(--navy-500);
  background: var(--light);
}

.btn--block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn--sm {
  padding: 9px 16px;
  font-size: 0.88rem;
}

/* ----------------------------------------------------------------- section */
.section {
  padding-block: clamp(28px, 3.4vw, 52px);
}

.section--tight {
  padding-block: 22px;
}

.section--alt {
  background: var(--light-2);
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section__head h2 {
  margin: 0;
}

.section__head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.section__link {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
}

.section__link:hover {
  background: var(--light);
}

/* ------------------------------------------------------------ category rail */
.catrail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(148px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: inline mandatory;
}

.catrail__item {
  scroll-snap-align: start;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.catrail__item:hover {
  border-color: var(--yellow);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--navy);
}

.catrail__item img {
  width: 38px;
  height: 38px;
}

.catrail__item span {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
}

/* ------------------------------------------------------------ product card */
.grid {
  display: grid;
  gap: 16px;
}

.grid--products {
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}

.grid--tiles {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: #cfe0ee;
}

.card__media {
  position: relative;
  display: block;
  background: var(--light);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.card:hover .card__media img {
  transform: scale(1.04);
}

.card__badges {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1;
}

.badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--navy);
  color: var(--white);
  text-transform: uppercase;
}

.badge--deal {
  background: var(--yellow);
  color: var(--navy);
}
.badge--best {
  background: var(--navy);
}
.badge--trend {
  background: #1f7a5c;
}
.badge--new {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--line);
}

.card__wish {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color 0.15s ease, background 0.15s ease;
  z-index: 1;
}

.card__wish:hover {
  background: var(--white);
}

.card__wish[aria-pressed="true"] {
  color: #d33a2c;
}

.card__wish svg {
  width: 19px;
  height: 19px;
}

.card__body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
}

.card__cat {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.card__title a {
  color: inherit;
}

.card__short {
  font-size: 0.82rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
}

.price {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.price__now {
  font-size: 1.06rem;
  font-weight: 800;
  color: var(--navy);
}

.price__was {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: line-through;
}

.card__add {
  border: 0;
  background: var(--navy);
  color: var(--white);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
  flex-shrink: 0;
}

.card__add:hover {
  background: var(--navy-700);
  transform: scale(1.05);
}

.card__add svg {
  width: 18px;
  height: 18px;
}

/* ------------------------------------------------------------------ filters */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.toolbar__group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.chip {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--navy);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--navy-500);
}

.chip[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.field-inline input,
.field-inline select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font: inherit;
  font-size: 0.85rem;
  background: var(--white);
  color: var(--ink);
  width: 96px;
}

.field-inline select {
  width: auto;
  cursor: pointer;
}

.toolbar__count {
  margin-inline-start: auto;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------- category */
.page-head {
  background: var(--light-2);
  border-bottom: 1px solid var(--line);
  padding-block: 22px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbs a:hover {
  color: var(--navy);
}

.breadcrumbs span[aria-current] {
  color: var(--navy);
  font-weight: 700;
}

.page-head h1 {
  margin-bottom: 6px;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

/* ------------------------------------------------------------------ product */
.pdp {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
  padding-block: 26px;
}

.pdp__media {
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--light);
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.pdp__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.pdp__thumbs {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.pdp__thumbs button {
  width: 64px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  background: var(--light);
  cursor: pointer;
  padding: 0;
}

.pdp__thumbs button[aria-pressed="true"] {
  border-color: var(--navy);
}

.pdp__thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp h1 {
  margin-bottom: 10px;
}

.pdp__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.pdp__price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-block: 14px;
}

.pdp__price .price__now {
  font-size: 2rem;
}

.pdp__price .price__was {
  font-size: 1rem;
}

.pdp__save {
  background: var(--yellow-soft);
  color: #7a5a00;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.pdp__short {
  color: var(--muted);
  font-size: 0.98rem;
}

.pdp__buy {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-block: 20px;
  padding: 16px;
  background: var(--light-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--white);
}

.qty button {
  border: 0;
  background: transparent;
  width: 40px;
  height: 44px;
  font-size: 1.2rem;
  color: var(--navy);
  cursor: pointer;
  font-family: inherit;
}

.qty button:hover {
  background: var(--light);
}

.qty input {
  width: 48px;
  border: 0;
  text-align: center;
  font: inherit;
  font-weight: 700;
  color: var(--navy);
  background: transparent;
  -moz-appearance: textfield;
  appearance: textfield;
  height: 44px;
}

.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty input:focus {
  outline: none;
}

.pdp__facts {
  display: grid;
  gap: 8px;
  margin-block: 18px;
}

.fact {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.89rem;
  color: var(--muted);
}

.fact svg {
  width: 18px;
  height: 18px;
  color: var(--navy);
  flex-shrink: 0;
  margin-top: 2px;
}

.pdp__panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 18px;
}

.pdp__panel h3 {
  margin: 0;
  padding: 13px 16px;
  background: var(--light-2);
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.specs {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.specs th,
.specs td {
  text-align: start;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.specs tr:last-child th,
.specs tr:last-child td {
  border-bottom: 0;
}

.specs th {
  color: var(--muted);
  font-weight: 600;
  width: 45%;
  background: #fbfdff;
}

.pdp__desc {
  padding: 16px;
  font-size: 0.93rem;
  color: #2c3f57;
}

/* --------------------------------------------------------------- cart page */
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 24px;
  align-items: start;
  padding-block: 26px;
}

.cart-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}

.cart-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.cart-row:last-child {
  border-bottom: 0;
}

.cart-row__img {
  width: 92px;
  height: 70px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--light);
}

.cart-row__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-row__name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--navy);
}

.cart-row__meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.cart-row__remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}

.cart-row__remove:hover {
  color: var(--danger);
  background: #fdf2f1;
}

.cart-row__remove svg {
  width: 18px;
  height: 18px;
}

.summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--white);
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.summary h3 {
  margin-top: 0;
}

.summary__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.92rem;
  padding-block: 8px;
  color: #33475f;
}

.summary__row--total {
  border-top: 1px dashed var(--line);
  margin-top: 8px;
  padding-top: 14px;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--navy);
}

.summary__note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-block: 12px 16px;
}

.empty {
  text-align: center;
  padding: 56px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--light-2);
}

.empty svg {
  width: 56px;
  height: 56px;
  color: var(--muted);
  margin: 0 auto 14px;
}

.empty h3 {
  margin-bottom: 6px;
}

.empty p {
  color: var(--muted);
  margin-bottom: 18px;
}

/* ------------------------------------------------------------------- forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field--full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--navy);
}

.field input,
.field select,
.field textarea {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font: inherit;
  font-size: 0.92rem;
  background: var(--white);
  color: var(--ink);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy-500);
  box-shadow: 0 0 0 4px rgba(47, 84, 128, 0.10);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.field__hint {
  font-size: 0.76rem;
  color: var(--muted);
}

.field__error {
  font-size: 0.78rem;
  color: var(--danger);
  font-weight: 600;
}

.field__error:empty {
  display: none;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--white);
}

.panel + .panel {
  margin-top: 16px;
}

.panel h2,
.panel h3 {
  margin-top: 0;
}

/* ----------------------------------------------------------------- checkout */
.steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--light-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--line);
  color: var(--navy);
  font-size: 0.72rem;
  display: grid;
  place-items: center;
}

.steps li[aria-current="step"] {
  color: var(--navy);
  background: var(--yellow-soft);
  border-color: var(--yellow);
}

.steps li[aria-current="step"]::before {
  background: var(--yellow);
}

.pay-options {
  display: grid;
  gap: 10px;
}

.pay-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: not-allowed;
  background: #fcfdfe;
  opacity: 0.75;
}

.pay-option input {
  margin-top: 3px;
  accent-color: var(--navy);
}

.pay-option strong {
  display: block;
  color: var(--navy);
  font-size: 0.92rem;
}

.pay-option span {
  font-size: 0.8rem;
  color: var(--muted);
}

.pay-option--active {
  border-color: var(--yellow);
  background: #fffdf4;
  opacity: 1;
  cursor: pointer;
}

.notice {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 0.86rem;
  border: 1px solid;
}

.notice svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.notice--info {
  background: var(--light);
  border-color: #cfe0ee;
  color: #22405f;
}

.notice--warn {
  background: #fff8e8;
  border-color: #f3dca6;
  color: var(--warn);
}

.notice--ok {
  background: #eefaf4;
  border-color: #bfe8d6;
  color: var(--ok);
}

.notice--danger {
  background: #fdf2f1;
  border-color: #f4cdc9;
  color: var(--danger);
}

/* ------------------------------------------------------------------ tracking */
.timeline {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 0;
}

.timeline li {
  position: relative;
  padding-inline-start: 34px;
  padding-block: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  inset-inline-start: 7px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  background: var(--white);
  z-index: 1;
}

.timeline li::after {
  content: "";
  position: absolute;
  inset-inline-start: 12px;
  top: 32px;
  bottom: -4px;
  width: 2px;
  background: var(--line);
}

.timeline li:last-child::after {
  display: none;
}

.timeline li.is-done {
  color: var(--navy);
  font-weight: 600;
}

.timeline li.is-done::before {
  border-color: var(--yellow);
  background: var(--yellow);
}

.timeline li.is-current::before {
  border-color: var(--navy);
  background: var(--navy);
  box-shadow: 0 0 0 5px rgba(20, 45, 78, 0.12);
}

.order-head {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.status-pill {
  background: var(--yellow-soft);
  color: #7a5a00;
  border: 1px solid var(--yellow);
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 800;
}

/* ------------------------------------------------------------------ account */
.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tabs button {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: var(--muted);
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.tabs button[aria-selected="true"] {
  color: var(--navy);
  border-bottom-color: var(--yellow);
}

/* ------------------------------------------------------------------ reviews */
.reviews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.review {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.review__stars {
  color: var(--yellow);
  letter-spacing: 2px;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.review p {
  font-size: 0.9rem;
  color: #33475f;
  margin-bottom: 12px;
}

.review footer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.review__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--light);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
}

/* --------------------------------------------------------------- newsletter */
.newsletter {
  background: linear-gradient(120deg, var(--navy), #21456e);
  color: var(--white);
  border-radius: 24px;
  padding: clamp(22px, 3vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
  gap: 22px;
  align-items: center;
}

.newsletter h2 {
  color: var(--white);
  margin-bottom: 6px;
}

.newsletter p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  font-size: 0.92rem;
}

.newsletter form {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-pill);
  padding: 5px;
}

.newsletter input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  padding: 10px 14px;
}

.newsletter input::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.newsletter input:focus {
  outline: none;
}

.newsletter .btn {
  white-space: nowrap;
}

.newsletter__msg {
  grid-column: 1 / -1;
  font-size: 0.84rem;
  color: var(--yellow);
  min-height: 1.2em;
}

/* ------------------------------------------------------------------- footer */
.footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.78);
  margin-top: 40px;
  padding-block: 40px 0;
  font-size: 0.88rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 28px;
  padding-bottom: 28px;
}

.footer h3 {
  color: var(--white);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.footer a {
  color: rgba(255, 255, 255, 0.78);
  display: inline-block;
  padding-block: 4px;
}

.footer a:hover {
  color: var(--yellow);
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer__brand img {
  height: 42px;
  margin-bottom: 12px;
}

.footer__brand p {
  max-width: 34ch;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.footer__pay {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.footer__pay span {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.72);
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.62);
}

/* -------------------------------------------------------------------- toast */
.toast-stack {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-end: 20px;
  z-index: 300;
  display: grid;
  gap: 10px;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toast-in 0.22s ease;
}

.toast--ok {
  background: #14624a;
}

.toast--err {
  background: #8f2b22;
}

.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------ demo banner */
.demo-note {
  background: #fff8e8;
  border-bottom: 1px solid #f3dca6;
  color: var(--warn);
  font-size: 0.79rem;
  text-align: center;
  padding: 7px 14px;
}

.demo-note strong {
  font-weight: 800;
}

/* ---------------------------------------------------------------- utilities */
.stack {
  display: grid;
  gap: 16px;
}
.stack--sm {
  gap: 8px;
}
.stack--lg {
  gap: 26px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row--between {
  justify-content: space-between;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.82rem;
}
.mt-0 {
  margin-top: 0;
}
.mb-0 {
  margin-bottom: 0;
}
.mb-1 {
  margin-bottom: 8px;
}
.mb-2 {
  margin-bottom: 16px;
}
.text-center {
  text-align: center;
}
.prose h2 {
  margin-top: 1.6em;
}
.prose h3 {
  margin-top: 1.2em;
}
.prose ul {
  padding-inline-start: 22px;
  color: #33475f;
}
.prose li {
  margin-bottom: 6px;
}
.prose p {
  color: #33475f;
}
.hidden {
  display: none !important;
}

/* spacing + layout utilities (kept in CSS so CSP can stay strict, no inline styles) */
.page-top {
  padding-top: 22px;
}
.mt-1 {
  margin-top: 8px;
}
.mt-2 {
  margin-top: 16px;
}
.mt-3 {
  margin-top: 24px;
}
.mb-3 {
  margin-bottom: 24px;
}
.row--center {
  justify-content: center;
  padding-block: 26px;
}
.stack-gap {
  display: grid;
  gap: 16px;
}
.notice--center {
  justify-content: center;
}
.notice--mt {
  margin-block: 14px 0;
}

/* ------------------------------------------------------------- admin (4A) */
.admin-shell {
  padding-block: 26px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--white);
}
.stat strong {
  display: block;
  font-size: 1.6rem;
  color: var(--navy);
  line-height: 1.1;
}
.stat span {
  font-size: 0.8rem;
  color: var(--muted);
}
.status-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid;
}
.status-chip--draft {
  background: #f4f6f9;
  border-color: #cdd8e3;
  color: #52698a;
}
.status-chip--pending_verification {
  background: #fff8e8;
  border-color: #f3dca6;
  color: #8a6100;
}
.status-chip--ready {
  background: #eefaf4;
  border-color: #bfe8d6;
  color: #0f6b4e;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: start;
  vertical-align: top;
}
.admin-table th {
  background: var(--light-2);
  color: var(--navy);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.admin-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--light);
}
.recovery-codes {
  background: var(--light-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  line-height: 1.9;
  white-space: pre-wrap;
  columns: 2;
  column-gap: 24px;
}
.admin-login-card {
  margin-inline: auto;
  margin-top: 8vh;
}
.admin-list {
  margin: 0;
  padding-inline-start: 16px;
}
.admin-blockers {
  max-width: 280px;
}
.license-flag {
  font-size: 0.72rem;
  color: var(--warn);
  font-weight: 700;
}
.notice--spaced {
  margin-block: 16px;
}
.btn--onDark {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.3);
}
.btn--onDark:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.5);
}
.thumb-contain {
  object-fit: contain;
  padding: 6px;
}


.prose--narrow {
  max-width: 78ch;
}
.panel--narrow {
  max-width: 720px;
}
.panel--narrow-sm {
  max-width: 520px;
}
.panel--success {
  max-width: 620px;
  margin-inline: auto;
}
.empty--narrow {
  max-width: 560px;
  margin-inline: auto;
}
.order-number {
  font-size: 1.5rem;
}
.field--grow {
  flex: 1 1 260px;
}
.btn--bottom {
  align-self: flex-end;
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 1024px) {
  .header__main {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "brand actions"
      "search search";
    gap: 10px 12px;
  }
  .brand {
    grid-area: brand;
  }
  .hactions {
    grid-area: actions;
    justify-self: end;
  }
  .search {
    grid-area: search;
  }
  .hero__inner {
    grid-template-columns: 1fr;
  }
  .hero__panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hero__tile--wide {
    grid-column: auto;
  }
  .hero__tile--wide p {
    display: none;
  }
  .pdp {
    grid-template-columns: 1fr;
  }
  .pdp__media {
    position: static;
  }
  .cart-layout {
    grid-template-columns: 1fr;
  }
  .summary {
    position: static;
  }
  .footer__grid {
    grid-template-columns: 1.4fr 1fr;
  }
  .newsletter {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
  }
  .topbar__links {
    gap: 10px;
  }
  .topbar__promo {
    font-size: 0.74rem;
  }
  .brand img {
    height: 36px;
  }
  .header__main {
    padding-block: 10px;
  }
  .haction span {
    display: none;
  }
  .haction {
    padding: 9px;
  }
  .grid--products {
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 12px;
  }
  .card__body {
    padding: 11px;
  }
  .card__title {
    font-size: 0.88rem;
  }
  .card__short {
    display: none;
  }
  .hero__panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .section__head {
    align-items: flex-start;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .cart-row {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    grid-template-areas:
      "img info remove"
      "img qty total";
  }
  .cart-row__img {
    grid-area: img;
    width: 72px;
    height: 58px;
  }
  .cart-row__info {
    grid-area: info;
  }
  .cart-row__qty {
    grid-area: qty;
  }
  .cart-row__total {
    grid-area: total;
    justify-self: end;
  }
  .cart-row__remove {
    grid-area: remove;
  }
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .newsletter form {
    flex-direction: column;
    border-radius: var(--radius);
  }
  .newsletter .btn {
    width: 100%;
  }
  .toast-stack {
    inset-inline: 14px;
    max-width: none;
  }
  .pdp__price .price__now {
    font-size: 1.6rem;
  }
  .pdp__media img {
    max-height: 300px;
  }
}

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

/* Arabic typography tweaks */
html[lang="ar"] body {
  line-height: 1.75;
}

html[lang="ar"] .hero h1 {
  letter-spacing: 0;
}

html[lang="ar"] .badge {
  letter-spacing: 0;
  text-transform: none;
}
