/* ---------- Tokens ---------- */
:root {
  --accent: #4f46e5;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --ink: #18181b;
  --ink-2: #52525b;
  --muted: #71717a;
  --line: #e4e4e7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);
  --sel: #111827;
  --res: #d4d4d8;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--bg); }
body.has-basket { padding-bottom: 84px; }
body.dialog-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.section { padding: 40px 16px; }
.wrap.section { padding-left: 16px; padding-right: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border: 0; border-radius: 12px;
  background: var(--accent); color: #fff; font: 600 1rem var(--font);
  text-decoration: none; cursor: pointer; transition: transform .08s, filter .15s, box-shadow .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.loading { position: relative; color: transparent; }
.btn.loading::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: #fafafa; filter: none; }
.btn-wa { background: #25d366; color: #fff; }
.icon-btn { border: 0; background: #f4f4f5; width: 36px; height: 36px; border-radius: 50%; font-size: 15px; cursor: pointer; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: #e4e4e7; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

/* ---------- Hero ---------- */
.preview-bar { background: #fef3c7; color: #78350f; text-align: center; padding: 8px 16px; font-size: .9rem; }
.hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--accent) 70%, #fff) 0%, transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 85%, #000) 0%, var(--accent) 100%);
}
.hero.has-cover { background: #111 var(--cover) center/cover no-repeat; }
.hero.has-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.72) 100%); }
.hero-inner { position: relative; padding-top: 56px; padding-bottom: 48px; }
.hero-kicker { margin: 0 0 10px; font-weight: 600; opacity: .9; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 800; max-width: 18ch; margin-bottom: 24px; }
.hero-facts { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 14px 32px; }
.hero-facts li { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
.hero-facts small { font-weight: 400; opacity: .85; font-size: .9rem; }
.hero-facts svg { width: 22px; height: 22px; flex: none; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.btn-hero { background: #fff; color: var(--ink); padding: 12px 26px; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.closed-badge { display: inline-block; background: rgba(255,255,255,.18); padding: 8px 14px; border-radius: 999px; font-weight: 600; margin: 0; }

/* ---------- About & speakers ---------- */
.about-grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.4fr 1fr; } }
.prose p { margin: 0 0 1em; color: var(--ink-2); }
.speaker { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.speaker img, .speaker-initials { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.speaker-initials { display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, #fff); color: var(--accent); font-weight: 700; font-size: 1.2rem; }
.speaker h3 { margin: 2px 0 2px; font-size: 1.05rem; }
.speaker-initials svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.speaker > div:last-child { flex: 1; min-width: 0; }
.speaker-role { margin: 0 0 6px; color: var(--accent); font-weight: 600; font-size: .9rem; }
.speaker-bio { margin: 0; color: var(--ink-2); font-size: .93rem; }

/* ---------- Seats section ---------- */
.seats-section { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-left: 0; padding-right: 0; scroll-margin-top: 0; }
.seats-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.seats-head p { margin: 0; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: #15803d; background: #f0fdf4; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: pulse 2s infinite; }
.live.off { color: var(--muted); background: #f4f4f5; }
.live.off .dot { background: #a1a1aa; animation: none; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 50% { box-shadow: 0 0 0 5px rgba(34,197,94,0); } }
.legend { list-style: none; padding: 0; margin: 18px 0 14px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .88rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend b { color: var(--ink); }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; flex: none; }
.sw-sel { background: var(--sel); }
.sw-held { background: #fff; box-shadow: inset 0 0 0 1.5px #a1a1aa; background-image: repeating-linear-gradient(45deg, transparent 0 3px, #d4d4d8 3px 4px); }
.sw-res { background: var(--res); }
.my-bookings { margin-top: 14px; font-size: .9rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--ink-2); }
.chip { border: 0; background: #ecfdf5; color: #065f46; font: 600 .85rem var(--font); padding: 6px 10px; border-radius: 999px; cursor: pointer; }

.map-wrap { padding: 0 8px; }
@media (min-width: 700px) { .map-wrap { padding: 0 16px; } }
.seatmap {
  height: clamp(320px, calc((100vw - 32px) / var(--map-ratio) + 40px), 72vh);
  border-radius: var(--radius); background: #fbfbfa; border: 1px solid var(--line);
}
@media (max-width: 699px) { .seatmap { height: max(260px, calc((100vw - 16px) / var(--map-ratio) + 50px)); } }
.map-help { margin: 8px 4px 0; font-size: .82rem; text-align: center; }
.touch .only-mouse, .mouse .only-touch { display: none; }

.picked { margin-top: 18px; }
.picked h3 { font-size: 1rem; }
.picked ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.picked li { display: inline-flex; align-items: center; gap: 8px; background: #f4f4f5; border-radius: 10px; padding: 6px 6px 6px 10px; font-size: .9rem; font-weight: 600; }
.picked li .muted { font-weight: 400; font-size: .82rem; }
.chip-x { border: 0; background: transparent; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.chip-x:hover { background: #e4e4e7; color: var(--ink); }

/* ---------- Original plan ---------- */
.plan-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin: -2px 0 12px; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: .92rem; font-weight: 600; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { position: relative; width: 40px; height: 24px; border-radius: 999px; background: #d4d4d8; transition: background .2s; flex: none; }
.switch-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.link-btn { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 6px 2px; color: var(--accent); font: 600 .92rem var(--font); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
/* Compare mode: plan underneath, seats tinted so the original numbers show through */
.seatmap.plan-on { background: #fff; }
.seatmap.plan-on .sm-bg image { opacity: 1; }
.seatmap.plan-on .seat text { opacity: 0; }
.seatmap.plan-on .seat.av rect { fill-opacity: .28; stroke: var(--z); stroke-width: 1.2; }
.seatmap.plan-on .seat.av:hover rect { fill-opacity: .5; }
.seatmap.plan-on .seat.sel rect { fill-opacity: .7; }
.seatmap.plan-on .seat.res rect { fill-opacity: .75; }
.seatmap.plan-on .seat.held rect { fill-opacity: .5; }
.seatmap.plan-on .sm-labels, .seatmap.plan-on .sm-shapes { opacity: 0; }
.dialog.dialog-wide { width: min(1100px, calc(100vw - 32px)); }
@media (max-width: 599px) { .dialog.dialog-wide { width: 100vw; } }
.plan-scroll { padding: 12px; background: #fafafa; overscroll-behavior: contain; }
.plan-scroll img { width: 100%; height: auto; cursor: zoom-in; border-radius: 8px; background: #fff; }
.plan-scroll.zoomed { overflow: auto; }
.plan-scroll.zoomed img { width: 260%; max-width: none; cursor: zoom-out; }
.plan-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.plan-foot p { margin: 0; flex: 1 1 260px; }

/* ---------- Payment & location ---------- */
.pay-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 12px; }
.pay-card { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.pay-card p { margin: 10px 0 0; color: var(--ink-2); font-size: .95rem; }
.pay-logo { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 8px; font-weight: 800; font-size: .9rem; letter-spacing: .01em; }
.pay-cash { background: #ecfdf5; color: #047857; }
.pay-whish { background: #fee2e2; color: #b91c1c; }
.pay-omt { background: #fef9c3; color: #854d0e; }
.location p { color: var(--ink-2); }
.site-foot { padding: 24px 16px 40px; text-align: center; }

/* ---------- Basket ---------- */
.basket {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(0,0,0,.08);
  padding-bottom: env(safe-area-inset-bottom);
  animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
.basket-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.basket-info { font-size: 1rem; }
.basket-timer { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.basket-timer.urgent { color: #dc2626; font-weight: 600; }
.basket .btn { padding: 10px 28px; }

/* ---------- Dialog ---------- */
.dialog {
  border: 0; padding: 0; border-radius: 18px; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--ink); background: var(--surface);
}
.dialog::backdrop { background: rgba(9,9,11,.55); backdrop-filter: blur(2px); }
.dialog[open] { display: flex; flex-direction: column; animation: pop .2s ease-out; }
@keyframes pop { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.dialog-body { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 48px); }
.dialog-body[hidden] { display: none; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 1.2rem; }
.dialog-scroll { overflow-y: auto; padding: 16px 20px; -webkit-overflow-scrolling: touch; }
.dialog-foot { padding: 14px 20px 18px; border-top: 1px solid var(--line); padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.dialog-foot p { margin: 8px 0 0; }
@media (max-width: 599px) {
  .dialog { width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; margin: 0; border-radius: 0; }
  .dialog-body { max-height: 100%; height: 100%; }
  .dialog-scroll { flex: 1; }
}
.summary { margin-bottom: 8px; }
.sum-list { list-style: none; padding: 0; margin: 0; max-height: 180px; overflow: auto; }
.sum-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.sum-list li > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.sum-total { display: flex; justify-content: space-between; padding: 10px 0 4px; font-weight: 800; font-size: 1.1rem; }
.hold-note { font-size: .82rem; color: var(--muted); margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.fields { display: grid; gap: 12px; }
.fields label, .methods legend { font-weight: 600; font-size: .9rem; display: block; }
.fields input {
  display: block; width: 100%; margin-top: 6px; min-height: 48px; padding: 10px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); font: 16px var(--font); color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.fields input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.fields input.invalid { border-color: #dc2626; }
.hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.methods { border: 0; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.methods legend { margin-bottom: 8px; padding: 0; }
.method { position: relative; cursor: pointer; }
.method input { position: absolute; opacity: 0; pointer-events: none; }
.method-card {
  display: flex; align-items: center; justify-content: center; min-height: 56px; border-radius: 12px; border: 1.5px solid var(--line);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.method input:checked + .method-card { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); background: color-mix(in srgb, var(--accent) 4%, #fff); }
.method input:focus-visible + .method-card { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.method-info { margin-top: 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 12px 14px; font-size: .92rem; color: #713f12; }
.form-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: #fef2f2; color: #b91c1c; font-size: .92rem; }
.done .code { font-size: 2.2rem; font-weight: 800; letter-spacing: .18em; text-align: center; background: #f4f4f5; border-radius: 14px; padding: 12px; margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.done p { margin: 0 0 6px; }
.done-check { width: 64px; height: 64px; margin: 4px auto 12px; border-radius: 50%; background: #dcfce7; display: grid; place-items: center; }
.done-check svg { width: 34px; height: 34px; fill: none; stroke: #16a34a; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.done .sum-list { margin-top: 14px; }
.done-actions { display: grid; gap: 8px; }

/* ---------- WhatsApp step & status ---------- */
.wa-step { background: #f0fdf4; border: 1.5px solid #86efac; border-radius: 14px; padding: 14px 16px 16px; margin-bottom: 18px; }
.wa-step-title { font-weight: 800; font-size: 1.02rem; margin: 0 0 4px; color: #14532d; }
.wa-step p.small { margin: 0 0 12px; color: #166534; }
.wa-step.sent { background: #f8fafc; border-color: var(--line); }
.wa-step.sent .wa-step-title, .wa-step.sent p.small { color: var(--ink-2); }
.wa-step.sent .btn-wa { background: #fff; color: #15803d; box-shadow: inset 0 0 0 1.5px #86efac; }
.btn-wa svg { width: 22px; height: 22px; }
.status-pill { display: inline-block; background: #fef3c7; color: #92400e; font-weight: 700; padding: 3px 10px; border-radius: 999px; font-size: .8rem; }

/* ---------- Alert popup ---------- */
.dialog.dialog-alert { width: min(400px, calc(100vw - 32px)); height: fit-content; max-height: calc(100% - 32px); border-radius: 18px; margin: auto; }
.alert-body { padding: 26px 22px 20px; text-align: center; }
.alert-icon { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; background: #fef3c7; color: #b45309; display: grid; place-items: center; font: 800 1.6rem var(--font); }
.alert-body h2 { font-size: 1.2rem; margin-bottom: 8px; }
.alert-body p { color: var(--ink-2); margin: 0 0 18px; }
.alert-body form { margin: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); z-index: 50; opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: .92rem; max-width: calc(100vw - 32px);
  box-shadow: 0 10px 30px rgba(0,0,0,.2); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Event list ---------- */
.list-page .wrap { padding-top: 40px; padding-bottom: 40px; }
.list-title { font-size: 2rem; }
.banner { background: #fef3c7; padding: 10px 14px; border-radius: 10px; }
.event-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: 20px; }
.event-card { display: block; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: transform .15s; }
.event-card:hover { transform: translateY(-2px); }
.event-card-img { height: 140px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 80%, #000), var(--accent)) center/cover; }
.event-card-body { padding: 16px; }
.event-card-date { color: var(--accent); font-weight: 700; font-size: .85rem; }
.event-card h2 { font-size: 1.2rem; margin: 4px 0; }

/* ---------- Embed (inside WordPress iframe) ---------- */
.embed .hero-inner { padding-top: 32px; padding-bottom: 32px; }
.embed .site-foot { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Language switch & Arabic (RTL) ---------- */
.lang-switch { position: absolute; top: 14px; inset-inline-end: 16px; z-index: 2; display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.16); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lang-switch a { color: #fff; text-decoration: none; font-size: .85rem; font-weight: 600; padding: 5px 13px; border-radius: 999px; line-height: 1.3; }
.lang-switch a:hover { background: rgba(255,255,255,.14); }
.lang-switch a.on { background: #fff; color: var(--ink); }
.lang-switch a[lang="ar"] { font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif; }
.btn-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[lang="ar"] { --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, -apple-system, Roboto, Arial, sans-serif; }
/* Any letter-spacing breaks the joined Arabic letters */
html[lang="ar"] body, html[lang="ar"] body * { letter-spacing: 0 !important; }
html[lang="ar"] .hero-kicker { text-transform: none; font-size: .95rem; }
html[lang="ar"] .hero h1 { font-weight: 700; line-height: 1.35; }
html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.4; }
[dir="rtl"] .picked li { padding: 6px 10px 6px 6px; }
.ltr, [dir="rtl"] .done .code { direction: ltr; unicode-bidi: isolate; }
@media (max-width: 520px) { .hero-inner { padding-top: 64px; } }
