/* ─── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ─── VARIABLES ───────────────────────────────────────────────────────────── */
:root {
  --bg:         #080808;
  --surface:    #111111;
  --surface-2:  #181818;
  --border:     #1E1E1E;
  --border-2:   #282828;
  --red:        #C41E1E;
  --red-h:      #E02424;
  --red-dim:    rgba(196, 30, 30, 0.12);
  --red-glow:   rgba(196, 30, 30, 0.38);
  --white:      #FFFFFF;
  --text:       #F0F0F0;
  --text-2:     #AAAAAA;
  --text-3:     #555555;
  --wa:         #25D366;
  --wa-h:       #1FB958;

  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-arabic:  'Cairo', sans-serif;

  --header-h: 64px;
  --strip-h:  34px;
  --nav-h:    52px;
  --top-offset: calc(var(--header-h) + var(--strip-h) + var(--nav-h));

  --radius:    14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-card: 0 2px 16px rgba(0,0,0,0.45);
  --transition: 0.2s ease;
}

/* ─── HEADER ──────────────────────────────────────────────────────────────── */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  background: #080808;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.logo-cleaver { height: 36px; width: auto; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-name {
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--red);
  letter-spacing: 0.02em;
  font-style: italic;
}
.logo-tagline {
  font-family: var(--font-display);
  font-size: 0.6rem;
  color: var(--text-2);
  letter-spacing: 0.18em;
  margin-top: 2px;
}

.cart-btn {
  position: relative;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-2);
  transition: background var(--transition), border-color var(--transition);
}
.cart-btn:hover { background: var(--surface-2); border-color: var(--red); }
.cart-btn:active { transform: scale(0.94); }

.cart-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px;
  background: var(--red);
  color: white;
  font-size: 11px; font-weight: 700;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--bg);
  animation: badge-pop 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes badge-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* ─── INFO STRIP ──────────────────────────────────────────────────────────── */
.info-strip {
  position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 99;
  height: var(--strip-h);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--red);
  font-size: 0.75rem; font-weight: 500;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.02em;
}
.strip-dot { opacity: 0.6; }
.strip-link { color: white; font-weight: 700; }
.strip-link:hover { text-decoration: underline; }

/* ─── CATEGORY NAV ────────────────────────────────────────────────────────── */
.cat-nav {
  position: sticky;
  top: calc(var(--header-h) + var(--strip-h));
  z-index: 98;
  height: var(--nav-h);
  display: flex; align-items: center;
  gap: 8px;
  padding: 0 16px;
  overflow-x: auto; overflow-y: hidden;
  background: #080808;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  font-size: 0.82rem; font-weight: 500;
  color: var(--text-2);
  background: transparent;
  white-space: nowrap;
  transition: all var(--transition);
}
.cat-tab:hover { border-color: var(--red); color: var(--text); }
.cat-tab.active {
  background: var(--red);
  border-color: var(--red);
  color: white;
  box-shadow: 0 0 18px var(--red-glow);
}
.tab-icon { font-size: 0.9rem; }

/* ─── MENU MAIN ───────────────────────────────────────────────────────────── */
.menu-main {
  margin-top: var(--top-offset);
  min-height: calc(100vh - var(--top-offset));
  padding: 0 0 80px;
}

/* ─── CATEGORY SECTION HEADER ─────────────────────────────────────────────── */
.cat-section-header {
  display: flex; align-items: baseline; gap: 12px;
  padding: 28px 18px 14px;
}
.cat-section-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.06em;
  color: var(--red);
  text-transform: uppercase;
}
.cat-section-arabic {
  font-family: var(--font-arabic);
  font-size: 1rem;
  color: var(--text-3);
  font-weight: 600;
}

/* ─── MENU GRID ───────────────────────────────────────────────────────────── */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 12px 8px;
}

/* ─── MENU CARD ───────────────────────────────────────────────────────────── */
.menu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: default;
}
.menu-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--red-dim);
  border-color: #2A2A2A;
}

/* Card image area */
.card-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.menu-card:hover .card-img { transform: scale(1.04); }
.card-img-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(145deg, #140808 0%, #1E0C0C 50%, #140808 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  color: var(--text-3);
}

/* Quantity badge on card */
.card-qty-badge {
  position: absolute; bottom: 8px; left: 8px;
  background: var(--red);
  color: white;
  font-size: 11px; font-weight: 700;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
  animation: badge-pop 0.2s cubic-bezier(0.34,1.56,0.64,1);
}

/* Card body */
.card-body {
  flex: 1;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 11px 12px 12px;
  gap: 8px;
}
.card-names { flex: 1; }
.card-name {
  font-size: 0.85rem; font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.card-name-ar {
  font-family: var(--font-arabic);
  font-size: 0.78rem; font-weight: 500;
  color: var(--text-3);
  margin-top: 3px;
  direction: rtl;
}
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
}
.card-price {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.03em;
  color: var(--white);
  white-space: nowrap;
}

/* Add button */
.add-btn {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), transform 0.12s;
}
.add-btn:hover { background: var(--red-h); }
.add-btn:active { transform: scale(0.88); }
.add-btn.added {
  animation: add-pulse 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes add-pulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 var(--red-glow); }
  50%  { transform: scale(1.22); box-shadow: 0 0 0 8px transparent; }
  100% { transform: scale(1);    box-shadow: none; }
}

