/* ==========================================================================
   Kmandi / Kmenu — Design System
   A warm, ticket-and-tile identity: chalkboard ink, saffron accent,
   zellige teal, set on a torn-ticket rhythm that nods to order slips
   and table-tent QR cards.
   ========================================================================== */

:root {
  /* Palette */
  --ink: #1c1a16;
  --ink-2: #262119;
  --ink-3: #322b20;
  --cream: #f6efe1;
  --paper: #fbf7ee;
  --paper-dim: #efe6d4;
  --amber: #1C9BF7;
  --amber-deep: #094878;
  --zellige: #2f7370;
  --zellige-deep: #1f4f4d;
  --olive: #8a9b5e;
  --ink-muted: rgba(246, 239, 225, 0.66);
  --ink-faint: rgba(246, 239, 225, 0.4);
  --line: rgba(246, 239, 225, 0.14);
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.55);

  /* Type */
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  /* Rhythm */
  --radius: 18px;
  --radius-sm: 10px;
  --container: 1100px;
}

html[dir="rtl"] {
  --font-display: "Tajawal", "Fraunces", sans-serif;
  --font-body: "Tajawal", "Inter", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--ink-muted); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 88px 0; position: relative; }
section.tight { padding: 56px 0; }

/* ---------- background texture ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 10%, rgba(226, 150, 59, 0.08), transparent 45%),
    radial-gradient(circle at 85% 30%, rgba(47, 115, 112, 0.14), transparent 40%);
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

/* ---------- eyebrow / label ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--amber);
  display: inline-block;
}
html[dir="rtl"] .eyebrow::before { order: 2; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(28, 26, 22, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand img { width: 132px; height: auto; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-muted);
}
.nav-links a:hover { color: var(--cream); }
.nav-actions { display: flex; align-items: center; gap: 12px; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--cream);
  transition: border-color .2s ease, background .2s ease;
}
.lang-switch:hover { border-color: var(--amber); background: rgba(226,150,59,0.08); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14.5px;
  padding: 13px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--amber);
  color: var(--ink);
  box-shadow: 0 10px 24px -10px rgba(226, 150, 59, 0.6);
}
.btn-primary:hover { background: var(--amber-deep); box-shadow: 0 14px 30px -10px rgba(226, 150, 59, 0.75); }

.btn-ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--cream); }

.btn-teal {
  background: var(--zellige);
  color: var(--paper);
  box-shadow: 0 10px 24px -10px rgba(47, 115, 112, 0.6);
}
.btn-teal:hover { background: var(--zellige-deep); }

.btn-block { width: 100%; }

/* ---------- hero ---------- */
.hero {
  padding: 72px 0 96px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(34px, 5vw, 54px);
  color: var(--paper);
}
.hero h1 em {
  font-style: normal;
  color: var(--amber);
}
.hero p.lead {
  font-size: 17.5px;
  max-width: 46ch;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }

.badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  color: var(--ink-faint);
  font-size: 13px;
}
.badge-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ink-3);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  color: var(--amber);
  font-weight: 700;
}

/* ---------- signature: table-tent QR card ---------- */
.tent-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 20px;
}
.tent-card {
  width: min(100%, 300px);
  aspect-ratio: 3 / 4;
  background: linear-gradient(180deg, var(--paper), var(--paper-dim));
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 26px;
  position: relative;
  overflow: hidden;
  transform: rotate(-3deg);
}
.tent-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  box-shadow: inset 0 0 0 1px rgba(28,26,22,0.06);
}
.tent-qr {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--ink);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 4px;
  padding: 12px;
}
.tent-qr i {
  background: var(--paper);
  border-radius: 2px;
  opacity: 0.92;
}
.tent-qr i:nth-child(3n) { background: var(--amber); }
.tent-qr i:nth-child(7n) { background: transparent; }
.tent-qr::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -20%;
  height: 30%;
  background: linear-gradient(180deg, rgba(226,150,59,0) 0%, rgba(226,150,59,0.55) 50%, rgba(226,150,59,0) 100%);
  animation: scan 3.2s ease-in-out infinite;
}
@keyframes scan {
  0% { top: -20%; }
  50% { top: 90%; }
  100% { top: -20%; }
}
.tent-label {
  margin-top: 18px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
.tent-sub {
  color: var(--ink-3);
  opacity: 0.6;
  font-size: 12px;
  text-align: center;
  margin-top: 4px;
}
.tent-pin {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--zellige);
  box-shadow: var(--shadow);
}
@media (prefers-reduced-motion: reduce) {
  .tent-qr::before { animation: none; }
}

/* ---------- ticket divider (signature rhythm) ---------- */
.ticket-edge {
  height: 22px;
  width: 100%;
  background-image: radial-gradient(circle at 12px 0, transparent 11px, var(--ink) 12px);
  background-size: 24px 22px;
  background-repeat: repeat-x;
}
.ticket-edge.flip { transform: scaleY(-1); }
.on-paper .ticket-edge {
  background-image: radial-gradient(circle at 12px 0, transparent 11px, var(--paper) 12px);
}

