/* ستايلي — ستايل مستوحى من شي إن / تيمو / ترينديول */
@font-face {
  font-family: "Cairo";
  src: url("../fonts/Cairo-Variable.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --orange: #f27a1a;
  --orange-dark: #d9620a;
  --orange-soft: #fff1e6;
  --sale: #e62e04;
  --sale-bg: #ffe8e2;
  --black: #1a1a1a;
  --text: #222;
  --muted: #757575;
  --line: #ededed;
  --bg: #f4f4f4;
  --card: #fff;
  --green: #0a8f4c;
  --radius: 10px;
  --header-h: 56px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  --max: 1280px;
  --nav-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: "Cairo", Tahoma, "Noto Sans Arabic", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
  min-height: 100%;
}
html[data-i18n-pending] body { visibility: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
ul, ol { list-style: none; }
.container { width: min(100% - 16px, var(--max)); margin-inline: auto; }
@media (min-width: 768px) {
  .container { width: min(100% - 32px, var(--max)); }
}

/* Sample / demo strip */
.sample-bar {
  background: #111;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  padding: 6px 12px;
  letter-spacing: 0.01em;
}
.sample-bar span { opacity: 0.85; }

/* Promo top */
.promo-top {
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 6px 12px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: #fff;
  box-shadow: 0 1px 0 var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
  width: min(100% - 16px, var(--max));
  margin-inline: auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo img { width: 32px; height: 32px; }
.logo-name {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: var(--black);
  line-height: 1;
  white-space: nowrap;
}
.logo-name em {
  font-style: normal;
  color: var(--orange);
}
.search-form {
  flex: 1;
  display: none;
  position: relative;
}
.search-form input {
  width: 100%;
  height: 40px;
  border: 0;
  background: var(--bg);
  border-radius: 999px;
  padding-block: 0;
  padding-inline-start: 44px;
  padding-inline-end: 16px;
  outline: none;
}
.search-form input:focus { box-shadow: 0 0 0 2px var(--orange); background: #fff; }
.search-form button {
  position: absolute;
  inset-inline-start: 4px;
  top: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: grid;
  place-items: center;
}
.header-actions { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  color: var(--black);
}
.icon-btn:hover { background: var(--bg); }
.lang-toggle {
  height: 32px;
  min-width: 44px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--black);
  background: #fff;
  line-height: 1;
}
.lang-toggle:hover { background: var(--bg); border-color: #ccc; }
html[dir="ltr"] .logo-name { font-size: 18px; letter-spacing: -0.02em; }
@media (min-width: 900px) {
  html[dir="ltr"] .logo-name { font-size: 20px; }
}
.cart-badge {
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--sale);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: none;
  place-items: center;
  line-height: 1;
}
.cart-badge.show { display: grid; }
.nav-desk { display: none; gap: 18px; font-weight: 700; font-size: 14px; }
.nav-desk a { padding: 8px 0; color: var(--text); }
.nav-desk a:hover, .nav-desk a.active { color: var(--orange); }

.search-mobile {
  display: block;
  padding: 0 8px 10px;
  background: #fff;
  position: sticky;
  top: var(--header-h);
  z-index: 70;
  box-shadow: 0 1px 0 var(--line);
}
.search-mobile .search-form { display: flex; width: min(100% - 0px, var(--max)); margin-inline: auto; }

@media (min-width: 900px) {
  .search-form { display: block; flex: 1; max-width: none; margin-inline: 24px; }
  .search-mobile { display: none; }
  .nav-desk { display: flex; }
  .logo-name { font-size: 24px; }
}

/* Category chips */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.chip.active, .chip:hover {
  background: var(--black);
  color: #fff;
  border-color: var(--black);
}

/* Banners */
.hero { padding-top: 12px; }
.carousel {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #ddd;
  aspect-ratio: 16 / 7;
}
@media (min-width: 768px) { .carousel { aspect-ratio: 1200 / 300; } }
@media (min-width: 1100px) { .carousel { aspect-ratio: 1200 / 280; } }
.carousel-track { display: flex; height: 100%; transition: transform 0.4s ease; }
.carousel-track a, .carousel-track img { width: 100%; height: 100%; flex-shrink: 0; object-fit: cover; }
.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.carousel-dots button {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.5);
}
.carousel-dots button.active { background: #fff; width: 18px; border-radius: 8px; }

/* Section headings */
.section { padding: 16px 0 8px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.section-head h2 { font-size: 18px; font-weight: 800; }
.section-head a { color: var(--orange); font-weight: 700; font-size: 13px; }
.flash-head {
  background: linear-gradient(90deg, #ff3b30, #f27a1a);
  color: #fff;
  border-radius: 12px 12px 0 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flash-head h2 { font-size: 16px; }
.flash-head a { color: #fff; }
.countdown { display: flex; gap: 4px; font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; }
.countdown i {
  background: #111;
  color: #fff;
  border-radius: 4px;
  min-width: 24px;
  padding: 2px 4px;
  text-align: center;
  font-style: normal;
  font-size: 13px;
}
.flash-wrap {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.flash-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px;
  scrollbar-width: none;
}
.flash-row::-webkit-scrollbar { display: none; }
.flash-row .product-card { flex: 0 0 148px; box-shadow: none; border: 1px solid var(--line); }

/* Category tiles */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (min-width: 768px) {
  .cat-grid { grid-template-columns: repeat(6, 1fr); gap: 12px; }
}
.cat-tile {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  box-shadow: var(--shadow);
}
.cat-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.cat-tile span { display: block; font-weight: 800; font-size: 13px; padding: 6px 4px 10px; }

/* Product grid — dense like Shein/Temu */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 700px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
}
@media (min-width: 1100px) {
  .product-grid { grid-template-columns: repeat(5, 1fr); }
}
.product-card {
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.product-card .thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #ececec;
  overflow: hidden;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge-disc {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  background: var(--sale);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 4px;
  padding: 2px 6px;
  z-index: 1;
}
.badge-disc > [dir="ltr"] { unicode-bidi: isolate; }

.badge-tag {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  background: var(--black);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 6px;
  z-index: 1;
}
.badge-tag.flash { background: var(--orange); }
.badge-sample {
  position: absolute;
  bottom: 8px;
  inset-inline-start: 8px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 6px;
}
.card-body { padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  height: 2.7em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-rating { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.card-rating .stars { color: #f5a623; letter-spacing: -1px; }
.price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.price {
  color: var(--sale);
  font-weight: 800;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.price small { font-size: 11px; font-weight: 700; margin-inline-start: 2px; }
.old-price {
  color: var(--muted);
  font-size: 12px;
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

/* Shop toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 8px;
}
.toolbar h1 { font-size: 18px; }
.toolbar select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 160px;
}
.results-count { color: var(--muted); font-size: 13px; }

/* Product detail */
.pdp { padding: 12px 0 96px; }
.pdp-wrap {
  display: grid;
  gap: 16px;
}
@media (min-width: 900px) {
  .pdp-wrap { grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: start; }
  .pdp { padding-bottom: 40px; }
}
.gallery { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.gallery-main {
  width: 100%;
  height: 32vh;
  background: #eee;
}
@media (min-width: 900px) {
  .gallery-main { height: min(68vh, 640px); }
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 899px) {
  .gallery-main { background: #f3eee6; }
  .gallery-main img { object-fit: contain; }
}
.gallery-thumbs { display: flex; gap: 8px; padding: 8px; overflow-x: auto; }
.gallery-thumbs button {
  width: 52px; height: 64px; border-radius: 8px; overflow: hidden;
  border: 2px solid transparent; flex-shrink: 0; padding: 0;
}
@media (min-width: 900px) {
  .gallery-thumbs button { width: 64px; height: 80px; }
}
.gallery-thumbs button.active { border-color: var(--orange); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pdp-info { background: #fff; border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.pdp-info h1 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.pdp-sample {
  display: inline-block;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 800;
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 8px;
}
.pdp-price { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 4px; }
.pdp-price .price { font-size: 28px; }
.pdp-price .badge-disc { position: static; }
.option-label { font-weight: 800; margin: 14px 0 8px; font-size: 13px; }
.swatches, .sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #ccc;
}
.swatch.active { box-shadow: 0 0 0 2px var(--orange); }
.size-btn {
  min-width: 48px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
}
.size-btn.active { border-color: var(--orange); color: var(--orange); background: var(--orange-soft); }
.qty-row { display: flex; align-items: center; gap: 12px; }
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  direction: ltr;
}
.qty button { width: 36px; height: 36px; font-size: 18px; font-weight: 700; }
.qty span { min-width: 32px; text-align: center; font-weight: 800; }
.add-btn, .btn-primary {
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  border-radius: 10px;
  height: 48px;
  padding: 0 22px;
  width: 100%;
  font-size: 16px;
}
.add-btn:hover, .btn-primary:hover { background: var(--orange-dark); }
.add-btn:disabled, .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  height: 48px;
  padding: 0 22px;
  font-weight: 800;
  width: 100%;
}
.pdp-desc { color: #444; margin-top: 16px; font-size: 14px; }
.sticky-atc {
  position: fixed;
  bottom: var(--nav-h);
  left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 60;
}
.sticky-atc .price { font-size: 20px; }
.sticky-atc .add-btn { width: auto; flex: 1; }
@media (min-width: 900px) {
  .sticky-atc { display: none; }
}

/* Cart */
.cart-page, .checkout-page, .plain-page { padding: 16px 0 96px; }
.cart-layout, .check-layout {
  display: grid;
  gap: 16px;
}
@media (min-width: 900px) {
  .cart-layout, .check-layout { grid-template-columns: 1fr 340px; align-items: start; }
}
.cart-list, .summary-card, .form-card, .plain-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px;
}
.cart-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item:last-child { border-bottom: 0; }
.cart-item img { width: 88px; height: 110px; object-fit: cover; border-radius: 8px; background: #eee; }
.cart-item h3 { font-size: 14px; }
.cart-meta { color: var(--muted); font-size: 12px; margin: 2px 0 6px; }
.cart-item-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.remove-btn { color: var(--sale); font-size: 12px; font-weight: 700; }
.empty {
  text-align: center;
  padding: 48px 16px;
  background: #fff;
  border-radius: 12px;
}
.empty h2 { margin: 8px 0; }
.empty p { color: var(--muted); margin-bottom: 16px; }
.summary-card { position: sticky; top: 80px; }
.summary-card h2 { font-size: 16px; margin-bottom: 12px; }
.summary-row, .sum-line {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  font-size: 14px;
}
.summary-row.total { font-size: 18px; font-weight: 800; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; }
.summary-row.total span:last-child { color: var(--sale); }
.hint { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* Checkout */
.test-banner {
  background: #fff6e5;
  border: 1px solid #f5c16c;
  color: #7a4b00;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 13px;
}
.form-grid { display: grid; gap: 10px; }
.form-grid label { display: grid; gap: 4px; font-weight: 700; font-size: 13px; }
.form-grid input, .form-grid select, .form-grid textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fafafa;
  width: 100%;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
  outline: none;
  border-color: var(--orange);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(242, 122, 26, 0.15);
}
.form-error { color: var(--sale); font-size: 12px; font-weight: 600; display: none; }
.form-grid label.invalid input,
.form-grid label.invalid select,
.form-grid label.invalid textarea { border-color: var(--sale); }
.form-grid label.invalid .form-error { display: block; }
.confirm-box { text-align: center; padding: 32px 16px; }
.confirm-box h1 { font-size: 22px; margin: 8px 0; }
.confirm-box .order-no { font-size: 28px; font-weight: 800; color: var(--orange); direction: ltr; }
.confirm-box p { color: #444; margin: 8px 0 16px; }

/* About / contact */
.plain-page h1 { font-size: 24px; margin-bottom: 12px; }
.plain-card p { margin: 0 0 12px; }
.contact-list { display: grid; gap: 8px; margin: 16px 0; }
.contact-list li { background: var(--bg); border-radius: 8px; padding: 10px 12px; }

/* Footer */
.site-footer {
  background: #1a1a1a;
  color: #ddd;
  padding: 28px 0 90px;
  margin-top: 24px;
  font-size: 13px;
}
@media (min-width: 900px) { .site-footer { padding-bottom: 32px; } }
.foot-grid {
  display: grid;
  gap: 20px;
}
@media (min-width: 700px) { .foot-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer h3 { color: #fff; margin-bottom: 8px; font-size: 15px; }
.site-footer a { color: #ccc; display: inline-block; padding: 3px 0; }
.site-footer a:hover { color: var(--orange); }
.foot-copy { opacity: 0.6; margin-top: 20px; border-top: 1px solid #333; padding-top: 12px; font-size: 12px; text-align: start; }

/* Mobile bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 75;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  color: #666;
  position: relative;
}
.bottom-nav a.active, .bottom-nav a:hover { color: var(--orange); }
.bottom-nav svg { width: 22px; height: 22px; }
.bottom-nav .cart-badge { top: 4px; inset-inline-start: 50%; margin-inline-start: 6px; }
@media (min-width: 900px) { .bottom-nav { display: none; } }

/* Toast */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--black);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 100;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* Utilities */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.page-pad { padding-bottom: 24px; }

body[data-page="cart"] .promo-top,
body[data-page="checkout"] .promo-top,
body[data-page="product"] .promo-top,
body[data-page="cart"] .search-mobile,
body[data-page="checkout"] .search-mobile {
  display: none;
}

/* HTML promo banners — text wraps on small screens */
.banner-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 20px 20px 36px;
  color: #fff;
  text-decoration: none;
}
.banner-slide h2 {
  font-size: clamp(22px, 6vw, 48px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 6px;
}
.banner-slide p {
  font-size: clamp(13px, 3.2vw, 20px);
  opacity: 0.92;
  margin-bottom: 14px;
  max-width: 28em;
}
.banner-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--orange);
  font-weight: 800;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
}
.banner-slide.theme-orange { background: linear-gradient(120deg, #f27a1a, #c23b0a); }
.banner-slide.theme-orange .banner-cta { color: #c23b0a; }
.banner-slide.theme-dark { background: linear-gradient(120deg, #1a1a1a, #3a2a1a); }
.banner-slide.theme-dark .banner-cta { color: #1a1a1a; }
.banner-slide.theme-green { background: linear-gradient(120deg, #3e5a40, #2a3a2c); }
.banner-slide.theme-green .banner-cta { color: #2a3a2c; }

@media (min-width: 700px) {
  .banner-slide { padding: 36px 48px 48px; }
}

/* Checkout sticky note already visible; keep form usable above bottom nav */
@media (max-width: 899px) {
  .checkout-page .check-layout { padding-bottom: 8px; }
}

.payment-options { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px; }
.pay-opt { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 10px 12px; cursor: pointer; font-weight: 600; }
.pay-opt input { accent-color: #F27A1A; }
