/* TakoyakiSedap — Modern Warm Yellow Theme */
:root {
  /* Warm yellow palette — easy on the eyes */
  --yellow-50: #FFFDF5;
  --yellow-100: #FFF8E8;
  --yellow-200: #FFEDC2;
  --yellow-300: #F5D98E;
  --yellow-400: #E8C45A;
  --yellow-500: #D4A843;
  --yellow-600: #C0842D;
  --yellow-700: #9E6520;
  --yellow-800: #7A4B18;
  --yellow-900: #5C3610;

  /* Neutrals */
  --cream: #FFFBF5;
  --bg: #FFFAF2;
  --surface: #FFFFFF;
  --surface-hover: #FFFDF7;
  --text: #2D2416;
  --text-secondary: #8B7A63;
  --text-muted: #B8A99A;
  --border: #F0E6D8;
  --shadow: rgba(180, 140, 80, 0.08);
  --shadow-lg: rgba(180, 140, 80, 0.15);

  /* Status */
  --success: #22A67E;
  --error: #DC4B4B;
  --info: #5B8DEF;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Typography */
  --text-sm: 0.8125rem;
  --text-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);
  --text-lg: clamp(1.05rem, 0.98rem + 0.35vw, 1.15rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Tap target */
  --tap: 48px;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  padding-bottom: 24px;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; font-size: inherit; border: none; background: none; }
input, textarea, select {
  font-family: inherit;
  font-size: var(--text-base);
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--yellow-500);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.15);
}
textarea { resize: vertical; min-height: 44px; }
label { display: block; font-weight: 600; font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: var(--space-1); }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 250, 242, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-name {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--yellow-700);
  letter-spacing: -0.5px;
}
.brand-tagline {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: -2px;
}

/* Cart Button */
.cart-btn {
  position: relative;
  width: var(--tap);
  height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yellow-700);
  background: var(--yellow-100);
  border-radius: 50%;
  transition: background .2s;
}
.cart-btn:active { background: var(--yellow-200); }
.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--yellow-500);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 6px rgba(212, 168, 67, 0.3);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--yellow-200) 0%, var(--yellow-300) 50%, var(--yellow-100) 100%);
  padding: var(--space-10) var(--space-4);
  text-align: center;
}
.hero-icon { font-size: 3rem; margin-bottom: var(--space-2); line-height: 1; }
.hero-content { max-width: 480px; margin: 0 auto; }
.hero h2 {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--yellow-800);
  margin-bottom: var(--space-2);
  letter-spacing: -0.5px;
}
.hero p { color: var(--text-secondary); font-size: var(--text-lg); }

/* Menu Section */
.menu-section { max-width: 480px; margin: 0 auto; padding: var(--space-5) var(--space-4); }
.section-header { margin-bottom: var(--space-4); }
.section-header h3 { font-size: var(--text-xl); font-weight: 700; }
.section-sub { color: var(--text-muted); font-size: var(--text-sm); margin-top: var(--space-1); }

.menu-grid { display: flex; flex-direction: column; gap: var(--space-3); }

/* Product Card */
.product-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: transform .15s, box-shadow .2s, border-color .2s;
}
.product-card:active { transform: scale(0.99); }
.product-card:hover { border-color: var(--yellow-300); box-shadow: 0 4px 16px var(--shadow); }

.product-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.product-info { flex: 1; }
.product-name {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-1);
}
.product-desc { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: var(--space-2); }
.product-price {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--yellow-700);
  white-space: nowrap;
}
.product-price small { font-weight: 400; font-size: var(--text-sm); color: var(--text-muted); }

