/* =====================================================================
   Improved Scent Demo — styles
   Premium Arabic RTL UX. All brand-tunable values live in :root below.
   ===================================================================== */

:root {
  /* --- BRAND (customize per client) --- */
  --gold: #b8973a;
  --gold-dark: #8a6e1f;
  --gold-light: #cba84d;
  --brown: #2d1a00;

  /* --- NEUTRALS --- */
  --bg: #f8f6f0;
  --white: #ffffff;
  --black: #141414;
  --ink: #2c2c2c;
  --muted: #6b7280;
  --line: #e5e7eb;
  --ok: #2e7d52;
  --err: #b3402f;
  --whatsapp: #25d366;
  --whatsapp-dark: #1da851;

  --radius: 6px;
  --maxw: 680px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  direction: rtl;
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: 'Almarai', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.73;
}

/* ---------- DEMO RIBBON ---------- */
.demo-ribbon {
  background: var(--brown);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  padding: 7px;
}

/* ---------- HEADER ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  color: var(--brown);
  letter-spacing: .5px;
}
.site-header .brand img { height: 32px; width: auto; }
.site-header .brand span { color: var(--gold); }

/* ---------- BREADCRUMB ---------- */
.breadcrumb {
  padding: 14px 24px;
  font-size: 13px;
  color: var(--muted);
  max-width: var(--maxw);
  margin: 0 auto;
}
.breadcrumb span { color: var(--gold); }

/* ---------- LAYOUT ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 48px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pad { padding: 32px 28px; }
@media (max-width: 480px) { .pad { padding: 24px 18px; } }

/* ---------- PROGRESS ---------- */
.progress { height: 3px; background: var(--line); }
.progress > i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .35s ease; }

/* ---------- HERO ---------- */
.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--brown);
  background: #f5ead6;
  border: 1px solid #e8d5a8;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
h1 { font-size: 26px; font-weight: 800; line-height: 1.4; color: var(--black); margin-bottom: 10px; }
.sub { font-size: 15px; color: var(--muted); margin-bottom: 28px; line-height: 1.7; }
.divider { height: 1px; background: var(--line); margin: 24px 0; }

/* ---------- BUTTONS ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 14px;
  padding: 13px 28px; border-radius: 999px; width: 100%;
  transition: filter .15s ease, transform .1s ease, background .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-align: center; text-decoration: none;
}
.btn-primary { background: var(--gold); color: var(--white); border: 1px solid var(--gold); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--gold-dark); border: 1px solid var(--gold); }
.btn-outline:hover { background: #fdf6e8; }
.btn-whatsapp { background: var(--whatsapp); color: #fff; border: 1px solid var(--whatsapp); }
.btn-whatsapp:hover { background: var(--whatsapp-dark); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); font-size: 13px; padding: 10px 24px; }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-dark); }

/* ---------- QUESTION ---------- */
.q-step { font-size: 12px; color: var(--muted); letter-spacing: .5px; margin-bottom: 10px; }
.q-text { font-size: 20px; font-weight: 800; color: var(--black); margin-bottom: 22px; line-height: 1.45; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  text-align: right; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 18px; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 400; color: var(--ink);
  transition: border-color .15s, background .15s;
  display: flex; align-items: center; gap: 12px;
}
.opt:hover { border-color: var(--gold); background: #fdf9ef; }
.opt .radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--line); flex: 0 0 auto; transition: border-color .15s;
}
.opt:hover .radio { border-color: var(--gold); }
.back-row { margin-top: 16px; text-align: center; }

/* ---------- RESULT ---------- */
.result-header { margin-bottom: 24px; }
.result-header h2 { font-size: 22px; font-weight: 800; color: var(--black); line-height: 1.4; margin-bottom: 8px; }
.result-header p { font-size: 14px; color: var(--muted); line-height: 1.7; }

