:root {
  --bg: #fbf7f4;
  --card: #ffffff;
  --ink: #1f1a1c;
  --muted: #6f6468;
  --line: #ece4df;
  --accent: #d6336c;
  --accent-dark: #b02457;
  --accent-soft: #fde8ef;
  --ok: #1f8a4c;
  --err: #c62828;
  --radius: 16px;
  --sticky-h: 68px;
  font-family: 'Tajawal', 'Segoe UI', Tahoma, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; line-height: 1.6; font-size: 16px; padding-bottom: calc(var(--sticky-h) + env(safe-area-inset-bottom)); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h2 { font-size: 1.4rem; font-weight: 800; }
[hidden] { display: none !important; }

main { max-width: 520px; margin: 0 auto; }

.topbar {
  background: var(--ink); color: #fff; text-align: center;
  font-size: .85rem; font-weight: 500; padding: .45rem 1rem;
}

/* ---------- العرض ---------- */
.hero { padding: 0 0 1.25rem; }
.brand { text-align: center; font-weight: 800; letter-spacing: .5px; margin: .6rem 0 0; }
.hero-media {
  position: relative; display: block; width: 100%; padding: 0; border: 0; background: #eee5e0;
  aspect-ratio: 4 / 5; max-height: 46vh; overflow: hidden; cursor: zoom-in;
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.pill {
  position: absolute; top: .75rem; right: .75rem; background: var(--accent); color: #fff;
  font-weight: 700; font-size: .85rem; padding: .25rem .7rem; border-radius: 999px;
}
.hero-text { padding: .8rem 1rem 0; text-align: center; }
.hero h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: .3rem; }
.sub { margin: 0 0 .35rem; font-size: 1.1rem; font-weight: 700; color: var(--accent-dark); }
.clarify { margin: 0 0 .8rem; color: var(--muted); font-size: .95rem; }
.trust { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.trust li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .75rem; font-size: .85rem; font-weight: 500; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 0; border-radius: 12px; font: inherit; font-weight: 800; text-decoration: none;
  cursor: pointer; padding: .7rem 1.2rem; transition: background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(214, 51, 108, .28); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: scale(.98); }
.btn-lg { font-size: 1.15rem; padding: .95rem 1.4rem; min-height: 56px; width: 100%; max-width: 380px; }
.btn-block { width: 100%; max-width: none; }
.btn[disabled] { opacity: .75; cursor: progress; }
.spinner { display: none; width: 20px; height: 20px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- الأقسام ---------- */
.section { padding: 1.5rem 1.1rem; }
.hint { color: var(--muted); font-size: .9rem; margin: 0 0 .75rem; }
.center { text-align: center; margin-top: .6rem; }

/* ---------- الصور ---------- */
.gallery {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: .6rem;
  scrollbar-width: none; border-radius: var(--radius);
}
.gallery::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 100%; scroll-snap-align: center; position: relative; margin: 0;
  border-radius: var(--radius); overflow: hidden; background: #eee5e0; aspect-ratio: 4 / 5;
}
.slide button { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide figcaption {
  position: absolute; bottom: .6rem; right: .6rem; background: rgba(255,255,255,.92);
  padding: .2rem .7rem; border-radius: 999px; font-weight: 700; font-size: .9rem;
}
.thumbs { display: flex; gap: .5rem; margin-top: .6rem; overflow-x: auto; scrollbar-width: none; }
.thumbs button {
  flex: 0 0 62px; height: 62px; padding: 0; border: 2px solid transparent; border-radius: 10px;
  overflow: hidden; background: #eee5e0; cursor: pointer;
}
.thumbs button[aria-selected="true"] { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.pack-box { margin-top: 1.25rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.pack-box h3 { font-size: 1.1rem; }
.facts, .features { list-style: none; padding: 0; margin: 0; }
.facts li, .features li { position: relative; padding: .35rem 1.6rem .35rem 0; }
.facts li::before, .features li::before { content: '✓'; position: absolute; right: 0; color: var(--accent); font-weight: 800; }
.features { border-top: 1px dashed var(--line); margin-top: .5rem; padding-top: .5rem; }

/* ---------- المقاسات ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: .6rem .7rem; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--accent-soft); font-weight: 700; }
tr:last-child td { border-bottom: 0; }

/* ---------- الفورم ---------- */
.order { scroll-margin-top: 8px; }
.card { background: var(--card); border-radius: 20px; padding: 1.25rem 1.1rem; box-shadow: 0 8px 30px rgba(60, 30, 40, .08); border: 1px solid var(--line); }
.field { border: 0; margin: 0 0 .95rem; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 700; margin-bottom: .35rem; padding: 0; }
.field input[type="text"], .field input[type="tel"] {
  width: 100%; font: inherit; font-size: 16px; padding: .8rem .9rem; min-height: 50px;
  border: 1.5px solid #ddd2cc; border-radius: 12px; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input[type="tel"] { text-align: right; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.invalid input { border-color: var(--err); }
.err { display: block; color: var(--err); font-size: .85rem; min-height: 0; margin-top: .25rem; }
.err:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-width: 56px; min-height: 46px;
  padding: .4rem .9rem; border: 1.5px solid #ddd2cc; border-radius: 12px; font-weight: 700; background: #fff;
}
.chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.color-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; flex-wrap: wrap; }
.color-row > b { min-width: 58px; font-size: .9rem; }
.color-row .chip span { min-height: 40px; min-width: 0; padding: .3rem .6rem; font-size: .9rem; }

.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
form { position: relative; }
html, body { overflow-x: clip; }

.summary { background: var(--accent-soft); border-radius: 14px; padding: .9rem 1rem; margin: .4rem 0 1rem; }
.summary-title { margin: 0 0 .4rem; font-weight: 800; }
.summary ul { list-style: none; margin: 0; padding: 0; }
.summary li { display: flex; justify-content: space-between; padding: .2rem 0; }
.summary .free { color: var(--ok); font-weight: 700; }
.summary .total { border-top: 1px dashed #e7b9c9; margin-top: .3rem; padding-top: .45rem; font-weight: 800; font-size: 1.1rem; }

.form-error { background: #fdecea; color: var(--err); border-radius: 12px; padding: .75rem .9rem; margin-bottom: .8rem; font-weight: 500; }

.success { text-align: center; outline: none; }
.check { width: 64px; height: 64px; margin: 0 auto .75rem; border-radius: 50%; background: var(--ok); color: #fff; font-size: 2rem; display: grid; place-items: center; }
.receipt { margin: 1rem 0; padding: 0; text-align: right; background: var(--bg); border-radius: 12px; }
.receipt div { display: flex; justify-content: space-between; padding: .55rem .9rem; border-bottom: 1px solid var(--line); }
.receipt div:last-child { border-bottom: 0; }
.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; font-weight: 800; }

/* ---------- الأسئلة ---------- */
details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: .6rem; }
summary { cursor: pointer; padding: .9rem 1rem; font-weight: 700; list-style: none; position: relative; padding-left: 2.2rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--accent); }
details[open] summary::after { content: '−'; }
details p { margin: 0; padding: 0 1rem .9rem; color: var(--muted); }

.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 1rem 1rem 1.5rem; }
.footer a { color: var(--accent-dark); }

/* ---------- الزر الثابت ---------- */
.sticky {
  position: fixed; inset: auto 0 0 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97);
  border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.06);
  transform: translateY(0); transition: transform .25s ease;
}
.sticky.is-hidden { transform: translateY(110%); }
.sticky-price { display: flex; flex-direction: column; line-height: 1.2; }
.sticky-price b { font-size: 1.2rem; color: var(--accent-dark); }
.sticky-price small { color: var(--muted); font-size: .78rem; }
.sticky .btn { padding: .8rem 1.4rem; font-size: 1.05rem; min-height: 48px; }

/* ---------- تكبير الصور ---------- */
.lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(15, 10, 12, .95); color: #fff; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(15, 10, 12, .95); }
.lightbox img { max-width: 100vw; max-height: 86vh; object-fit: contain; touch-action: pan-y pinch-zoom; }
.lb-close, .lb-nav { position: absolute; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 50%; width: 44px; height: 44px; font-size: 1.4rem; cursor: pointer; }
.lb-close { top: 12px; left: 12px; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 2rem; line-height: 1; }
.lb-prev { right: 8px; }
.lb-next { left: 8px; }
.lb-cap { position: absolute; bottom: 14px; inset-inline: 0; text-align: center; margin: 0; font-weight: 700; }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .sticky { display: none; }
  main { max-width: 560px; }
  .hero-media { max-height: 70vh; border-radius: 0 0 var(--radius) var(--radius); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
