/* ====================================================
   ORDER PAGE – Zum Hohen Markt (Light Theme)
   ==================================================== */

:root {
  --bg: #ffffff;
  --bg-card: #fdfdfd;
  --bg-elevated: #ffffff;
  --bg-input: #f9f9f9;
  --accent: #8b6e3f;
  --accent-light: rgba(139, 110, 63, 0.08);
  --accent-hover: #a67c00;
  --text: #2d2d2d;
  --text-sub: #666666;
  --text-muted: #999999;
  --border: #ebebeb;
  --border-subtle: #f0f0f0;
  --success: #2ecc71;
  --danger: #e74c3c;
  --shadow: 0 10px 30px rgba(0,0,0,0.05);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --header-h: 70px;
  --cart-bar-h: 75px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(var(--cart-bar-h) + 20px);
  -webkit-font-smoothing: antialiased;
}

.lang-option img { width: 20px; height: 13px; object-fit: cover; border-radius: 2px; }

/* ---- Header ---- */
.order-header {
  position: sticky; top: 0; z-index: 900;
  height: var(--header-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
}
.back-link {
  color: var(--accent); text-decoration: none; font-size: 13px;
  display: flex; align-items: center; gap: 6px;
  padding: 8px; border-radius: 8px;
  transition: background .15s;
  white-space: nowrap;
}
.back-link:hover { background: var(--accent-light); }
.header-brand {
  display: flex; align-items: center; gap: 10px;
  flex: 1; justify-content: center;
}
.header-logo {
  width: 36px; height: 36px; object-fit: contain; border-radius: 8px;
}
.header-name { font-family: 'Cinzel', serif; font-size: 14px; color: var(--accent); line-height: 1.1; font-weight: 700; }
.header-sub { font-size: 10px; color: var(--text-sub); letter-spacing: .5px; }
.header-actions {
  display: flex; align-items: center; gap: 8px;
}
.lang-switcher { position: relative; }
.lang-btn-mini {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 8px; display: flex; align-items: center; gap: 4px;
  cursor: pointer; font-size: 11px; font-weight: 700; color: var(--text-sub);
}
.lang-btn-mini img { width: 14px; height: 9px; object-fit: cover; border-radius: 1px; }

.lang-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  min-width: 120px; display: none; box-shadow: var(--shadow);
  z-index: 1100;
}
.lang-dropdown.open { display: block; }

.user-profile-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--accent-light); color: var(--accent);
  border: 1px solid transparent; border-radius: 20px;
  padding: 6px 12px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.user-profile-btn:hover { border-color: var(--accent); }
.user-profile-btn i { font-size: 16px; }

.cart-icon-btn {
  position: relative; background: none; border: none; color: var(--accent);
  font-size: 20px; cursor: pointer; padding: 8px;
  border-radius: 8px; transition: background .15s;
}
.cart-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.cart-badge.hidden { display: none; }

/* ---- Info Bar ---- */
.info-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}

.loyalty-promo-card {
  background: linear-gradient(135deg, #fff 0%, #fdfbf7 100%);
  border: 1px solid #d4af37;
  border-radius: 16px;
  padding: 16px;
  margin: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.1);
  animation: fadeInDown 0.6s ease-out 0.1s both;
}

.loyalty-promo-card.hidden { display: none !important; }