.top-pick { background: var(--white); border: 2px solid var(--gold); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.top-pick-label {
  background: var(--gold); color: var(--white);
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  padding: 6px 18px; display: block; text-align: center;
}
.top-pick-body { padding: 22px 22px 18px; }
.tp-name { font-size: 22px; font-weight: 700; color: var(--black); margin-bottom: 8px; line-height: 1.35; }
.tp-price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.price-now { font-size: 20px; font-weight: 700; color: var(--gold-dark); }
.price-was { font-size: 15px; color: #9ca3af; text-decoration: line-through; }
.tp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tp-because {
  font-size: 15px; line-height: 1.75; color: var(--ink); margin-bottom: 18px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.tp-because strong { color: var(--gold-dark); }

/* ---------- BUDGET NOTE ---------- */
.budget-note {
  font-size: 14px; line-height: 1.7; color: #92400e;
  background: #fffbeb; border: 1px solid #fcd34d; border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 14px;
  display: flex; align-items: flex-start; gap: 8px;
}
.budget-note::before { content: "ℹ"; font-size: 15px; flex-shrink: 0; margin-top: 1px; }

/* ---------- SECTION LABEL ---------- */
.section-label {
  font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--muted);
  margin: 24px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}

/* ---------- PRODUCT CARD ---------- */
.prod-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 10px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.prod-card:hover { border-color: var(--gold); box-shadow: 0 2px 8px rgba(184,151,58,.12); }
.prod-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.prod-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.prod-card-name { font-size: 15px; font-weight: 700; color: var(--black); line-height: 1.4; flex: 1; }
.prod-card-price { font-size: 15px; font-weight: 700; color: var(--gold-dark); white-space: nowrap; flex-shrink: 0; }
.prod-card-price .was { font-size: 12px; color: #9ca3af; text-decoration: line-through; margin-inline-start: 6px; font-weight: 400; }
.prod-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--bg); white-space: nowrap;
}
.prod-card-match { font-size: 13px; color: var(--ok); margin-top: 10px; line-height: 1.6; }
.prod-card-detail { display: none; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.prod-card-detail.open { display: block; }
.prod-card-detail-desc { font-size: 14px; color: var(--ink); line-height: 1.75; margin-bottom: 14px; }
.prod-card-detail .btn { margin-top: 8px; }

/* ---------- CTA ---------- */
.cta-section { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- FORM ---------- */
.form-title { font-size: 20px; font-weight: 800; color: var(--black); margin-bottom: 6px; }
.form-sub { font-size: 14px; color: var(--muted); margin-bottom: 22px; line-height: 1.7; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
.field input {
  width: 100%; font-family: inherit; font-size: 15px;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); color: var(--ink); transition: border-color .15s;
}
.field input:focus { outline: none; border-color: var(--gold); }
.field input:focus-visible { outline: 2px solid rgba(184,151,58,.35); outline-offset: 2px; }
.consent-row { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 18px; font-size: 13px; color: var(--ink); line-height: 1.6; }
.consent-row input { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 3px; accent-color: var(--gold); }
.msg { font-size: 13px; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; display: none; }
.msg.err { display: block; background: #fef2f2; color: var(--err); border: 1px solid #fecaca; }
.msg.ok { display: block; background: #f0fdf4; color: var(--ok); border: 1px solid #bbf7d0; }

/* ---------- SWIPE DECK ---------- */
.swipe-deck-wrap {
  position: relative;
  margin-bottom: 24px;
}

.swipe-stack {
  position: relative;
  height: 280px;
  margin-bottom: 14px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.swipe-stack:active { cursor: grabbing; }

/* All cards sit in the same stack area */
.swipe-card {
  position: absolute;
  inset: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: transform .35s cubic-bezier(.22,.61,.36,1), opacity .25s ease, box-shadow .25s;
  will-change: transform, opacity;
}

/* Top card — visible and interactive */
.swipe-card.swipe-top {
  opacity: 1;
  pointer-events: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,.10);
  z-index: 2;
  transform: translateX(0) rotate(0deg) scale(1);
}

/* Second card — peeking behind */
.swipe-card.swipe-second {
  opacity: 1;
  pointer-events: none;
  z-index: 1;
  transform: translateX(0) rotate(-1.5deg) scale(.97);
}

/* Dismissed cards */
.swipe-card.swipe-gone {
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

/* Fly animations */
.swipe-card.swipe-fly-like {
  transform: translateX(120%) rotate(18deg) !important;
  opacity: 0 !important;
  transition: transform .4s ease-in, opacity .3s ease-in !important;
}
.swipe-card.swipe-fly-dislike {
  transform: translateX(-120%) rotate(-18deg) !important;
  opacity: 0 !important;
  transition: transform .4s ease-in, opacity .3s ease-in !important;
}

/* Drag hint overlays */
.swipe-card.drag-hint-like::after,
.swipe-card.drag-hint-dislike::after {
  content: attr(data-hint);
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  pointer-events: none;
  opacity: .65;
}
.swipe-card.drag-hint-like {
  border-color: var(--ok);
  box-shadow: 0 0 0 2px rgba(46,125,82,.35);
}
.swipe-card.drag-hint-like::after {
  background: rgba(240,253,244,.75);
  content: "♥ يناسبني";
  color: var(--ok);
}
.swipe-card.drag-hint-dislike {
  border-color: var(--err);
  box-shadow: 0 0 0 2px rgba(179,64,47,.25);
}
.swipe-card.drag-hint-dislike::after {
  background: rgba(254,242,242,.75);
  content: "✕ ليس الآن";
  color: var(--err);
}

/* Card content */
.swipe-card-name  { font-size: 17px; font-weight: 700; color: var(--black); margin-bottom: 6px; line-height: 1.4; }
.swipe-card-price { font-size: 15px; font-weight: 700; color: var(--gold-dark); margin-bottom: 10px; }
.swipe-card-tags  { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.swipe-card-desc  { font-size: 13px; color: var(--ink); line-height: 1.75; margin-bottom: 14px; }
.swipe-card-link  { margin-top: 6px; font-size: 13px; pointer-events: auto; }

/* Action buttons */
.swipe-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.swipe-btn-dislike,
.swipe-btn-like {
  flex: 1;
  max-width: 180px;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1.5px solid;
  cursor: pointer;
  transition: filter .15s, transform .1s;
  font-family: inherit;
}
.swipe-btn-like {
  background: #f0fdf4;
  color: var(--ok);
  border-color: var(--ok);
}
.swipe-btn-like:hover { filter: brightness(.95); transform: translateY(-1px); }
.swipe-btn-dislike {
  background: #fef2f2;
  color: var(--err);
  border-color: var(--err);
}
.swipe-btn-dislike:hover { filter: brightness(.95); transform: translateY(-1px); }

/* Done message */
.swipe-done {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  padding: 14px;
}

/* Counter */
.swipe-counter {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: .5px;
}

/* ---------- FOOTER ---------- */
.site-footer {
  background: #ededed; text-align: center;
  padding: 22px 20px; font-size: 12px; color: #6b7280;
  margin-top: 48px; border-top: 1px solid var(--line); line-height: 1.8;
}
.site-footer a { color: var(--gold-dark); text-decoration: none; }
.site-footer .privacy { display: block; max-width: 480px; margin: 0 auto 6px; }