/* ---------- sections on paper (light) ---------- */
.on-paper {
  background: var(--paper);
  color: var(--ink);
}
.on-paper h2, .on-paper h3 { color: var(--ink); }
.on-paper p { color: rgba(28,26,22,0.68); }
.on-paper .eyebrow { color: var(--amber-deep); }
.on-paper .eyebrow::before { background: var(--amber-deep); }

/* ---------- section heading block ---------- */
.section-head { max-width: 620px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); }

/* ---------- feature / benefit grid ---------- */
.grid {
  display: grid;
  gap: 20px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(226,150,59,0.4); }

.card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.card-icon img { width: 26px; height: 26px; object-fit: contain; }
.card h4 { font-size: 17px; color: var(--paper); margin-bottom: 8px; }
.card p { font-size: 14.5px; margin: 0; }

/* benefit checklist */
.checklist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 28px; color: #173837;}
.checklist li {
  list-style: none;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15.5px;
  color: #173837;
}
.checklist svg { flex: none; margin-top: 3px; color: #173837;}
.checklist { margin: 0; padding: 0; color: #173837;}

/* ---------- product teaser (Kmenu card on home) ---------- */
.teaser {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 44px;
  align-items: center;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 44px;
}
.teaser img.logo-tile { width: 100%; max-width: 220px; margin: 0 auto; }
.teaser .arrow-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--amber); font-weight: 700; font-size: 15px;
}
.teaser .arrow-link svg { transition: transform .2s ease; }
.teaser .arrow-link:hover svg { transform: translateX(4px); }
html[dir="rtl"] .teaser .arrow-link:hover svg { transform: translateX(-4px) scaleX(-1); }
html[dir="rtl"] .teaser .arrow-link svg { transform: scaleX(-1); }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--zellige-deep), var(--zellige));
  border-radius: 24px;
  padding: 52px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  color: var(--paper);
}
.cta-banner h3 { color: var(--paper); font-size: 24px; margin-bottom: 6px; }
.cta-banner p { color: rgba(251,247,238,0.78); margin: 0; }

/* ---------- partners / trust strip ---------- */
.trust-strip { text-align: center; }
.trust-strip img { max-width: 220px; margin: 24px auto 0; opacity: 0.92; }

/* ---------- video frame ---------- */
.video-frame {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  aspect-ratio: 16/9;
  max-width: 720px;
  margin: 0 auto;
}
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- footer ---------- */
footer {
  padding: 48px 0 40px;
  text-align: center;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 13.5px;
}
footer .foot-brand {
  font-family: var(--font-display);
  color: var(--cream);
  font-size: 15px;
  margin-bottom: 6px;
}
footer a.foot-credit { color: var(--amber); font-weight: 600; }

/* ---------- floating call button ---------- */
.float-call {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 60;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 30px -10px rgba(226,150,59,0.8);
  animation: pulse 2.4s ease-in-out infinite;
}
html[dir="rtl"] .float-call { right: auto; left: 26px; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 14px 30px -10px rgba(226,150,59,0.8); }
  50% { box-shadow: 0 14px 30px -6px rgba(226,150,59,1), 0 0 0 8px rgba(226,150,59,0.12); }
}
@media (prefers-reduced-motion: reduce) { .float-call { animation: none; } }

/* ---------- devis modal (kmenu.php) ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 13, 10, 0.72);
  backdrop-filter: blur(4px);
  z-index: 90;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--paper);
  color: var(--ink);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px 32px 28px;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-box h3 { color: var(--ink); font-size: 22px; }
.modal-box .modal-sub { color: rgba(28,26,22,0.6); font-size: 14px; margin-bottom: 20px; }
.modal-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(28,26,22,0.08);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
html[dir="rtl"] .modal-close { right: auto; left: 18px; }
.modal-close:hover { background: rgba(28,26,22,0.16); }

.field {
  width: 100%;
  padding: 13px 15px;
  margin: 0 0 12px;
  border: 1px solid rgba(28,26,22,0.14);
  border-radius: 10px;
  background: #fff;
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink);
}
.field:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(226,150,59,0.18); }

.field-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 14px 0 8px;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 6px;
}
.type-option {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid rgba(28,26,22,0.14);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.type-option:hover { border-color: var(--amber); }
.type-option input { accent-color: var(--amber-deep); }

.modal-submit {
  margin-top: 16px;
  background: var(--ink);
  color: var(--paper);
}
.modal-submit:hover { background: var(--ink-3); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero { text-align: center; }
  .hero p.lead { margin: 0 auto; }
  .hero-cta { justify-content: center; }
  .badge-row { justify-content: center; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .teaser { grid-template-columns: 1fr; text-align: center; }
  .checklist { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  section { padding: 60px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .cta-banner { flex-direction: column; text-align: center; }
  .nav-brand img { width: 108px; }
}
