/* عطور الامام: the shop. Warm paper, deep ink, one gold accent. */
:root {
  --paper: #faf7f1;
  --surface: #ffffff;
  --ink: #16130f;
  --ink-2: #3b352c;
  --muted: #7a7265;
  --line: #e9e2d5;
  --gold: #a47a2a;
  --gold-soft: #f3ead7;
  --ok: #2f6b4f;
  --bad: #a3322b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 19, 15, .05), 0 8px 24px rgba(22, 19, 15, .06);
  --sans: "Segoe UI", "SF Arabic", "Geeza Pro", "Noto Sans Arabic", "Noto Kufi Arabic", Tahoma, system-ui, sans-serif;
  --display: "Noto Naskh Arabic", "Geeza Pro", "Traditional Arabic", "Times New Roman", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 15px; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.btn:hover:not(:disabled) { border-color: var(--ink); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--gold); border-color: var(--gold); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--gold-soft); border-color: transparent; }
.btn.block { width: 100%; }
.btn.grow { flex: 1; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(250, 247, 241, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: #e9cf96; font-family: var(--display); font-size: 24px; line-height: 1; padding-bottom: 4px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--display); font-size: 22px; font-weight: 700; }
.brand-text small { color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.cart-btn { position: relative; }
.count { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: #fff; font-size: 12px; font-weight: 700; }
.count[hidden] { display: none; }

.announce { padding: 9px 16px; background: var(--ink); color: #f1e3c2; text-align: center; font-size: 14px; }
.announce.closed { background: var(--bad); color: #fff; }

/* hero */
.hero { background: radial-gradient(1200px 400px at 85% -10%, #f0e2c2 0%, transparent 60%), linear-gradient(180deg, #f6efe1 0%, var(--paper) 100%); border-bottom: 1px solid var(--line); }
.hero-in { padding: 56px 0 44px; }
.eyebrow { color: var(--gold); font-size: 13px; font-weight: 700; letter-spacing: .12em; }
.hero h1 { margin-top: 10px; font-family: var(--display); font-size: clamp(32px, 6vw, 54px); line-height: 1.35; font-weight: 700; }
.lead { margin-top: 14px; max-width: 540px; color: var(--ink-2); font-size: 17px; }
.perks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.perks li { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .7); font-size: 14px; font-weight: 600; }
.perks .icon { color: var(--gold); }
.perks span { display: flex; }

/* toolbar */
main { padding: 28px 0 64px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; max-width: 100%; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.search { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; max-width: 340px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); }
.search:focus-within { border-color: var(--ink); }
.search span { display: flex; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink); }

/* products */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: box-shadow .2s, transform .2s, border-color .2s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #dccfb4; }
.card-media { position: relative; aspect-ratio: 4 / 4.4; background: #f3ecdf; }
.card-img, .pd-img, .line-img { width: 100%; height: 100%; object-fit: cover; }
.blank { display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #fbf5e8 0%, #ecdfc5 70%, #e2d2b1 100%); }
.blank span { display: grid; place-items: center; width: 44%; aspect-ratio: 1; border: 1px solid rgba(164, 122, 42, .45); border-radius: 50%; color: var(--gold); font-family: var(--display); font-size: clamp(28px, 6vw, 46px); line-height: 1; padding-bottom: 6px; }
.tag { position: absolute; top: 12px; inset-inline-start: 12px; padding: 3px 10px; border-radius: 999px; background: var(--ink); color: #e9cf96; font-size: 12px; font-weight: 700; }
.card.out .card-media { opacity: .55; }
.card-body { display: flex; flex-direction: column; gap: 4px; flex: 1; padding: 14px 16px 16px; }
.card h3 { font-size: 17px; font-weight: 700; line-height: 1.5; }
.size { color: var(--muted); font-size: 13px; }
.card-foot { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 10px; }
.price { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.price.big { font-size: 24px; color: var(--gold); }
.add { width: 100%; min-height: 42px; font-size: 14px; }
.card:hover .add:not(:disabled) { background: var(--ink); border-color: var(--ink); color: #fff; }
.state { display: grid; place-items: center; gap: 14px; padding: 64px 0; color: var(--muted); text-align: center; }
.state[hidden] { display: none; }

/* footer */
.foot { border-top: 1px solid var(--line); background: #f3ecdf; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 0; }
.foot strong { font-family: var(--display); font-size: 20px; }
.foot p { color: var(--muted); font-size: 14px; }
.contact { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.contact[hidden] { display: none; }
.contact a { color: var(--ink); font-weight: 700; }
.fine { flex-basis: 100%; }

/* dialogs */
dialog { padding: 0; border: 0; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgba(22, 19, 15, .5); backdrop-filter: blur(2px); }
.sheet { width: min(860px, 100% - 24px); max-height: min(92vh, 820px); border-radius: 20px; box-shadow: var(--shadow); overflow: auto; }
.x { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); }
.x.flat { position: static; border-color: transparent; background: none; }
.x:hover { border-color: var(--ink); }
.pd { display: grid; grid-template-columns: 1fr; }
.pd-media { aspect-ratio: 1; background: #f3ecdf; }
.pd-info { display: flex; flex-direction: column; gap: 10px; padding: 24px; }
.pd-info h2 { font-family: var(--display); font-size: 28px; line-height: 1.4; }
.desc { color: var(--ink-2); white-space: pre-line; }
.pd-buy { display: flex; gap: 10px; margin-top: 8px; }
.note { color: var(--muted); font-size: 13px; }
.note.bad { color: var(--bad); font-weight: 600; }
.note[hidden] { display: none; }
@media (min-width: 720px) {
  .pd { grid-template-columns: 1fr 1fr; }
  .pd-media { aspect-ratio: auto; min-height: 460px; }
  .pd-info { padding: 40px 32px; justify-content: center; }
}

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.qty button { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: none; }
.qty button:hover:not(:disabled) { background: var(--gold-soft); }
.qty button:disabled { opacity: .35; }
.qty-n { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.qty.small button { width: 32px; height: 32px; }
.qty.small .icon { width: 16px; height: 16px; }

/* basket drawer */
.drawer { width: min(460px, 100%); max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; margin-inline-start: auto; box-shadow: var(--shadow); }
.drawer[open] { display: flex; flex-direction: column; }
.drawer-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.drawer-head { display: flex; align-items: center; gap: 4px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { flex: 1; padding-inline-start: 8px; font-size: 19px; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.drawer-foot { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px 20px; border-top: 1px solid var(--line); background: var(--paper); }
.empty { display: grid; place-items: center; gap: 12px; margin: auto; padding: 40px 0; color: var(--muted); text-align: center; }
.empty .icon { width: 44px; height: 44px; stroke-width: 1.2; }
.lines { display: flex; flex-direction: column; }
.line { display: grid; grid-template-columns: 68px 1fr auto; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line-img { width: 68px; height: 78px; border-radius: 10px; }
.line-img.blank span { font-size: 22px; }
.line-main { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.line-total { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sums { display: flex; flex-direction: column; gap: 6px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.sum-row.grand { padding-top: 8px; border-top: 1px dashed var(--line); font-size: 17px; font-weight: 800; }

/* form */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; }
.field small { color: var(--muted); font-size: 12px; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(164, 122, 42, .15); }
.field select:disabled { background: var(--paper); color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 12px; }
.pay { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #e5d5ae; border-radius: 12px; background: var(--gold-soft); }
.pay .icon { width: 26px; height: 26px; color: var(--gold); }
.pay div { display: flex; flex-direction: column; }
.pay small { color: var(--ink-2); font-size: 13px; }

/* order boxes */
.done { display: grid; place-items: center; gap: 6px; padding: 12px 0 4px; text-align: center; }
.done-mark { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--ok); color: #fff; }
.done-mark .icon { width: 30px; height: 30px; stroke-width: 2.2; }
.done p { color: var(--ink-2); font-size: 14px; }
.order { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.order-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 18px; }
.mini { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-block: 1px solid var(--line); font-size: 14px; }
.mini li { display: flex; justify-content: space-between; gap: 12px; }
.badge { padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--gold-soft); color: #7a5a1c; white-space: nowrap; }
.badge.s-confirmed { background: #e3ecf7; color: #2a4d7a; }
.badge.s-out_for_delivery { background: #efe6f7; color: #5b3a85; }
.badge.s-delivered { background: #e1f0e8; color: var(--ok); }
.badge.s-cancelled { background: #f7e3e1; color: var(--bad); }
.orders-wrap { display: flex; flex-direction: column; gap: 16px; padding: 28px 24px; }
.orders-wrap h2 { font-family: var(--display); font-size: 26px; }
.orders { display: flex; flex-direction: column; gap: 14px; }
#orders-dialog { width: min(560px, 100% - 24px); }

.toast { position: fixed; z-index: 100; bottom: 24px; inset-inline: 0; width: max-content; max-width: calc(100% - 32px); margin-inline: auto; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: none; }
.toast.ok { background: var(--ok); }
.toast.bad { background: var(--bad); }

@media (max-width: 560px) {
  .top-row { height: 60px; }
  .brand-mark { width: 36px; height: 36px; font-size: 20px; }
  .brand-text strong { font-size: 19px; }
  .cart-btn span:nth-child(2) { display: none; }
  .btn { padding: 0 14px; }
  .hero-in { padding: 36px 0 30px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card-body { padding: 12px; }
  .card h3 { font-size: 15px; }
  .three { grid-template-columns: 1fr 1fr; }
  .three .field:last-child { grid-column: 1 / -1; }
  .search { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
