/* SOUQLY | سوقلي — design system (RTL, navy/orange, mobile-first) */
:root {
  --navy: #0f2a4a; --navy-2: #163a63; --navy-3: #0a1f38;
  --orange: #ff6b1a; --orange-2: #e65a0d;
  --bg: #f6f7f9; --card: #ffffff; --text: #20242b; --muted: #6b7280;
  --line: #e5e7eb; --success: #0e9f6e; --danger: #dc2626; --warning: #d97706;
  --radius: 14px; --shadow: 0 1px 3px rgba(15,42,74,.08), 0 4px 14px rgba(15,42,74,.06);
  --shadow-lg: 0 8px 30px rgba(15,42,74,.16);
}
[data-theme="dark"] {
  --bg: #0d1522; --card: #152238; --text: #eef1f6; --muted: #9aa4b5;
  --line: #24344e; --shadow: 0 1px 3px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.45);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Cairo', 'Noto Sans Arabic', Tahoma, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
.container { width: min(1200px, 100% - 24px); margin-inline: auto; }
main.container { padding-bottom: 96px; /* keep page end clear of the fixed WhatsApp button */ }

/* announcement bar */
.announce { background: var(--navy-3); color: #fff; text-align: center; font-size: .85rem; padding: 7px 12px; }

/* header */
.header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 60; box-shadow: var(--shadow); }
.header-main { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.logo { font-size: 1.7rem; font-weight: 800; color: var(--navy); display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
[data-theme="dark"] .logo { color: #fff; }
.logo span { color: var(--orange); }
.logo .cart-emoji { background: var(--orange); color: #fff; border-radius: 10px; padding: 4px 7px; display: inline-flex; align-items: center; }
.icon-btn svg { vertical-align: middle; }
.p-fav svg { vertical-align: middle; }
.search-box { position: relative; flex: 1; }
.search-box input {
  width: 100%; border: 2px solid var(--line); border-radius: 999px; padding: 10px 44px 10px 16px;
  background: var(--bg); outline: none; transition: border-color .2s;
}
.search-box input:focus { border-color: var(--orange); }
.search-box .s-btn { position: absolute; inset-inline-start: 6px; top: 50%; transform: translateY(-50%); background: var(--orange); color: #fff; border: none; border-radius: 999px; width: 34px; height: 34px; cursor: pointer; }
.suggestions { position: absolute; top: calc(100% + 6px); inset-inline: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 70; display: none; }
.suggestions.open { display: block; }
.suggestions a { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.suggestions a:last-child { border-bottom: none; }
.suggestions a:hover { background: var(--bg); }
.suggestions img { width: 38px; height: 38px; object-fit: cover; border-radius: 8px; }
.suggestions .sp { color: var(--orange); font-weight: 700; margin-inline-start: auto; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.icon-btn { position: relative; background: none; border: none; cursor: pointer; font-size: 1.35rem; padding: 6px 10px; border-radius: 10px; transition: background .2s; }
.icon-btn:hover { background: var(--bg); }
.badge { position: absolute; top: 0; inset-inline-end: 2px; background: var(--orange); color: #fff; font-size: .68rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.nav { background: var(--navy); }
.nav-scroll { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.nav-scroll::-webkit-scrollbar { display: none; }
.nav a { color: #dbe4f0; white-space: nowrap; padding: 10px 14px; font-size: .92rem; border-radius: 8px; transition: background .2s, color .2s; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.12); color: #fff; }

/* hero */
.hero { margin: 22px 0; }
.hero-banner {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, #1c4a7c 100%);
  border-radius: 20px; color: #fff; padding: 48px 36px; position: relative; overflow: hidden;
}
.hero-banner::after { content: '🛒'; position: absolute; inset-inline-end: 5%; bottom: -30px; font-size: 9rem; opacity: .14; }
.hero-banner h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 800; margin-bottom: 10px; }
.hero-banner p { font-size: 1.05rem; opacity: .9; margin-bottom: 20px; max-width: 560px; }
.countdown { display: flex; gap: 10px; margin: 16px 0; }
.countdown[hidden] { display: none; }
.countdown .cd { background: rgba(255,255,255,.12); border-radius: 10px; padding: 8px 14px; text-align: center; min-width: 64px; }
.countdown .cd b { display: block; font-size: 1.3rem; }
.countdown .cd small { opacity: .75; font-size: .72rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer;
  border-radius: 12px; padding: 12px 26px; font-weight: 700; font-size: .98rem; transition: transform .15s, box-shadow .2s, background .2s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-2); box-shadow: 0 6px 18px rgba(255,107,26,.35); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-outline { background: transparent; border: 2px solid var(--navy); color: var(--navy); }
[data-theme="dark"] .btn-outline { border-color: #fff; color: #fff; }
.btn-ghost { background: var(--bg); }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1eb856; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 7px 14px; font-size: .85rem; border-radius: 9px; }

/* sections */
.section { margin: 34px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: 1.35rem; font-weight: 800; color: var(--navy); display: flex; align-items: center; gap: 8px; }
[data-theme="dark"] .section-head h2 { color: #fff; }
.section-head h2::before { content: ''; width: 5px; height: 24px; background: var(--orange); border-radius: 4px; }
.section-head a { color: var(--orange); font-weight: 700; font-size: .9rem; }

/* category chips */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 12px; }
@media (max-width: 480px) { .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; } }
.cat-card { background: var(--card); border-radius: var(--radius); padding: 16px 8px; text-align: center; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat-card .ci { font-size: 1.9rem; }
.cat-card .cn { font-size: .85rem; font-weight: 700; margin-top: 6px; }

/* product cards */
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
@media (max-width: 480px) { .p-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
@media (min-width: 768px) { .p-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }
.p-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }
.p-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.p-card .p-img { aspect-ratio: 1; object-fit: cover; width: 100%; background: var(--bg); }
.p-card .p-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.p-card .p-name { font-size: .92rem; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.p-card .p-cat { font-size: .75rem; color: var(--muted); }
.p-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.p-price .now { color: var(--orange); font-weight: 800; font-size: 1.08rem; }
.p-price .was { color: var(--muted); text-decoration: line-through; font-size: .82rem; }
.p-off { position: absolute; top: 10px; inset-inline-start: 10px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; z-index: 2; }
.p-fav { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 2; background: var(--card); border: none; border-radius: 999px; width: 34px; height: 34px; cursor: pointer; box-shadow: var(--shadow); }
.p-stars { color: #f5a623; font-size: .8rem; }
.p-stars .rc { color: var(--muted); font-size: .72rem; }
.p-card .btn { margin-top: auto; }

/* trust */
.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.trust .t { background: var(--card); border-radius: var(--radius); padding: 20px 12px; text-align: center; box-shadow: var(--shadow); }
.trust .t .ti { font-size: 2rem; }
.trust .t b { display: block; margin-top: 6px; color: var(--navy); }
[data-theme="dark"] .trust .t b { color: #fff; }
.trust .t small { color: var(--muted); }

/* promo strip */
.promo-strip { background: linear-gradient(90deg, var(--orange), #ff8a3d); border-radius: 16px; color: #fff; padding: 22px 26px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* newsletter */
.newsletter { background: var(--navy); border-radius: 18px; color: #fff; padding: 34px 24px; text-align: center; }
.newsletter form { display: flex; gap: 8px; max-width: 460px; margin: 16px auto 0; }
.newsletter input { flex: 1; border: none; border-radius: 12px; padding: 12px 16px; outline: none; }

/* footer */
.footer { background: var(--navy-3); color: #c9d4e2; margin-top: 50px; padding: 40px 0 20px; }
.footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 26px; }
.footer h4 { color: #fff; margin-bottom: 12px; font-size: 1rem; }
.footer a { display: block; padding: 4px 0; font-size: .88rem; transition: color .2s; }
.footer a:hover { color: var(--orange); }
.footer .bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 26px; padding-top: 16px; text-align: center; font-size: .82rem; }

/* floating whatsapp */
.wa-float { position: fixed; bottom: 18px; inset-inline-start: 18px; z-index: 80; background: #25d366; color: #fff; width: 54px; height: 54px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; box-shadow: 0 6px 20px rgba(37,211,102,.45); transition: transform .2s; }
.wa-float:hover { transform: scale(1.08); }

/* forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 11px 14px; background: var(--card); outline: none; transition: border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--orange); }
.field .err { color: var(--danger); font-size: .8rem; margin-top: 4px; min-height: 1.2em; }
.form-card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 24px; }

/* alerts / toast */
.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; font-size: .92rem; }
.alert-ok { background: #e7f6ef; color: #0b6b4a; }
.alert-err { background: #fdecec; color: #b91c1c; }
[data-theme="dark"] .alert-ok { background: #123324; color: #7be0b6; }
[data-theme="dark"] .alert-err { background: #3a1518; color: #ff9d9d; }
#toast { position: fixed; bottom: 84px; inset-inline-start: 50%; transform: translateX(50%); background: var(--navy); color: #fff; padding: 12px 22px; border-radius: 999px; box-shadow: var(--shadow-lg); z-index: 100; opacity: 0; pointer-events: none; transition: opacity .25s, bottom .25s; font-size: .92rem; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; bottom: 96px; }

/* states */
.empty { text-align: center; padding: 60px 16px; color: var(--muted); }
.empty .ei { font-size: 3rem; }
.skeleton { background: linear-gradient(90deg, var(--line) 25%, var(--bg) 50%, var(--line) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); min-height: 220px; }
@keyframes sk { to { background-position: -200% 0; } }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* product page */
.pd { display: grid; grid-template-columns: 1fr; gap: 26px; margin: 24px 0; }
@media (min-width: 860px) { .pd { grid-template-columns: 1fr 1fr; } }
.pd .gallery .main-img { border-radius: 18px; aspect-ratio: 1; object-fit: cover; width: 100%; box-shadow: var(--shadow); background: var(--card); }
.pd .thumbs { display: flex; gap: 8px; margin-top: 10px; }
.pd .thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 2px solid transparent; cursor: pointer; }
.pd .thumbs img.sel { border-color: var(--orange); }
.pd h1 { font-size: 1.4rem; color: var(--navy); }
[data-theme="dark"] .pd h1 { color: #fff; }
.opt-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.opt-pills button { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 16px; cursor: pointer; }
.opt-pills button.sel { border-color: var(--orange); color: var(--orange); font-weight: 700; }
.qty { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.qty button { width: 40px; height: 42px; border: none; background: var(--bg); cursor: pointer; font-size: 1.2rem; }
.qty input { width: 52px; text-align: center; border: none; background: var(--card); outline: none; }
.stock-ok { color: var(--success); font-weight: 700; }
.stock-low { color: var(--warning); font-weight: 700; }
.stock-out { color: var(--danger); font-weight: 700; }

/* cart */
.cart-row { display: grid; grid-template-columns: 74px 1fr auto; gap: 12px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); margin-bottom: 10px; }
.cart-row img { width: 74px; height: 74px; object-fit: cover; border-radius: 10px; }
.summary { background: var(--card); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); position: sticky; top: 90px; }
.summary .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .95rem; }
.summary .row.total { border-top: 2px dashed var(--line); margin-top: 8px; padding-top: 12px; font-weight: 800; font-size: 1.15rem; color: var(--navy); }
[data-theme="dark"] .summary .row.total { color: #fff; }

/* status chips */
.chip { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.chip-new { background: #e0ecff; color: #1d4ed8; }
.chip-confirmed { background: #e0f2fe; color: #0369a1; }
.chip-preparing { background: #fef3c7; color: #b45309; }
.chip-shipped { background: #ede9fe; color: #6d28d9; }
.chip-delivered { background: #dcfce7; color: #15803d; }
.chip-cancelled { background: #fee2e2; color: #b91c1c; }

/* tracking timeline */
.timeline { display: flex; flex-direction: column; gap: 0; margin: 20px 0; }
.tl-step { display: flex; gap: 14px; align-items: flex-start; }
.tl-dot { width: 30px; height: 30px; border-radius: 999px; background: var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .9rem; }
.tl-step.done .tl-dot { background: var(--success); color: #fff; }
.tl-step.current .tl-dot { background: var(--orange); color: #fff; }
.tl-line { width: 2px; height: 26px; background: var(--line); margin-inline-start: 14px; }
.tl-step.done .tl-line { background: var(--success); }

/* filters bar */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--card); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); margin: 16px 0; }
.filters select { border: 2px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--card); }
.pagination { display: flex; gap: 6px; justify-content: center; margin: 24px 0; }
.pagination button { border: 1px solid var(--line); background: var(--card); border-radius: 10px; min-width: 38px; height: 38px; cursor: pointer; }
.pagination button.cur { background: var(--navy); color: #fff; border-color: var(--navy); }

/* reviews */
.review { border-bottom: 1px solid var(--line); padding: 14px 0; }
.review .rhead { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }

/* account tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: none; background: none; padding: 10px 18px; cursor: pointer; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs button.cur { color: var(--orange); border-bottom-color: var(--orange); }

/* demo badge */
.demo-tag { background: #fff7ed; color: #c2410c; font-size: .7rem; font-weight: 800; border-radius: 6px; padding: 2px 8px; }
[data-theme="dark"] .demo-tag { background: #3a2410; color: #ffb47a; }

@media (max-width: 640px) {
  .header-main { flex-wrap: wrap; }
  .search-box { order: 3; flex-basis: 100%; }
  .hero-banner { padding: 30px 20px; }
}
