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

:root {
  --bg: rgb(238, 232, 220);
  --card: #eee8dc;
  --primary: #444b3b;
  --accent: #424b3a;
  --accent-dark: #a88838;
  --text: #444b3b;
  --muted: #6a6f60;
  --border: #e8d9b5;
  --shadow: 0 6px 24px rgba(68,75,59,0.08);
  --shadow-lg: 0 12px 40px rgba(68,75,59,0.14);
}

body {
  font-family: 'Cairo', system-ui, sans-serif;
  background: #e9e5d8;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* Top empty header (part of page flow — scrolls away naturally) */
.top-bar {
  position: relative;
  width: 100%;
  height: 64px;
  background: #e9e5d8;
}

/* Language toggle — circular black-bordered button inside top bar */
.lang-toggle {
  position: absolute;
  top: 10px;
  left: 14px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9e5d8;
  color: #424b3a;
  border: 2px solid #000;
  border-radius: 50%;
  padding: 4;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.lang-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

/* Banner */
.banner {
  position: relative;
  width: 100%;
  height: 240px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--bg);
  overflow: hidden;
}
.banner-overlay { display: none; }
.banner-content { display: none; }

/* Welcome */
.welcome {
  text-align: center;
  padding: 36px 20px 18px;
  max-width: 700px;
  margin: 0 auto;
}
.welcome h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
}
.welcome p { color: var(--muted); font-size: 1rem; }

/* Social */
.social-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  padding: 26px 20px 30px;
}
.social-row::before,
.social-row::after {
  content: "";
  flex: 1;
  height: 0.5px;
  background: var(--primary);
  max-width: 80px;
  border-radius: 2px;
}
.social-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: transform 0.2s, background 0.2s, color 0.2s;
  color: var(--primary);
  flex-shrink: 0;
}
.social-btn:hover {
  transform: translateY(-3px);
  background: var(--primary);
  color: var(--bg);
}
.social-btn svg { width: 20px; height: 20px; }

/* Sticky category nav */
.cat-nav {
  position: sticky;
  top: 0;
  background: #e9e5d8 ;
  backdrop-filter: blur(10px);
  border-top: 1px solid #424b3a;
  border-bottom: 1px solid #424b3a;
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
  z-index: 50;
  scrollbar-width: thin;
}
.cat-nav button {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.cat-nav button:hover { border-color: var(--accent); color: var(--accent-dark); }
.cat-nav button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}


/* Menu sections */
.menu-root { max-width: 1100px; margin: 0 auto; padding: 36px 20px 60px; }
.loader { text-align: center; padding: 60px; color: var(--muted); }

.category { margin-bottom: 52px; scroll-margin-top: 80px; }
.category.cat-hidden { display: none; }
.cat-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 26px;
}
.cat-header::before,
.cat-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  max-width: 130px;
}
.cat-header .icon { font-size: 1.8rem; }
.cat-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.item-card {
  background: var(--card);
  border-radius: 0px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}
.item-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.item-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f5efe2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.item-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.item-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.item-name { font-size: 1.1rem; font-weight: 700; }
.riyal-icon {
  display: inline-block;
  height: 0.95em;
  width: auto;
  vertical-align: -0.12em;
  margin-inline-start: 4px;
}
.item-price {
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 1.05rem;
  white-space: nowrap;
}
.item-desc { color: var(--muted); font-size: 0.9rem; flex: 1; }
.item-cal {
  display: inline-block;
  align-self: flex-start;
  margin-top: 6px;
  color: #c0392b;
  background: rgba(192, 57, 43, 0.08);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}

/* Product detail modal */
.item-card { cursor: pointer; }
.product-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.product-modal.hidden { visibility: hidden; }
.product-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: auto;
}
.product-modal:not(.hidden) .product-modal-backdrop { opacity: 1; }
.product-modal-box {
  position: relative;
  background: var(--bg);
  width: 100%;
  max-width: 520px;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.18);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(.2,.8,.2,1);
  pointer-events: auto;
  overflow: hidden;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.product-modal:not(.hidden) .product-modal-box { transform: translateY(0); }
.product-modal-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  width: 34px;
  height: 34px;
  border-radius: 0%;
  border: none;
  background: rgba(255,255,255,0.85);
  color: var(--primary);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.product-modal-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f5efe2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-modal-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-modal-img.no-img { display: none; }
.product-modal-body { padding: 22px 22px 26px; overflow-y: auto; }
.product-modal-name { font-size: 1.45rem; font-weight: 800; margin-bottom: 8px; }
.product-modal-price {
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 14px;
}
.product-modal-desc {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
  margin-bottom: 14px;
  white-space: pre-wrap;
}
.product-modal-desc:empty { display: none; }
.product-modal-cal {
  display: inline-block;
  color: #c0392b;
  background: rgba(192,57,43,0.08);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
}
.product-modal-cal:empty { display: none; }

/* Center modal on tablet+ */
@media (min-width: 720px) {
  .product-modal { align-items: center; }
  .product-modal-box {
    border-radius: 18px;
    max-width: 560px;
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    transition: transform 0.25s, opacity 0.25s;
  }
  .product-modal:not(.hidden) .product-modal-box {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
body.modal-open { overflow: hidden; }


.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.foot {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* Tablet & small laptops */
@media (max-width: 768px) {
  .banner { height: 200px; }
  .menu-root { padding: 32px 18px 50px; }
  .category { margin-bottom: 40px; }
  .items-grid { gap: 16px; }
}

/* Phones */
@media (max-width: 600px) {
  .banner { height: 160px; }
  .welcome { padding: 26px 16px 14px; }
  .welcome h2 { font-size: 1.35rem; }
  .welcome p { font-size: 0.92rem; }
  .social-row { gap: 10px; padding: 20px 16px 24px; }
  .social-row::before, .social-row::after { max-width: 90px; }
  .social-btn { width: 38px; height: 38px; }
  .social-btn svg { width: 17px; height: 17px; }
  .cat-nav { padding: 10px 14px; }
  .cat-nav button { padding: 7px 14px; font-size: 0.88rem; }
  .cat-header { gap: 10px; margin-bottom: 20px; }
  .cat-header::before, .cat-header::after { max-width: 60px; }
  .cat-header .icon { font-size: 1.4rem; }
  .cat-header h2 { font-size: 1.25rem; letter-spacing: 0.5px; }
  .menu-root { padding: 26px 12px 40px; }
  .items-grid { gap: 0px; }
  .item-card { border-radius: 12px; }
  .item-body { padding: 12px 12px 14px; }
  .item-row { margin-bottom: 4px; }
  .item-name { font-size: 0.95rem; }
  .item-price { font-size: 0.9rem; }
  .item-desc { font-size: 0.8rem; line-height: 1.5; }
  .item-cal { font-size: 0.65rem; padding: 1px 7px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .banner { height: 130px; }
  .items-grid { gap: 10px; }
  .item-body { padding: 10px 10px 12px; }
  .item-name { font-size: 0.88rem; }
  .item-price { font-size: 0.85rem; }
  .item-desc { font-size: 0.75rem; }
  .cat-nav button { padding: 6px 12px; font-size: 0.82rem; }
}