.product-icon {
  width: 56px;
  height: 56px;
  background: var(--yellow-100);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.product-details { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.protein-select { margin-bottom: var(--space-2); }
.protein-select label { margin-bottom: var(--space-1); }
.protein-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.protein-chip {
  padding: var(--space-1) var(--space-3);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--surface);
  color: var(--text-secondary);
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.protein-chip.active {
  background: var(--yellow-500);
  color: white;
  border-color: var(--yellow-500);
}
.protein-chip:active { transform: scale(0.96); }

.product-note { margin-top: var(--space-2); }
.product-note input { font-size: var(--text-sm); padding: var(--space-2) var(--space-3); }

.btn-order {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--tap);
  margin-top: var(--space-3);
  background: linear-gradient(135deg, var(--yellow-400), var(--yellow-500));
  color: white;
  font-weight: 700;
  font-size: var(--text-base);
  border-radius: var(--radius-sm);
  transition: opacity .2s, transform .15s;
}
.btn-order:active { opacity: .9; transform: scale(0.98); }
.btn-order.in-cart {
  background: var(--success);
}

/* Info Bar */
.info-bar {
  max-width: 480px;
  margin: var(--space-4) auto 0;
  padding: 0 var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.info-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
}
.info-icon { font-size: 1.3rem; }
.info-item strong { font-size: var(--text-sm); display: block; }
.info-item p { font-size: var(--text-sm); color: var(--text-muted); }

/* Order Section (inline) */
.order-section {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 var(--space-4) var(--space-3);
}
.order-items {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}
.order-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}
.order-item:last-child { border-bottom: none; }
.order-item-name { flex: 1; font-weight: 600; }
.order-item-detail { color: var(--text-secondary); font-size: 12px; }
.order-item-price { font-weight: 600; color: var(--yellow-700); white-space: nowrap; }
.order-item-remove {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); border-radius: 50%; font-size: 1.1rem; flex-shrink: 0;
}
.order-item-remove:active { background: #FEE2E2; color: var(--error); }

.order-total-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-3) var(--space-3) 0;
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text);
}

/* Form Section */
.form-section {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-4) var(--space-6);
}

/* Payment Toggle */
.payment-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.payment-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-2);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: all .2s;
  text-align: center;
}
.payment-option.active {
  border-color: var(--yellow-500);
  background: var(--yellow-50);
  color: var(--yellow-700);
}
.payment-option:active { transform: scale(0.97); }
.payment-icon { font-size: 1.8rem; }

/* QR Info */
.qr-info {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  text-align: center;
}
.qr-placeholder {
  margin-bottom: var(--space-3);
}
.qr-empty {
  padding: var(--space-3);
}
.qr-empty-icon { font-size: 2.5rem; display: block; margin-bottom: var(--space-2); }
.qr-empty p { font-weight: 600; margin-bottom: var(--space-1); }
.qr-note { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-2); }

/* Order Total Box */
.order-total-box {
  background: var(--yellow-50);
  border: 1.5px solid var(--yellow-200);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
}

.form-group { margin-bottom: var(--space-3); }

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: var(--space-1) 0;
}
.summary-row.total {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  border-top: 1.5px solid var(--yellow-200);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
}

.checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 52px;
  background: linear-gradient(135deg, var(--yellow-400), var(--yellow-500));
  color: white;
  font-weight: 700;
  font-size: var(--text-lg);
  border-radius: var(--radius-sm);
  transition: opacity .2s, transform .15s;
}
.checkout-btn:active { opacity: .9; transform: scale(0.98); }
.checkout-btn:disabled { opacity: .5; pointer-events: none; }

/* Toast */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: white;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-xl);
  font-size: var(--text-sm);
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: all .3s;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--error); }
.toast.success { background: var(--success); }

/* Loading */
.loading-state { text-align: center; padding: var(--space-10) 0; }
.loading-state p { color: var(--text-muted); margin-top: var(--space-3); }
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--yellow-200);
  border-top-color: var(--yellow-500);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty State */
.empty-state { text-align: center; padding: var(--space-10) 0; color: var(--text-muted); }
.empty-state p { margin-top: var(--space-2); }

/* Scrollbar */
.cart-body::-webkit-scrollbar { width: 4px; }
.cart-body::-webkit-scrollbar-track { background: transparent; }
.cart-body::-webkit-scrollbar-thumb { background: var(--yellow-200); border-radius: 2px; }

/* Responsive */
@media (min-width: 600px) {
  body { background: #F5EDE0; }
  #app {
    max-width: 480px;
    margin: 0 auto;
    background: var(--cream);
    min-height: 100dvh;
    box-shadow: 0 0 40px var(--shadow);
  }
}
