/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f5f5f0;
  --surface:   #ffffff;
  --primary:   #999;
  --primary-h: #888;
  --text:      #1a1a1a;
  --muted:     #666;
  --border:    #e0e0e0;
  --radius:    10px;
  --shadow:    0 2px 12px rgba(0,0,0,.08);
  --font:      'Segoe UI', system-ui, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── Theme transition: 2s fade from grey defaults to real colors ────────── */
.theme-fade .site-header,
.theme-fade .tab-btn,
.theme-fade .tab-btn.active,
.theme-fade .subcategory-heading,
.theme-fade .item-price,
.theme-fade .size-price,
.theme-fade .btn-primary,
.theme-fade .btn-add-cart,
.theme-fade .header-nav-link,
.theme-fade .contact-info-item a {
  transition: background-color 2s ease, color 2s ease, border-color 2s ease;
}

/* ─── Skeleton loading placeholders ──────────────────────────────────────── */
.skeleton-block {
  background: linear-gradient(90deg, #e0e0e0 25%, #ebebeb 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}
.skeleton-tab {
  display: inline-block;
  width: 80px;
  height: 36px;
  border-radius: 20px;
  background: #e0e0e0;
}
.skeleton-line {
  height: 14px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 8px;
}
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w40 { width: 40%; }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 18px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-inner { max-width: 860px; margin: auto; display: flex; align-items: center; justify-content: flex-end; }
.brand { font-size: 1.3rem; font-weight: 700; letter-spacing: .5px; color: var(--text); }
.brand-bar {
  max-width: 860px; margin: 0 auto; padding: 14px 24px 0;
  text-align: center;
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-nav-link {
  color: #fff; text-decoration: none; font-size: .95rem; font-weight: 600;
  padding: 6px 14px; border: 2px solid rgba(255,255,255,.6); border-radius: 6px;
  transition: background .2s, border-color .2s; white-space: nowrap;
}
.header-nav-link:hover { background: rgba(255,255,255,.15); border-color: #fff; }

/* ─── Language Switcher ──────────────────────────────────────────────────── */
.lang-switcher { display: flex; gap: 6px; }
.lang-btn {
  background: transparent; border: 2px solid transparent; border-radius: 6px;
  font-size: 1.5rem; cursor: pointer; padding: 2px 6px; line-height: 1;
  transition: border-color .2s, opacity .2s; opacity: .6;
  display: inline-flex; align-items: center; justify-content: center;
}
.lang-btn img { display: block; border-radius: 2px; }
.lang-btn.active { border-color: #fff; opacity: 1; }
.lang-btn:hover { opacity: 1; }

/* ─── Contact Info Bar ───────────────────────────────────────────────────── */
.contact-info-bar {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 20px; display: flex; flex-direction: column; gap: 8px;
  font-size: .9rem;
}
.contact-info-item { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.contact-info-item a { color: var(--primary); text-decoration: none; font-weight: 500; }
.contact-info-item a:hover { text-decoration: underline; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container { max-width: 860px; margin: 32px auto; padding: 0 16px 64px; display: flex; flex-direction: column; gap: 24px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-row:last-child { margin-bottom: 0; }
.form-row label { font-weight: 600; font-size: .9rem; }
.form-row input,
.form-row textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .2s;
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(212,65,30,.15);
}
.form-row textarea { resize: vertical; min-height: 80px; }
.req { color: var(--primary); }

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.tab-btn {
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: transparent;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  transition: all .2s;
}
.tab-btn:hover { border-color: var(--primary); color: var(--primary); }
.tab-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ─── Subcategory Headings ────────────────────────────────────────────────── */
.subcategory-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--border);
}

/* ─── Menu Grid ──────────────────────────────────────────────────────────── */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.item-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s;
}
.item-card:hover { box-shadow: var(--shadow); }

.item-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #f0ede8;
}
.item-img-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #f0ede8 60%, #e8e4de);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.item-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.item-name { font-weight: 700; font-size: 1rem; }
.item-desc { font-size: .85rem; color: var(--muted); flex: 1; }
.item-price { font-weight: 700; color: var(--primary); font-size: 1.05rem; }

/* ─── Size Rows ──────────────────────────────────────────────────────────── */
.item-sizes { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.size-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.size-label {
  font-weight: 700;
  font-size: .9rem;
  min-width: 18px;
  text-align: center;
}
.size-price {
  font-weight: 700;
  color: var(--primary);
  font-size: .95rem;
  min-width: 56px;
}

.item-qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.qty-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  line-height: 1;
}
.qty-btn:hover { border-color: var(--primary); color: var(--primary); }
.qty-input {
  width: 44px; text-align: center;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  font-size: .95rem;
  font-family: inherit;
}
.qty-input:focus { outline: none; border-color: var(--primary); }

/* ─── Cart Summary ───────────────────────────────────────────────────────── */
.cart-summary { margin-bottom: 24px; }
.cart-summary h3 { font-size: 1rem; margin-bottom: 12px; }
.cart-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.cart-list li { display: flex; justify-content: space-between; font-size: .9rem; }
.cart-list .li-name { color: var(--text); }
.cart-list .li-price { color: var(--muted); }
.cart-total { text-align: right; font-size: 1rem; }
.cart-totals { border-top: 1px solid var(--border); padding-top: 10px; }
.cart-line { text-align: right; font-size: .9rem; color: var(--muted); margin-bottom: 4px; }

/* ─── Checkout Options ───────────────────────────────────────────────────── */
.checkout-options {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.checkout-group h4 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.checkout-radios {
  display: flex;
  gap: 10px;
}
.checkout-radio {
  flex: 1;
  cursor: pointer;
}
.checkout-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.checkout-radio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: all .2s;
  text-align: center;
  background: var(--surface);
}
.checkout-radio input[type="radio"]:checked + .checkout-radio-card {
  border-color: var(--primary);
  background: rgba(212,65,30,.06);
  box-shadow: 0 0 0 3px rgba(212,65,30,.12);
}
.checkout-radio:hover .checkout-radio-card {
  border-color: var(--primary);
}
.checkout-radio-icon {
  font-size: 1.5rem;
}
.checkout-radio-text {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
}
.checkout-radio-fee {
  font-size: .75rem;
  color: var(--muted);
  font-weight: 500;
}

/* ─── Schedule Picker ────────────────────────────────────────────────────── */
.schedule-picker {
  margin-top: 12px;
  display: flex;
  gap: 12px;
}
.schedule-row {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.schedule-row label {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
}
.schedule-select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .9rem;
  background: var(--surface);
  color: var(--text);
  appearance: auto;
}
.schedule-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(212,65,30,.12);
  outline: none;
}

/* ─── Stripe Card Element ────────────────────────────────────────────────── */
.stripe-card-section {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
}
.stripe-card-section h4 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.stripe-card-element {
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: #fff;
  transition: border-color .2s;
}
.stripe-card-element.StripeElement--focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(212,65,30,.12);
}
.stripe-card-element.StripeElement--invalid {
  border-color: var(--danger);
}

/* ─── Options UI ─────────────────────────────────────────────────────────── */
.item-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.item-option-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.option-group-label {
  font-weight: 600;
  font-size: .85rem;
  color: var(--text);
}
.option-choices {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 4px;
}
.option-choice {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  cursor: pointer;
}
.option-choice input[type="radio"] { accent-color: var(--primary); }

/* ─── Cart options ───────────────────────────────────────────────────────── */
.li-options { font-size: .8rem; color: var(--muted); margin-top: 2px; }

/* ─── Extras Dropdown ─────────────────────────────────────────────────────── */
.extras-dropdown {
  margin-top: 6px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.extras-dropdown-toggle {
  padding: 6px 10px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  user-select: none;
}
.extras-dropdown-toggle::-webkit-details-marker { display: none; }
.extras-dropdown-toggle::before {
  content: '▸';
  font-size: .75rem;
  transition: transform .2s;
}
.extras-dropdown[open] > .extras-dropdown-toggle::before {
  transform: rotate(90deg);
}

/* ─── Extras UI ──────────────────────────────────────────────────────────── */
.item-extras {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 10px 8px;
}
.extra-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  cursor: pointer;
}
.extra-option input[type="checkbox"] { accent-color: var(--primary); }

.item-size-select {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.size-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .9rem;
  cursor: pointer;
}
.size-option input[type="radio"] { accent-color: var(--primary); }

.btn-add-cart {
  margin-top: 10px;
  padding: 8px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  width: 100%;
}
.btn-add-cart:hover:not(:disabled) { background: var(--primary-h); }
.btn-add-cart:disabled { opacity: .6; cursor: default; }

/* ─── Cart extras & remove ───────────────────────────────────────────────── */
.li-details { display: flex; flex-direction: column; }
.li-extras { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.li-right { display: flex; align-items: center; gap: 8px; }
.cart-remove-btn {
  background: none;
  border: none;
  color: #c0392b;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.cart-remove-btn:hover { color: #e74c3c; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
  margin-top: 8px;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-h); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

/* ─── Errors ─────────────────────────────────────────────────────────────── */
.form-error { color: #c0392b; font-size: .9rem; margin-top: 10px; text-align: center; }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
}
.modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 201;
  padding: 16px;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 40px 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.modal-icon { font-size: 3rem; margin-bottom: 16px; }
.modal-box h2 { margin-bottom: 12px; }
.modal-box p { color: var(--muted); margin-bottom: 8px; }
.modal-order-id { font-weight: 700; color: var(--text) !important; font-size: 1rem; }

/* ─── Utility ────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.tab-placeholder { color: var(--muted); font-style: italic; font-size: .9rem; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .card { padding: 20px 16px; }
  .menu-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 360px) {
  .menu-grid { grid-template-columns: 1fr; }
}
