:root {
  --green: #006d3e;
  --green-deep: #004d2c;
  --green-soft: rgba(0, 109, 62, 0.1);
  --orange: #f89a2e;
  --orange-hot: #e88712;
  --orange-soft: rgba(248, 154, 46, 0.16);
  --ink: #14241c;
  --muted: #5a6b61;
  --paper: #f3f6f2;
  --white: #ffffff;
  --line: rgba(20, 36, 28, 0.1);
  --shadow: 0 16px 40px rgba(0, 77, 44, 0.12);
  --radius: 18px;
  --header-h: 64px;
  --max: 1120px;
  --font-display: "Oswald", "Tajawal", sans-serif;
  --font-body: "DM Sans", "Tajawal", sans-serif;
  --font-ar: "Tajawal", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

html[lang="ar"] body {
  font-family: var(--font-ar);
}

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

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

button {
  font: inherit;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--orange);
  border-bottom: 1px solid rgba(0, 77, 44, 0.12);
  box-shadow: 0 4px 18px rgba(232, 135, 18, 0.2);
}

.site-header-inner {
  width: min(var(--max), calc(100% - 1.5rem));
  margin: 0 auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 44px;
  width: auto;
  max-width: min(160px, 48vw);
  object-fit: contain;
}

.lang-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1.5px solid var(--green);
  border-radius: 50%;
  background: transparent;
  color: var(--green);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lang-toggle > span {
  display: block;
  line-height: 1;
  transform: translateY(1px);
}

.lang-toggle:hover {
  background: rgba(0, 109, 62, 0.1);
  border-color: var(--green-deep);
  color: var(--green-deep);
}

.lang-toggle:active {
  transform: scale(0.97);
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: min(88vh, 720px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--green-deep);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
  animation: hero-zoom 8s ease-out forwards;
}

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 49, 28, 0.25) 0%, rgba(0, 49, 28, 0.72) 55%, rgba(0, 49, 28, 0.92) 100%),
    linear-gradient(90deg, rgba(0, 77, 44, 0.55) 0%, transparent 55%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 3.5rem 0 3rem;
  color: var(--white);
  animation: rise 0.9s ease-out both;
}

.hero-brand {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--orange);
}

html[lang="ar"] .hero-brand {
  font-family: var(--font-ar);
  letter-spacing: 0.08em;
}

.hero-title {
  margin: 0 0 0.85rem;
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

html[lang="ar"] .hero-title {
  font-family: var(--font-ar);
  font-weight: 800;
  max-width: 12ch;
}

.hero-sub {
  margin: 0 0 1.5rem;
  max-width: 34ch;
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: rgba(255, 255, 255, 0.88);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.5rem;
  border-radius: 999px;
  background: var(--orange);
  color: var(--ink);
  font-weight: 700;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-cta:hover {
  background: var(--orange-hot);
  transform: translateY(-1px);
}

/* —— Menu —— */
.menu-main {
  width: min(var(--max), calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

.menu-intro {
  margin-bottom: 1.75rem;
  animation: rise 0.7s 0.15s ease-out both;
}

.menu-heading {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.04em;
}

html[lang="ar"] .menu-heading {
  font-family: var(--font-ar);
  letter-spacing: 0;
}

.menu-lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.items-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

@media (min-width: 720px) {
  .items-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.35rem;
  }
}

.empty-state {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted);
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.item-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise 0.65s ease-out both;
}

.item-card:nth-child(1) { animation-delay: 0.08s; }
.item-card:nth-child(2) { animation-delay: 0.16s; }
.item-card:nth-child(3) { animation-delay: 0.24s; }
.item-card:nth-child(4) { animation-delay: 0.32s; }

.item-image-wrap {
  aspect-ratio: 4 / 3;
  background: var(--green-deep);
  overflow: hidden;
}

.item-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.item-card:hover .item-image-wrap img {
  transform: scale(1.04);
}

.item-image-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.7);
  background:
    linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%);
}

.item-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.1rem 1.15rem 1.2rem;
  flex: 1;
}

.item-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 650;
  color: var(--green-deep);
  letter-spacing: 0.02em;
}

html[lang="ar"] .item-name {
  font-family: var(--font-ar);
  font-weight: 800;
}

.item-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-price-single {
  margin: 0.15rem 0 0;
  font-weight: 700;
  color: var(--orange-hot);
  font-size: 1.05rem;
}