.lp-icon { font-size: 24px; }
.lp-content { flex: 1; min-width: 0; }
.lp-content strong { display: block; font-size: 14px; color: var(--accent); }
.lp-content p { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.lp-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.lp-btn:hover { background: var(--accent-hover); }
.info-chip {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-sub);
  background: #fff;
  padding: 5px 10px; border-radius: 20px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.info-chip i { color: var(--accent); font-size: 11px; }

/* ---- Category Nav ---- */
.cat-nav {
  position: sticky; top: var(--header-h);
  z-index: 800;
  background: #fff;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; overflow-x: auto; gap: 0;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  background: none; border: none; color: var(--text-sub);
  padding: 12px 16px; font-size: 12px; font-weight: 600;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  white-space: nowrap; letter-spacing: .3px;
}
.cat-tab:hover { color: var(--text); }
.cat-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- Menu Sections ---- */
.menu-sections { padding: 0 0 16px; }

.section-heading {
  padding: 24px 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
  text-align: center;
  position: relative;
}
.section-heading h2 {
  font-family: 'Cinzel', serif;
  font-size: 22px; color: var(--text);
  display: inline-block;
  background: #fff;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}
.section-heading::before {
  content: '';
  position: absolute;
  top: 38px; left: 16px; right: 16px;
  height: 1px; background: var(--border);
}
.section-heading .sec-sub {
  letter-spacing: 2px;
  font-weight: 500;
}

/* ---- Menu Item Row ---- */
.menu-item {
  display: flex; align-items: center;
  padding: 16px;
  border-bottom: 1px dashed var(--border-subtle);
  gap: 12px;
  transition: background .15s;
}
.menu-item:hover { background: var(--bg-card); }

.item-info { flex: 1; min-width: 0; }
.item-name {
  font-size: 14px; font-weight: 600; color: var(--text);
}
.item-desc {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
}
.item-translated-desc {
  font-size: 13px; color: var(--accent); font-style: italic; margin-top: 2px;
}
.item-price {
  font-size: 15px; font-weight: 700; color: var(--accent);
  white-space: nowrap; margin-right: 8px;
}

/* Quantity control inline */
.item-qty-ctrl {
  display: flex; align-items: center; gap: 0;
  background: var(--bg-card);
  border-radius: 20px; overflow: hidden;
  border: 1px solid var(--border);
}
.iq-btn {
  background: none; border: none; color: var(--accent);
  width: 30px; height: 30px; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  font-weight: 700;
}
.iq-btn:hover { background: var(--accent-light); }
.iq-count {
  min-width: 24px; text-align: center;
  font-size: 13px; font-weight: 700; color: var(--text);
}

/* Add button (when qty=0) */
.add-btn {
  background: #fff;
  border: 1px solid var(--accent);
  color: var(--accent); border-radius: 20px;
  padding: 0 14px; height: 30px; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  font-weight: 500;
}
.add-btn:hover { background: var(--accent); color: #fff; }

/* ---- CHECKOUT VIEW ---- */
.checkout-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky; top: var(--header-h); z-index: 700;
}
.checkout-title { font-family: 'Cinzel', serif; font-size: 16px; color: var(--text); }

.cs {
  background: #fff;
  border-radius: var(--radius);
  margin: 12px 16px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.cs-title {
  font-family: 'Cinzel', serif; font-size: 14px;
  color: var(--accent); border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px; margin-bottom: 16px;
}

.co-item { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 6px 0; }
.co-qty { font-weight: 700; color: var(--accent); min-width: 24px; }
.co-name { flex: 1; }
.co-price { font-weight: 600; }

.subtotal-row {
  display: flex; justify-content: space-between;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-subtle);
  font-weight: 700; font-size: 16px;
}

/* Form */
.form-input {
  width: 100%; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: 12px; font-size: 14px;
  outline: none; margin-top: 6px;
}
.form-input:focus { border-color: var(--accent); }

/* Payment Options */
.pay-opt {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  margin-bottom: 8px; cursor: pointer; transition: all .2s;
}
.pay-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }
.pay-icon-wrap { font-size: 18px; width: 32px; text-align: center; color: var(--accent); }

/* Total & Submit */
.total-price { font-size: 32px; font-weight: 700; color: var(--accent); }

.submit-btn {
  width: 100%; background: var(--accent);
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 18px; font-size: 16px; font-weight: 700;
  cursor: pointer; margin-top: 20px;
}
.submit-btn:hover { background: var(--accent-hover); }

/* Confirm View */
.confirm-card { background: #fff; border: 1px solid var(--accent); border-radius: var(--radius); padding: 20px; }
.success-circle { background: var(--success); color: #fff; border-radius: 50%; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; font-size: 30px; margin-bottom: 15px; }

/* Floating Cart Bar */
.cart-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 850;
  background: #fff; border-top: 1px solid var(--accent);
  display: flex; align-items: center; padding: 10px 16px;
  height: var(--cart-bar-h); box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}
.cart-bar-btn {
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 12px 20px;
  font-weight: 700; cursor: pointer; flex-shrink: 0;
}

/* Cart Drawer */
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1200;
  width: min(400px, 100vw); background: #fff;
  box-shadow: -4px 0 12px rgba(0,0,0,0.1);
  transform: translateX(100%); transition: transform .3s ease;
}
.cart-drawer.open { transform: translateX(0); }

/* ============ MODALS ============ */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  padding: 16px; opacity: 0; pointer-events: none; transition: opacity .3s;
}
.modal-overlay:not(.hidden) { opacity: 1; pointer-events: all; }

