/* Kmandi — shared styles. Fonts are served from /fonts (no outside requests). */
@font-face { font-family: "Jakarta"; src: url(/fonts/plus-jakarta-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url(/fonts/plus-jakarta-sans-latin-600-normal.woff2) format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url(/fonts/plus-jakarta-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url(/fonts/plus-jakarta-sans-latin-800-normal.woff2) format("woff2"); font-weight: 800 900; font-display: swap; }
@font-face { font-family: "PlexArabic"; src: url(/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "PlexArabic"; src: url(/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format("woff2"); font-weight: 500 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "PlexArabic"; src: url(/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format("woff2"); font-weight: 700 900; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  --bg: #F6F3EE; --card: #fff; --soft: #F1ECE3; --text: #16151A; --muted: #5E5A63; --line: #E6E1D8;
  --ink: #16151A; --live: #E11D48; --fb: #0866FF;
  --ok: #0F7A4A; --ok-ink: #0F5132; --ok-bg: #E3F3EA;
  --warn: #8A4B08; --warn-bg: #FDF0DC; --bad: #A11D33; --bad-bg: #FDE8EB;
  --radius: 18px; --font: "Jakarta", "PlexArabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* kept for older markup */
  --brand: var(--ink); --brand-ink: #fff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); background: var(--bg); color: var(--text); }
a { color: var(--text); }
.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pad { padding: 18px; }
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 6px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0 0 12px; font-weight: 800; }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 700; }
.muted { color: var(--muted); font-size: 14px; }
.price { font-size: 22px; font-weight: 800; }
.num { font-variant-numeric: tabular-nums; }

.live-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--live); color: #fff; font-weight: 800; font-size: 11px; letter-spacing: .07em; padding: 4px 9px; border-radius: 6px; text-transform: uppercase; }
.live-badge::before { content: ""; width: 7px; height: 7px; background: #fff; border-radius: 50%; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live-badge::before { animation: none; } * { scroll-behavior: auto !important; } }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; border: 0; border-radius: 14px; padding: 12px 18px; font: 800 16px var(--font); background: var(--ink); color: #fff; cursor: pointer; text-align: center; text-decoration: none; }
.btn:hover { background: #2C2A31; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--text); border: 1.5px solid #CFCAC1; }
.btn.ghost:hover { background: var(--soft); }
.btn.live { background: var(--live); }
.btn.live:hover { background: #C8143C; }
.btn.fb { background: var(--fb); }
.btn.danger { background: #fff; color: var(--bad); border: 1.5px solid #E8B4BE; }
.btn.sm { display: inline-flex; width: auto; min-height: 38px; padding: 6px 14px; font-size: 14px; font-weight: 700; border-radius: 11px; }
:focus-visible { outline: 3px solid var(--fb); outline-offset: 2px; }

label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 5px; }
input, textarea, select { width: 100%; font: 500 16px var(--font); padding: 11px 13px; border: 1.5px solid #D9D5CD; border-radius: 12px; background: #fff; color: var(--text); min-height: 46px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22,21,26,.12); }
textarea { resize: vertical; min-height: 70px; }
.error { color: var(--bad); font-size: 14px; font-weight: 600; margin-top: 8px; min-height: 1em; }
.notice { padding: 12px 16px; border-radius: 14px; background: var(--warn-bg); color: var(--warn); margin-bottom: 16px; font-size: 15px; }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.ok { background: var(--ok-bg); color: var(--ok-ink); }
.timer { background: var(--warn-bg); color: var(--warn); padding: 10px 14px; border-radius: 12px; font-weight: 700; font-size: 14px; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 8px; background: #EFEDE9; color: #3A373F; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad, .chip.out { background: var(--bad-bg); color: var(--bad); }
.chip.fb { background: #E7F0FF; color: #0550C8; }

.row { display: flex; gap: 12px; align-items: center; }
.thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: #EDE5D8; flex: none; }
.ph { display: grid; place-items: center; color: #8A7A63; background: #EDE5D8; }

/* size picker */
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.size { min-height: 60px; border: 1.5px solid #CFCAC1; background: #fff; color: var(--text); border-radius: 14px; padding: 6px 4px; text-align: center; cursor: pointer; font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.size b { font-size: 17px; font-weight: 800; }
.size small { font-size: 11px; font-weight: 600; color: var(--muted); }
.size.low small { color: var(--warn); }
.size[disabled] { background: #EFEBE4; border-color: var(--line); color: #8B8690; cursor: not-allowed; }
.size[disabled] b { text-decoration: line-through; }
.size.selected { background: var(--ink); border-color: var(--ink); color: #fff; }
.size.selected small { color: #D9D5DE; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: start; padding: 11px 10px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; border-top: 0; font-size: 13px; }
.table-scroll { overflow-x: auto; }
.empty { text-align: center; padding: 56px 18px; }

/* language switch */
.lang-switch { display: inline-flex; background: #EAE5DC; border-radius: 12px; padding: 3px; gap: 2px; }
.lang-switch button { font: 700 14px var(--font); min-height: 36px; padding: 0 12px; border-radius: 9px; border: 0; background: transparent; color: #3A373F; cursor: pointer; }
.lang-switch button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.topbar b { font-size: 18px; font-weight: 800; }
html[lang="ar"] .live-badge { letter-spacing: 0; }
.stat b { font-size: 26px; display: block; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
