/* clicki.site storefront — every shop sets --brand from its dashboard */
:root {
  --brand: #FF5A36;
  --ink: #111421;
  --text: #2A2E3B;
  --muted: #6B7080;
  --line: #E9EAF0;
  --field-line: #D9DBE5;
  --soft: #F6F7FA;
  --surface: #fff;
  --bg: #fff;
  --glass: rgba(255, 255, 255, .92);
  --contrast: #111421;
  --err: #DC2626; --err-bg: #FEF2F2; --err-ink: #991B1B;
  --ok-bg: #ECFDF5; --ok-ink: #059669;
  color-scheme: light;
  --radius: 18px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* dark storefront: the owner picks Dark, or Auto and the customer's device is dark */
:root[data-theme="dark"] {
  --ink: #F3F4F8; --text: #D3D6E0; --muted: #9298AA; --line: #272B38; --field-line: #363B4D;
  --soft: #1A1D28; --surface: #151822; --bg: #0E1017; --glass: rgba(14, 16, 23, .88); --contrast: #2B3044;
  --err: #F87171; --err-bg: #2E1416; --err-ink: #FCA5A5; --ok-bg: #0F2A21; --ok-ink: #6EE7B7;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --ink: #F3F4F8; --text: #D3D6E0; --muted: #9298AA; --line: #272B38; --field-line: #363B4D;
    --soft: #1A1D28; --surface: #151822; --bg: #0E1017; --glass: rgba(14, 16, 23, .88); --contrast: #2B3044;
    --err: #F87171; --err-bg: #2E1416; --err-ink: #FCA5A5; --ok-bg: #0F2A21; --ok-ink: #6EE7B7;
    color-scheme: dark;
  }
}
html[lang="ar"] { --font: "Cairo", "Plus Jakarta Sans", Tahoma, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.55; font-size: 15.5px; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .4em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.45; }
.wrap { width: min(1180px, 100% - 28px); margin-inline: auto; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 14px; border: 1px solid transparent; font: inherit; font-weight: 800; cursor: pointer; text-align: center; transition: filter .15s, transform .15s; }
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-wa { background: #25D366; color: #fff; }
.btn-line { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* header */
.s-top { position: sticky; top: 0; z-index: 30; background: var(--glass); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.s-top .wrap { display: flex; align-items: center; gap: 12px; height: 66px; }
.s-brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 800; font-size: 18px; color: var(--ink); }
.s-brand img { height: 40px; width: auto; max-width: 140px; object-fit: contain; }
.s-brand .mono { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 18px; flex: none; }
.s-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.cart-btn { position: relative; width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.cart-btn svg { width: 22px; height: 22px; }
.cart-btn b { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--brand); color: #fff; font-size: 12px; display: grid; place-items: center; }

/* hero */
.s-hero { padding: 28px 0 8px; }
.s-cover { border-radius: 24px; overflow: hidden; aspect-ratio: 16 / 6; background: var(--soft); margin-bottom: 18px; }
.s-cover img { width: 100%; height: 100%; object-fit: cover; }
.s-hero h1 { font-size: clamp(26px, 5vw, 40px); margin-bottom: 6px; }
.s-hero p { color: var(--muted); margin: 0; max-width: 680px; }
.s-search { display: flex; gap: 8px; margin: 18px 0 6px; }
.s-search input { flex: 1; min-height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); font: inherit; background: var(--soft); outline: none; }
.s-search input:focus { border-color: var(--brand); background: var(--surface); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; }
.chip.on { background: var(--contrast); border-color: var(--contrast); color: #fff; }

/* product grid */
.p-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px 0 40px; }
@media (min-width: 720px) { .p-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1040px) { .p-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.p-card { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); transition: box-shadow .2s, transform .2s; }
.p-card:hover { box-shadow: 0 16px 36px -22px rgba(17, 20, 33, .45); transform: translateY(-2px); }
.p-img { position: relative; aspect-ratio: 1; background: var(--soft); }
.p-img img { width: 100%; height: 100%; object-fit: cover; }
.p-ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 42px; font-weight: 800; color: #fff; background: var(--brand); opacity: .85; }
.p-tag { position: absolute; top: 10px; inset-inline-start: 10px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--brand); color: #fff; }
.p-tag.out { background: var(--contrast); }
.p-info { padding: 12px 14px 14px; display: grid; gap: 4px; }
.p-info h3 { font-size: 15px; margin: 0; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 800; color: var(--ink); }
.price s { color: var(--muted); font-weight: 600; font-size: .85em; margin-inline-start: 6px; }
.empty { text-align: center; padding: 60px 16px; color: var(--muted); }

/* product page */
.pp { display: grid; gap: 26px; padding: 22px 0 40px; }
@media (min-width: 900px) { .pp { grid-template-columns: 1.05fr .95fr; gap: 44px; padding-top: 34px; } }
.crumbs { font-size: 13.5px; color: var(--muted); margin-top: 16px; }
.crumbs a:hover { color: var(--ink); }
.gallery .main { border-radius: 22px; overflow: hidden; aspect-ratio: 1; background: var(--soft); }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }   /* the whole photo, never cropped */
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumbs button { flex: none; width: 72px; height: 72px; border-radius: 14px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--soft); }
.thumbs button.on { border-color: var(--brand); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pp h1 { font-size: clamp(24px, 4vw, 34px); }
.pp .big-price { font-size: 28px; font-weight: 800; color: var(--ink); margin: 6px 0 18px; }
.pp .big-price s { font-size: 18px; color: var(--muted); font-weight: 600; margin-inline-start: 8px; }
.opt-group { margin-bottom: 16px; }
.opt-group > b { display: block; margin-bottom: 8px; color: var(--ink); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 700; cursor: pointer; background: var(--surface); }
.pill span small { color: var(--muted); font-weight: 600; }
.pill input:checked + span { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.pill input:disabled + span { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.pill input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.qty button { width: 46px; height: 48px; border: 0; background: var(--surface); font-size: 20px; cursor: pointer; color: var(--ink); }
.qty input { width: 52px; height: 48px; border: 0; text-align: center; font: inherit; font-weight: 800; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.buy-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.buy-row .btn { flex: 1 1 180px; }
.desc { white-space: pre-line; color: var(--text); }
.details { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.details li { padding: 10px 14px; border-radius: 12px; background: var(--soft); }
.sold-out { padding: 12px 16px; border-radius: 12px; background: var(--err-bg); color: var(--err-ink); font-weight: 700; margin: 10px 0; }
.related h2 { font-size: 20px; margin-top: 10px; }

/* cart drawer */
.drawer-scrim { position: fixed; inset: 0; background: rgba(10, 12, 20, .45); z-index: 60; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(420px, 100%); background: var(--surface); z-index: 61; display: flex; flex-direction: column; box-shadow: -20px 0 50px -20px rgba(0, 0, 0, .3); }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 18px; border-bottom: 1px solid var(--line); }
.drawer header h2 { margin: 0; font-size: 20px; }
.x { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 20px; cursor: pointer; }
.drawer .lines { flex: 1; overflow-y: auto; padding: 8px 18px; }
.drawer footer { padding: 16px 18px 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.line img, .line .ph { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--soft); }
.line .ph { display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; }
.line b { display: block; color: var(--ink); font-size: 14.5px; }
.line small { display: block; color: var(--muted); font-size: 12.5px; }
.line .mini { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; }
.line .mini button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.line .mini span { min-width: 22px; text-align: center; font-weight: 800; }
.line .rm { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12.5px; text-decoration: underline; padding: 0; margin-inline-start: 8px; }
.total-row { display: flex; justify-content: space-between; font-weight: 800; color: var(--ink); font-size: 17px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--contrast); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; z-index: 70; box-shadow: 0 16px 36px -16px rgba(0, 0, 0, .5); }

/* checkout */
.co { display: grid; gap: 22px; padding: 26px 0 50px; }
@media (min-width: 900px) { .co { grid-template-columns: 1.1fr .9fr; align-items: start; } .co aside { position: sticky; top: 90px; } }
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--surface); }
.box h2 { font-size: 19px; }
.f { margin-bottom: 14px; }
.f label { display: block; font-weight: 700; color: var(--ink); font-size: 14px; margin-bottom: 6px; }
.f label i { color: var(--err); font-style: normal; }
.f input, .f textarea, .f select { width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--field-line); font: inherit; background: var(--surface); outline: none; }
.f textarea { min-height: 96px; resize: vertical; }
.f input:focus, .f textarea:focus, .f select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent); }
.f.bad input, .f.bad textarea, .f.bad select { border-color: var(--err); }
.f .e { color: var(--err); font-size: 13px; font-weight: 600; margin-top: 4px; }
.note { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.alert { padding: 12px 14px; border-radius: 12px; background: var(--err-bg); color: var(--err-ink); font-weight: 600; margin-bottom: 12px; }
.done { text-align: center; padding: 48px 0 60px; max-width: 560px; margin: 0 auto; }
.done .ok { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; background: var(--ok-bg); color: var(--ok-ink); font-size: 34px; }
.summary { text-align: start; margin: 22px 0; }

/* footer */
.s-foot { border-top: 1px solid var(--line); padding: 28px 0 34px; color: var(--muted); font-size: 14px; }
.s-foot .wrap { display: grid; gap: 14px; }
.s-foot .soc { display: flex; gap: 10px; flex-wrap: wrap; }
.s-foot .soc a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.made { font-size: 12.5px; }
.made a { font-weight: 800; color: var(--ink); }
.closed { min-height: 80vh; display: grid; place-items: center; text-align: center; padding: 24px; }

/* honeypot field: hidden without offsets (an off-screen offset scrolls in right-to-left pages) */
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