.modal-card {
  background: #fff; width: 100%; max-width: 400px;
  border-radius: 20px; padding: 32px 24px;
  position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  transform: translateY(20px); transition: transform .3s;
}
.modal-overlay:not(.hidden) .modal-card { transform: translateY(0); }

.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: #f5f5f5; border: none; width: 32px; height: 32px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted);
}

/* Auth Card */
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-header h2 { font-size: 20px; margin-bottom: 8px; color: var(--accent); font-family: 'Cinzel', serif; }
.auth-header p { font-size: 13px; color: var(--text-muted); }

.auth-options { display: flex; flex-direction: column; gap: 12px; }
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 14px; border-radius: 12px; border: 1px solid #eee;
  background: #fff; color: #333; font-weight: 600; cursor: pointer;
  transition: all .2s;
}
.auth-btn:hover { background: #f9f9f9; transform: translateY(-1px); }
.auth-btn.google i { color: #4285F4; font-size: 18px; }
.auth-btn.apple i { color: #000; font-size: 18px; }
.auth-btn.guest { background: #f5f5f5; border: none; color: var(--text-muted); }

.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 8px 0;
  color: #ccc; font-size: 11px; font-weight: 700;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #eee; }

.auth-footer { text-align: center; margin-top: 20px; font-size: 11px; color: var(--text-muted); }

/* User Profile & Stamps */
.profile-header { text-align: center; margin-bottom: 24px; border-bottom: 1px solid #f0f0f0; padding-bottom: 20px; }
.profile-avatar {
  width: 60px; height: 60px; background: var(--accent-light); color: var(--accent);
  border-radius: 50%; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.profile-header h2 { font-size: 18px; margin-bottom: 4px; }
.status-badge-inline {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  background: var(--accent-light); color: var(--accent); font-size: 11px; font-weight: 700;
}

.auth-promo-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f1c40f, #d4af37);
  color: #fff; padding: 6px 14px; border-radius: 25px;
  font-size: 14px; font-weight: 800; margin-bottom: 12px;
  box-shadow: 0 4px 15px rgba(241, 196, 15, 0.3);
  letter-spacing: 0.5px;
  animation: badgePulse 2s infinite;
}
@keyframes badgePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.stamp-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px;
}
.stamp-slot {
  aspect-ratio: 1; border: 2px dashed #eee; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; color: #ddd;
  font-size: 20px; position: relative;
}
.stamp-slot.active {
  border: none; background: var(--accent-light); color: var(--accent);
  animation: stampPop .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes stampPop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.stamp-progress { text-align: center; font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* Guide Info */
.guide-perks { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.perk-item { display: flex; gap: 12px; align-items: center; }
.perk-item i {
  width: 38px; height: 38px; background: #fef8f0; color: var(--accent);
  border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.perk-item strong { display: block; font-size: 14px; }
.perk-item p { font-size: 11px; color: var(--text-muted); }

.referral-box {
  background: #f9f9f9; padding: 14px; border-radius: 12px; text-align: center;
}
.referral-box p { font-size: 11px; margin-bottom: 8px; color: var(--text-muted); }
.code-copy-row { display: flex; gap: 8px; justify-content: center; }
.code-copy-row code {
  background: #fff; padding: 4px 12px; border-radius: 6px; border: 1px solid #ddd;
  font-size: 14px; font-weight: 700; color: var(--accent); font-family: monospace;
}
.code-copy-row button {
  background: var(--accent); color: #fff; border: none; border-radius: 6px;
  width: 32px; height: 32px; cursor: pointer;
}

.logout-btn-minimal {
  width: 100%; margin-top: 24px; background: none; border: none;
  color: var(--text-muted); font-size: 12px; text-decoration: underline; cursor: pointer;
}

.user-profile-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-light); color: var(--accent);
  padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 600;
  cursor: pointer;
}

/* Utils */
.hidden { display: none !important; }
.type-btn { flex: 1; padding: 12px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; }
.type-btn.active { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
