/* ==========================================================================
   foodpanda design clone — shared styles (header, footer, buttons, cards)
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-200: #bfdbfe;
  --primary-100: #dbeafe;
  --primary-50: #eff6ff;
  --secondary: #16a34a;
  --secondary-dark: #15803d;
  --secondary-100: #dcfce7;
  --secondary-50: #f0fdf4;
  --text: #2b2b2b;
  --text-2: #4f4f4f;
  --muted: #767676;
  --line: #e8e8e8;
  --bg: #ffffff;
  --bg-2: #f5f5f5;
  --amber: #f59e0b;
  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 16px;
  --radius-xl: 24px;
  --shadow-s: 0 1px 3px rgba(0, 0, 0, .08);
  --shadow: 0 4px 16px rgba(0, 0, 0, .08);
  --shadow-l: 0 12px 32px rgba(0, 0, 0, .14);
  --font: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --container: 1200px;
  --header-h: 72px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
h1, h2, h3, h4, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-right, 0px)) 0 max(var(--gutter), env(safe-area-inset-left, 0px)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  font-weight: 700; font-size: 15px; border: 2px solid transparent; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 6px 16px rgba(37, 99, 235, .25); transform: translateY(-1px); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: var(--secondary-dark); box-shadow: 0 6px 16px rgba(22, 163, 74, .25); transform: translateY(-1px); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: #fff; }
.btn-outline:hover { background: var(--primary-50); }
.btn-ghost { color: var(--primary); }
.btn-ghost:hover { background: var(--primary-50); }
.btn-light { background: var(--bg-2); color: var(--text); }
.btn-light:hover { background: #ececec; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
:is(a, button, input, textarea, [tabindex]):focus-visible { outline: 3px solid var(--primary-200); outline-offset: 2px; }
.btn svg { width: 18px; height: 18px; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-2); color: var(--text); }
.icon-btn svg { width: 22px; height: 22px; }

.link { color: var(--primary); font-weight: 700; }
.section-head .link { padding: 10px 0; margin: -10px 0; }
.link:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; box-shadow: 0 1px 0 var(--line); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 16px; }
.logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
.logo img { height: 66px; width: auto; display: block; }
.site-footer .logo img { height: 80px; }
.mobile-nav .logo img { height: 48px; }
.nav-toggle { display: none; }
.header-nav { display: flex; gap: 4px; margin-left: 12px; }
.header-nav a { padding: 8px 14px; border-radius: 999px; font-weight: 700; color: var(--text-2); transition: .15s; }
.header-nav a:hover { background: var(--primary-50); color: var(--primary); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang-switch button { padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: 13px; color: var(--muted); transition: .15s; }
.lang-switch button.active { background: var(--primary-100); color: var(--primary); }
.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px #fff;
}
.cart-count.pop { animation: badgePop .35s ease-out; }
@keyframes badgePop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* mobile drawer nav */
.mobile-nav { position: fixed; inset: 0; z-index: 60; display: none; }
.mobile-nav.open { display: block; }
.mobile-nav .backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.mobile-nav .panel {
  position: absolute; top: 0; left: 0; bottom: 0; width: 300px; max-width: 86%; background: #fff;
  padding: 20px 20px max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 10px; overflow: auto; overscroll-behavior: contain; animation: slideIn .25s ease-out;
}
.mobile-nav .panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mobile-nav .panel .btn { width: 100%; }
.mobile-nav .panel ul { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.mobile-nav .panel li a { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-radius: 10px; font-weight: 700; }
.mobile-nav .panel li a:hover { background: var(--primary-50); color: var(--primary); }
.mobile-nav .panel li a span.em { font-size: 20px; width: 28px; text-align: center; }
@keyframes slideIn { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-title { font-size: 28px; font-weight: 800; letter-spacing: -.4px; line-height: 1.2; }
.section-sub { color: var(--muted); margin-top: 4px; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--bg-2); font-weight: 700; font-size: 14px; white-space: nowrap; transition: .15s; cursor: pointer;
}
.chip:hover { background: #ececec; }
.chip.active { background: var(--primary-100); color: var(--primary); }
.chip-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }

/* ---------- Footer ---------- */
.site-footer { background: #fafafa; border-top: 1px solid var(--line); padding: 48px 0 24px; margin-top: 40px; color: var(--text-2); }
.footer-top { display: grid; grid-template-columns: 1.1fr 2fr; gap: 40px; }
.footer-brand p { margin: 12px 0 16px; max-width: 320px; }
.social { display: flex; gap: 10px; }
.social a {
  width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--text-2); transition: .15s;
}
.social a:hover { color: var(--primary); border-color: var(--primary); }
.social svg { width: 18px; height: 18px; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 24px; }
.footer-cols h4 { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 12px; }
.footer-cols li { margin-bottom: 8px; font-size: 14px; }
.footer-cols a:hover { color: var(--primary); }
.footer-visit li { display: flex; gap: 10px; align-items: flex-start; }
.footer-visit svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--primary); margin-top: 2px; }
.footer-visit b { color: var(--text); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px;
  border-top: 1px solid var(--line); font-size: 13px;
}
.footer-legal { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-legal a:hover { color: var(--primary); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px);
  background: #2b2b2b; color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 100; box-shadow: var(--shadow-l);
  width: max-content; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.modal-dialog {
  position: relative; background: #fff; border-radius: 20px; width: 100%; max-width: 520px;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
  box-shadow: var(--shadow-l); animation: popIn .2s ease-out; outline: 0;
}
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 2; background: #fff; box-shadow: var(--shadow); }
.modal-close:hover { background: var(--bg-2); }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Quantity stepper ---------- */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; height: 36px; background: #fff; flex: 0 0 auto; }
.qty button { width: 36px; height: 34px; display: grid; place-items: center; color: var(--primary); font-weight: 800; font-size: 18px; border-radius: 50%; transition: .15s; }
.qty button:hover { background: var(--primary-50); }
.qty button svg { width: 16px; height: 16px; }
.qty span { min-width: 26px; text-align: center; font-weight: 800; font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .header-actions .btn-outline, .header-actions .lang-switch, .header-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-inner { gap: 8px; }
  .logo img { height: 54px; }
  .section { padding: 40px 0; }
  .section-title { font-size: 24px; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-cols > div:last-child { grid-column: 1 / -1; }
  /* bigger tap targets for footer links */
  .footer-cols li { margin-bottom: 2px; }
  .footer-cols a, .footer-legal a { display: inline-block; padding: 6px 0; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .header-actions { gap: 8px; }
  .header-actions .btn-primary { height: 36px; padding: 0 14px; font-size: 14px; }
  .section-head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .footer-cols { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
