/* CCF look: theme tokens + base layout shared by every screen. */
:root {
  --pink: #EE305B;
  --pink-dark: #c42248;
  --pink-soft: #fff0f4;
  --yellow: #FFDC1A;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --bg: #faf7f8;
  --card: #ffffff;
  --border: #eadce1;
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tap: 48px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
body {
  padding-top: var(--safe-top);
  /* bottom nav + room so nothing (incl. any host badge) covers content */
  padding-bottom: calc(88px + var(--safe-bottom) + 56px);
  max-width: 430px;
  margin: 0 auto;
}
main { padding: 12px; padding-bottom: 88px; }
.hidden { display: none !important; }
.view { display: none; }
.view.active { display: block; }

.test-banner {
  position: sticky; top: 0; z-index: 100;
  background: var(--yellow); color: #111;
  font-weight: 700; font-size: 13px; text-align: center; padding: 8px 12px; letter-spacing: 0.02em;
}
.app-header { background: var(--pink); color: #fff; padding: 14px 16px 12px; }
.app-header h1 { margin: 0; font-size: 20px; font-weight: 800; }
.app-header .sub { margin: 4px 0 0; font-size: 13px; opacity: 0.95; }
.header-brand { display: flex; align-items: center; gap: 12px; }
.header-logo { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: #fff; flex: 0 0 auto; }
.prices-note { background: #fff6d6; color: #5c4b00; font-size: 12px; padding: 8px 16px; border-bottom: 1px solid #f0e0a0; }

.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: min(430px, 100%); background: #fff; border-top: 1px solid var(--border);
  display: flex; padding: 8px 8px calc(8px + var(--safe-bottom)); gap: 8px; z-index: 80;
}
.bottom-nav button {
  flex: 1; min-height: var(--tap); border: none; border-radius: 12px;
  font-weight: 700; font-size: 15px; background: #f3f3f3; color: var(--ink);
}
.bottom-nav button.current { outline: 2px solid var(--pink); outline-offset: -2px; }
.bottom-nav button.primary { background: var(--pink); color: #fff; }
.cart-count { background: var(--yellow); color: #000; border-radius: 999px; padding: 1px 7px; font-size: 12px; margin-left: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); width: 100%; border: none; border-radius: 12px;
  font-weight: 800; font-size: 16px; margin-top: 10px; cursor: pointer; text-decoration: none;
  padding: 0 14px;
}
.btn-primary { background: var(--pink); color: #fff; }
.btn-accent { background: var(--yellow); color: #111; }
.btn-ghost { background: #f0f0f0; color: #111; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

label.field, .field { display: block; margin: 12px 0 4px; font-size: 13px; font-weight: 600; }
input, select, textarea {
  width: 100%; min-height: var(--tap); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 16px; /* iOS zoom prevention */ font-family: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 72px; resize: vertical; }

/* Radios / checkboxes: never inherit the text-input sizing above (iOS Safari bug fix). */
input[type="radio"], input[type="checkbox"] {
  width: 22px !important; height: 22px !important;
  min-width: 22px !important; min-height: 22px !important;
  max-width: 22px !important; max-height: 22px !important;
  margin: 0; padding: 0; flex: 0 0 22px;
  -webkit-appearance: radio; appearance: auto; accent-color: var(--pink); border-radius: 0;
}
input[type="checkbox"] { -webkit-appearance: checkbox; }

.qty-row { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.qty-row button {
  width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--border);
  background: #fff; font-size: 22px; font-weight: 700; color: var(--ink);
}

.cat-desc { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.badge-tbd {
  display: inline-block; background: #eee; color: #555; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle;
}
.badge-soft {
  display: inline-block; background: var(--pink-soft); color: var(--pink-dark); font-size: 10px; font-weight: 800;
  padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle;
}
.combo-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 24px; padding: 0 6px; margin-right: 6px;
  background: var(--pink); color: #fff; border-radius: 6px;
  font-weight: 900; font-size: 14px; letter-spacing: 0.01em; vertical-align: middle;
}
.combo-num-lg { min-width: 40px; height: 30px; font-size: 18px; }

.totals { margin-top: 12px; }
.totals .row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 15px; }
.totals .row.total { font-weight: 800; font-size: 18px; margin-top: 6px; border-top: 1px solid var(--border); padding-top: 10px; }
.error { background: #ffe5ea; color: #a01030; border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-size: 14px; font-weight: 600; }
.success { background: #e6f8ec; color: #0d6b2f; border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-weight: 700; }

/* Sheets */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 200; display: none; }
.sheet {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(430px, 100%);
  max-height: 92vh; overflow: auto; -webkit-overflow-scrolling: touch; background: #fff;
  border-radius: 18px 18px 0 0; z-index: 210; padding: 16px 16px calc(16px + var(--safe-bottom)); display: none;
}
.sheet-backdrop.open, .sheet.open { display: block; }
.sheet h3 { margin: 0 0 8px; font-size: 20px; }
.close-x {
  position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border: none;
  background: rgba(255, 255, 255, 0.92); border-radius: 50%; font-size: 22px; z-index: 2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Photos + CCF-branded placeholder */
.photo { display: block; object-fit: cover; background: var(--pink-soft); }
.photo-ph {
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 60%, #a81a3c 100%);
}
.photo-ph::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 18%; background: var(--yellow); opacity: 0.9;
}
.photo-ph img { width: 42%; max-width: 72px; height: auto; border-radius: 22%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); position: relative; z-index: 1; }
.photo-ph .ph-emoji { position: absolute; right: 8px; top: 6px; font-size: 20px; z-index: 1; }

/* v5 header: ☰ left, account button right */
.app-header { padding: 10px 12px; }
.app-header h1 { font-size: 17px; line-height: 1.15; }
.app-header .sub { font-size: 11px; }
.header-logo { width: 40px; height: 40px; border-radius: 10px; }
@media (max-width: 420px) { .app-header .header-logo { display: none; } }
.app-header .sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