/* ─── SKELETON LOADING ────────────────────────────────────────────────────── */
.skeleton-wrap { padding: 12px; }
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.skel-card {
  height: 220px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite ease-in-out;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── EMPTY STATE ─────────────────────────────────────────────────────────── */
.empty-state {
  padding: 64px 24px;
  text-align: center;
  color: var(--text-2);
}
.empty-state p { font-size: 1rem; line-height: 1.7; margin-bottom: 20px; }
.empty-call {
  display: inline-block;
  padding: 12px 24px;
  background: var(--red);
  color: white;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ─── CART OVERLAY ────────────────────────────────────────────────────────── */
.cart-overlay {
  position: fixed; inset: 0; z-index: 199;
  background: rgba(0,0,0,0.72);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.cart-overlay.visible { opacity: 1; pointer-events: all; }

/* ─── CART DRAWER ─────────────────────────────────────────────────────────── */
.cart-drawer {
  position: fixed; top: 0; right: -420px; z-index: 200;
  width: 400px; max-width: 100vw;
  height: 100dvh;
  background: #0E0E0E;
  border-left: 1px solid var(--border-2);
  display: flex; flex-direction: column;
  transition: right 0.36s cubic-bezier(0.32, 0.72, 0, 1);
}
.cart-drawer.open { right: 0; }
/* Red top accent */
.cart-drawer::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--red);
  box-shadow: 0 0 20px var(--red-glow);
}

.cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  color: var(--text);
}
.cart-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.cart-close:hover { background: var(--border-2); color: var(--text); }

/* Cart body (scrollable) */
.cart-body { flex: 1; overflow-y: auto; padding: 12px 16px; scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
.cart-body::-webkit-scrollbar { width: 4px; }
.cart-body::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

.cart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 60px 0; text-align: center;
}
.cart-empty p { font-size: 1rem; color: var(--text-2); }
.cart-empty span { font-size: 0.82rem; color: var(--text-3); }

/* Cart items */
.cart-list { display: flex; flex-direction: column; gap: 2px; }
.cart-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }

.ci-info { flex: 1; min-width: 0; }
.ci-name { font-size: 0.88rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-name-ar { font-family: var(--font-arabic); font-size: 0.75rem; color: var(--text-3); direction: rtl; }

.ci-controls {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.qty-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  font-size: 1rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  line-height: 1;
}
.qty-btn:hover { background: var(--border-2); border-color: var(--red); }
.qty-num { font-size: 0.9rem; font-weight: 700; color: var(--text); min-width: 18px; text-align: center; }

.ci-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.ci-price { font-family: var(--font-display); font-size: 0.95rem; color: var(--white); letter-spacing: 0.03em; }
.ci-remove {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.ci-remove:hover { background: rgba(196,30,30,0.15); color: var(--red); }

/* Cart footer */
.cart-foot {
  padding: 16px 20px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.total-label { font-size: 0.9rem; color: var(--text-2); font-weight: 500; }
.total-price { font-family: var(--font-display); font-size: 1.4rem; color: var(--white); letter-spacing: 0.04em; }

.wa-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px;
  background: var(--wa);
  color: white;
  font-size: 0.95rem; font-weight: 700;
  border-radius: var(--radius);
  transition: background var(--transition), transform 0.12s;
  letter-spacing: 0.02em;
}
.wa-btn:hover { background: var(--wa-h); }
.wa-btn:active { transform: scale(0.98); }

/* ─── FOOTER ──────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 40px 24px 32px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 0.82rem;
  line-height: 2;
}
.footer-logo { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-bottom: 8px; }
.footer-name { font-family: 'Cairo', sans-serif; font-style: italic; font-size: 1.4rem; font-weight: 700; color: var(--red); }
.footer-sub { font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.2em; color: var(--text-3); }
.footer-copy { margin-top: 8px; font-size: 0.75rem; color: var(--text-3); opacity: 0.5; }

/* ─── RESPONSIVE — MOBILE ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  :root { --header-h: 58px; --strip-h: 30px; --nav-h: 48px; }

  .logo-name { font-size: 1.1rem; }
  .logo-cleaver { height: 30px; }

  /* Cart slides from bottom on mobile */
  .cart-drawer {
    width: 100%; right: auto !important;
    top: auto; bottom: -100%;
    height: 88dvh;
    border-left: none;
    border-top: 1px solid var(--border-2);
    border-radius: 20px 20px 0 0;
    transition: bottom 0.36s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .cart-drawer::before { border-radius: 20px 20px 0 0; }
  .cart-drawer.open { bottom: 0; right: auto !important; }

  .cart-foot { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}

/* ─── RESPONSIVE — TABLET + DESKTOP ──────────────────────────────────────── */
@media (min-width: 640px) {
  .menu-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 0 16px 12px; }
  .cat-section-title { font-size: 2rem; }
  .cat-section-header { padding: 32px 20px 16px; }
}
@media (min-width: 1024px) {
  .menu-main { max-width: 1100px; margin-left: auto; margin-right: auto; }
  .menu-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .card-name { font-size: 0.9rem; }
}