.card-footer {
  margin-top: auto;
  padding-top: 0.65rem;
}

.add-btn,
.add-confirm-btn,
.checkout-btn,
.qty-btn,
.remove-line,
.close-cart,
.close-add {
  cursor: pointer;
  border: none;
  background: none;
}

.add-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  font-weight: 700;
  transition: background 0.2s ease, transform 0.15s ease;
}

.add-btn:hover {
  background: var(--green-deep);
}

.add-btn:active {
  transform: scale(0.98);
}

/* —— Footer —— */
.site-footer {
  padding: 1.5rem;
  text-align: center;
  background: var(--green);
  color: rgba(255, 255, 255, 0.85);
  border-top: 3px solid var(--orange);
}

.site-footer p {
  margin: 0;
  font-size: 0.92rem;
}

/* —— Cart FAB —— */
.cart-fab {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(248, 154, 46, 0.45);
  display: none;
  place-items: center;
  transition: transform 0.2s ease;
}

html[dir="rtl"] .cart-fab {
  right: auto;
  left: 1rem;
}

.cart-fab.visible {
  display: grid;
  animation: pop 0.35s ease;
}

.cart-fab:hover {
  transform: scale(1.05);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

html[dir="rtl"] .cart-badge {
  right: auto;
  left: -4px;
}

/* —— Cart panel —— */
.cart-overlay,
.add-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 28, 18, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.cart-overlay.open,
.add-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  width: min(400px, 100%);
  height: 100%;
  background: var(--white);
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.28s ease;
  box-shadow: var(--shadow);
}

html[dir="rtl"] .cart-panel {
  right: auto;
  left: 0;
  transform: translateX(-105%);
}

.cart-panel.open,
html[dir="rtl"] .cart-panel.open {
  transform: translateX(0);
}

.cart-panel-body {
  flex: 1;
  overflow: auto;
  padding: 1.15rem;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.cart-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--green);
}

html[lang="ar"] .cart-title {
  font-family: var(--font-ar);
}

.close-cart,
.close-add {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  background: var(--paper);
}

.cart-empty {
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
}

.cart-line {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.line-name {
  margin: 0 0 0.2rem;
  font-weight: 700;
}

.line-tier {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.line-subtotal {
  margin: 0;
  font-weight: 700;
  color: var(--orange-hot);
}

.line-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.qty-controls,
.add-qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--paper);
  border-radius: 999px;
  padding: 0.2rem;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--line);
  font-weight: 700;
  color: var(--green);
}

.remove-line {
  font-size: 0.8rem;
  color: #b42318;
  text-decoration: underline;
}

.cart-footer {
  padding: 1rem 1.15rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--white);
}

.cart-total-row,
.add-modal-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  font-weight: 700;
}

.checkout-btn,
.add-confirm-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 999px;
  background: var(--orange);
  color: var(--ink);
  font-weight: 700;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.checkout-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.checkout-btn:not(:disabled):hover,
.add-confirm-btn:hover {
  background: var(--orange-hot);
}

/* —— Add modal —— */
body.modal-open {
  overflow: hidden;
}

.add-modal {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 80;
  width: min(520px, 100%);
  max-height: min(90vh, 720px);
  background: var(--white);
  border-radius: 20px 20px 0 0;
  transform: translate(-50%, 110%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.add-modal.open {
  transform: translate(-50%, 0);
}

.add-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem 0.5rem;
}

.add-modal-title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--green);
}

.add-modal-body {
  overflow: auto;
  padding: 0.5rem 1.1rem 1rem;
}

.add-modal-hero {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 1rem;
}

.add-modal-thumb {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  object-fit: cover;
}

.add-modal-thumb.placeholder {
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.add-modal-name {
  margin: 0 0 0.25rem;
  font-weight: 700;
}

.add-modal-base-price {
  margin: 0;
  color: var(--orange-hot);
  font-weight: 700;
}

.option-group {
  margin-bottom: 1rem;
}

.option-group-label {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.option-pill {
  min-height: 38px;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.option-pill.active {
  border-color: var(--green);
  background: var(--green);
  color: var(--white);
}

.option-delta {
  opacity: 0.85;
  font-size: 0.85em;
}

.add-modal-footer {
  padding: 0.85rem 1.1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}

.add-modal-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: center;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-zoom {
  from { transform: scale(1.08); }
  to { transform: scale(1.02); }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
