@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Fraunces:opsz,wght@9..144,500;9..144,600&display=swap");

:root {
  --primary: #3e2417;
  --primary-dark: #241209;
  --accent: #c97b3d;
  --bg: #f3ecdd;
  --surface: #fffdf9;
  --text: #2b1810;
  --muted: #8c7a68;
  --outline: #e7dcc7;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px -12px rgba(43, 24, 16, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Cairo", -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body[dir="ltr"] {
  font-family: "Cairo", "Segoe UI", sans-serif;
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 90px;
}

/* ---------- Splash ---------- */
#splash {
  position: fixed;
  inset: 0;
  background: var(--primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#splash.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-mark {
  width: 84px;
  height: 84px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pour 1.4s ease-in-out infinite;
}
.splash-mark img,
.splash-mark svg {
  width: 46px;
  height: 46px;
  color: #fff;
}
.splash-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26px;
}
@keyframes pour {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
.splash-name {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.3px;
}
.splash-tag {
  font-size: 12px;
  opacity: 0.6;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ---------- Header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  padding: 16px 18px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-mark svg {
  width: 20px;
  height: 20px;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.brand-name {
  font-weight: 800;
  font-size: 17px;
}
.lang-btn {
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}


/* ---------- Banner carousel ---------- */
.carousel {
  margin: 14px 18px 6px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}
.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.slide {
  min-width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  color: #fff;
  position: relative;
  background-size: cover;
  background-position: center;
}
.slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.55) 100%);
}
.slide-title,
.slide-sub {
  position: relative;
  z-index: 1;
}
.slide-title {
  font-weight: 800;
  font-size: 19px;
  margin-bottom: 3px;
}
.slide-sub {
  font-size: 12.5px;
  opacity: 0.9;
}
.dots {
  position: absolute;
  bottom: 10px;
  inset-inline-end: 16px;
  display: flex;
  gap: 5px;
  z-index: 2;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: 0.3s;
}
.dot.active {
  background: #fff;
  width: 16px;
  border-radius: 4px;
}

/* ---------------- Category grid (home) ---------------- */
.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 18px;
}
.cat-card {
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 55%, var(--bg));
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
  padding: 26px 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: transform 0.15s ease;
}
.cat-card:active {
  transform: scale(0.97);
}
.cat-icon {
  color: var(--primary);
  opacity: 0.85;
}
.cat-icon svg {
  width: 40px;
  height: 40px;
  stroke-width: 1.3;
}
.cat-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

/* ---------------- Sub pages (section / about / contact) ---------------- */
.sub-header {
  position: sticky;
  top: 0;
  z-index: 15;
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 6px;
}
.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px 8px 10px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
body[dir="rtl"] .back-btn {
  padding: 8px 10px 8px 14px;
}
.back-btn svg {
  width: 16px;
  height: 16px;
}
.sub-title {
  font-weight: 800;
  font-size: 16.5px;
}
.static-page {
  padding: 18px;
}
.about-body p {
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--text);
  margin: 0 0 12px;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-md);
  padding: 14px;
  text-decoration: none;
  color: inherit;
}
.contact-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-icon svg {
  width: 19px;
  height: 19px;
}
.contact-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.contact-text b {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.contact-text span:last-child {
  font-size: 13.5px;
  font-weight: 600;
  word-break: break-word;
}
.social-block {
  margin-top: 6px;
}
.social-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
}
.social-row {
  display: flex;
  gap: 10px;
}
.social-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.social-btn svg {
  width: 20px;
  height: 20px;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 36px);
  max-width: 444px;
  background: var(--primary);
  border-radius: 999px;
  display: flex;
  justify-content: space-around;
  padding: 10px 8px;
  box-shadow: var(--shadow);
  z-index: 20;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10.5px;
  font-weight: 700;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
}
.nav-item svg {
  width: 18px;
  height: 18px;
}
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

@media (min-width: 481px) {
  body {
    background: var(--primary-dark);
  }
  .app-shell {
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.35);
  }
}

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

.load-error {
  position: fixed;
  inset: 0;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}
.load-error-box {
  max-width: 340px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  box-shadow: var(--shadow);
}
.load-error-msg {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text);
  margin: 0 0 18px;
}
.load-error-btn {
  border: none;
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 13.5px;
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
}


.carousel-track {
  will-change: transform;
}
.dots .dot {
  border: 0;
  padding: 0;
  height: 7px;
  min-width: 7px;
  cursor: pointer;
}
.view {
  width: 100%;
}

/* ---------- Menu item grid ---------- */
.section-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 8px 14px 24px;
  align-items: start;
}

.item-card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(43, 24, 16, 0.08);
  display: flex;
  flex-direction: column;
}

.item-card.unavailable {
  opacity: 0.62;
}

.item-thumb {
  width: 100%;
  aspect-ratio: 1 / 0.82;
  overflow: hidden;
  background: #eee5d6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.item-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.item-thumb svg {
  width: 34px;
  height: 34px;
  opacity: 0.65;
}

.item-body {
  min-width: 0;
  padding: 10px 10px 12px;
}

.item-top {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.item-name {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 800;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 39px;
}

.item-price {
  color: var(--accent);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 34px;
}

.badge {
  display: inline-block;
  max-width: 100%;
  margin-top: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(201, 123, 61, 0.12);
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 30px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 360px) {
  .section-block {
    gap: 9px;
    padding-inline: 10px;
  }

  .item-body {
    padding: 8px 8px 10px;
  }

  .item-name {
    font-size: 12px;
    min-height: 36px;
  }

  .item-price {
    font-size: 12px;
  }

  .item-desc {
    font-size: 10px;
  }
}

.lang-switch{display:flex;align-items:center;gap:8px;padding:6px 10px;background:var(--surface);border:1px solid var(--outline);border-radius:999px;box-shadow:0 3px 12px rgba(43,24,16,.06)}
.lang-switch>span{color:var(--muted);font-size:12px}
.lang-option{border:0;background:transparent;color:var(--muted);font:inherit;font-weight:700;font-size:13px;padding:8px 10px;border-radius:999px;cursor:pointer;line-height:1}
.lang-option.active{background:var(--primary);color:#fff}
.lang-option:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
