:root {
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

:root[lang="ar"] {
  font-family: Tajawal, Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

[lang="ar"] .language[lang="en"] { font-family: Roboto, sans-serif; }
[lang="en"] .language[lang="ar"] { font-family: Tajawal, sans-serif; }

.theme-toggle {
  width: 44px;
  min-width: 44px;
  padding-inline: 0;
  color: var(--text);
}

.theme-icon { flex: none; }
.theme-moon {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  box-shadow: -4px 3px 0 0 currentColor;
  transform: translate(2px, -2px);
}

.theme-sun { display: none; font-size: 1.35rem; line-height: 1; }
[data-theme="light"] .theme-moon { display: none; }
[data-theme="light"] .theme-sun { display: inline; }

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f5fc;
  --panel: #ffffff;
  --line: #cec8de;
  --text: #201832;
  --muted: #5f5576;
  --accent: #6338ad;
  --ink: #ffffff;
  --surface-soft: #f0ebfa;
  --surface-hover: #e8def7;
  --strong-border: #a995c7;
}

[data-theme="light"] :focus-visible { outline-color: #6540ab; }
[data-theme="light"] .header {
  background: #faf8fff5;
  border-color: var(--line);
}

[data-theme="light"] .search,
[data-theme="light"] .filters select,
[data-theme="light"] .field input,
[data-theme="light"] .field select { background: var(--panel); }

[data-theme="light"] .search input::placeholder { color: var(--muted); }
[data-theme="light"] .icon-search { border-color: var(--muted); }
[data-theme="light"] .icon-search::after { background: var(--muted); }
[data-theme="light"] .select-wrap::after { border-color: var(--muted); }

[data-theme="light"] .control,
[data-theme="light"] .secondary {
  background: var(--surface-soft);
  color: var(--text);
}

[data-theme="light"] .control:hover,
[data-theme="light"] .secondary:hover,
[data-theme="light"] .platform-button:hover,
[data-theme="light"] .platform-button.is-selected {
  background: var(--surface-hover);
}

[data-theme="light"] .cart-button,
[data-theme="light"] .product-cta { border-color: var(--strong-border); }
[data-theme="light"] .product-cta { color: #4f298e; }
[data-theme="light"] .primary:hover { background: #4f2c90; }
[data-theme="light"] .main-links a:hover,
[data-theme="light"] .text-action:hover,
[data-theme="light"] .footer-links button:hover { color: #4c228e; }

[data-theme="light"] .hero { color: #f7f5ff; }
[data-theme="light"] .hero .primary { background: #bfaaff; color: #151022; }
[data-theme="light"] .hero .primary:hover { background: #d5c6ff; }
[data-theme="light"] .hero :focus-visible { outline-color: #d8c9ff; }

[data-theme="light"] .offer-picker button { background: var(--panel); }
[data-theme="light"] .offer-picker button[aria-pressed="true"],
[data-theme="light"] .tabs button[aria-pressed="true"],
[data-theme="light"] #discount-filter[aria-pressed="true"] {
  border-color: var(--strong-border);
  background: var(--surface-hover);
  color: #4f298e;
}

[data-theme="light"] .footer,
[data-theme="light"] .mobile-nav { background: #faf8fff5; }
[data-theme="light"] .mobile-nav a,
[data-theme="light"] .mobile-nav button { color: var(--text); }

[data-theme="light"] dialog,
[data-theme="light"] .toast {
  background: var(--panel);
  color: var(--text);
  border-color: var(--strong-border);
}

[data-theme="light"] dialog::backdrop { background: #201731a3; }
[data-theme="light"] .close:hover,
[data-theme="light"] .demo-note { background: var(--surface-soft); }
[data-theme="light"] .demo-note { color: #4f298e !important; }

@media (max-width: 700px) {
  .header-inner {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    grid-template-areas: "brand brand language theme cart" "market search search search search";
  }
  .header .brand { grid-area: brand; justify-self: start; }
  .header-actions { display: contents; }
  .header .market { grid-area: market; }
  .header .language { grid-area: language; }
  .theme-toggle { grid-area: theme; }
  .cart-button { grid-area: cart; }
  .search { grid-area: search; min-width: 0; }
}

.store-announcement { padding: 11px 14px; margin: 14px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); }

.footer-links [data-account-link] { color:var(--muted); font-size:.88rem; display:inline-flex; align-items:center; }
