/* ==========================================================================
   Theme: 🇭🇰 港式茶餐廳 (Tsui Wah / Classic Cha Chaan Teng)
   ========================================================================== */

body.theme-cct {
  --theme-primary: #1b4332;
  --theme-primary-hover: #143326;
  --theme-accent: #c1121f;
  --theme-accent-gold: #e7c169;
  --theme-bg: #eef4f0;
  --theme-card-bg: #ffffff;
  --theme-text-dark: #1f2d24;
  --theme-border: #a3c4bc;
  --theme-header-bg: #133324;
  --theme-tag-bg: #e8f5e9;
  --theme-tag-text: #1b4332;
  background-color: #eaf2ec;
  background-image: radial-gradient(#cadfd2 1px, transparent 1px), radial-gradient(#cadfd2 1px, #eaf2ec 1px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  color: var(--theme-text-dark);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans HK", "PingFang HK", "Microsoft JhengHei", sans-serif;
}

body.theme-cct .app-header {
  background: var(--theme-header-bg);
  border-bottom: 3px solid var(--theme-accent-gold);
}

body.theme-cct .brand-icon {
  background: var(--theme-accent);
  color: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  font-weight: 900;
}

body.theme-cct .brand-title {
  color: var(--theme-accent-gold);
  letter-spacing: 0.1em;
}

body.theme-cct .brand-subtitle {
  color: #cce3d5;
}

/* FIX SWITCH-2: this theme repaints `.app-header` dark green, so the core
   dark-on-light store pills would vanish into it. Light-on-dark variant here,
   with a gold active pill to match the brand. */
body.theme-cct .store-switcher-pills {
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(231, 193, 105, 0.35);
}

body.theme-cct .store-switch-btn {
  color: rgba(255, 255, 255, 0.82);
}

body.theme-cct .store-switch-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

body.theme-cct .store-switch-btn.active {
  background: var(--theme-accent-gold);
  color: #133324;
}

/* Store Form Container */
.cct-container {
  max-width: 680px;
  margin: 0 auto 40px;
  padding: 0 12px;
}

/* Retro Cha Chaan Teng Board */
.cct-header-banner {
  background: linear-gradient(135deg, #1b4332 0%, #0d281e 100%);
  color: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(27, 67, 50, 0.25);
  border: 2px solid var(--theme-accent-gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cct-header-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--theme-accent-gold);
  display: flex;
  align-items: center;
  gap: 10px;
}

.cct-header-tagline {
  font-size: 0.82rem;
  color: #d8f3dc;
  margin-top: 4px;
}

/* Sections */
.cct-card {
  background: #fff;
  border-radius: 12px;
  border: 1.5px solid #bdd5c8;
  padding: 20px;
  margin-bottom: 22px;
  box-shadow: 0 4px 12px rgba(27, 67, 50, 0.06);
  position: relative;
}

.cct-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1b4332;
  border-bottom: 2px dashed #bdd5c8;
  padding-bottom: 10px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cct-badge-red {
  background: #c1121f;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.cct-badge-green {
  background: #2d6a4f;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

/* Set Meal Builder (常餐組合) */
.cct-set-box {
  background: #f4faf6;
  border: 1.5px solid #a3c4bc;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.cct-set-step-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1b4332;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cct-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.cct-option-btn {
  background: #ffffff;
  border: 1.5px solid #c9ded3;
  color: #1b4332;
  padding: 10px 8px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}

.cct-option-btn:hover:not(:disabled) {
  border-color: #1b4332;
  background: #edf7f1;
}

.cct-option-btn.selected {
  background: #1b4332;
  color: #ffffff;
  border-color: #1b4332;
  box-shadow: 0 3px 8px rgba(27, 67, 50, 0.25);
}

/* Dishes List with Quantity */
.cct-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  border-bottom: 1px solid #e2efe7;
  transition: background 0.12s ease;
}

.cct-item-row:last-child {
  border-bottom: none;
}

.cct-item-row:hover {
  background: #f7fcf9;
}

.cct-item-info {
  flex: 1;
  padding-right: 12px;
}

.cct-item-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cct-item-desc {
  font-size: 0.78rem;
  color: #52796f;
  margin-top: 2px;
}

/* Per-item quantity cap reached (mains / snacks / host specials: max 4) */
.cct-item-max-note {
  font-size: 0.72rem;
  font-weight: 700;
  color: #c1121f;
  margin-top: 3px;
}

/* Sold Out Styling: `.is-sold-out` / `.sold-out-badge` moved to css/style.css —
   all three stores render them, so they are core UI, not a 茶餐廳 theme detail. */

/* Custom Host Dish Styling */
.cct-custom-tag {
  background: #7209b7;
  color: #fff;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* Water Bar Customizations */
.cct-drink-custom-panel {
  background: #fdfbf7;
  border: 1px solid #ebd9bf;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cct-chip-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.cct-mini-chip {
  font-size: 0.76rem;
  padding: 4px 8px;
  border-radius: 20px;
  border: 1px solid #c8d8cf;
  background: #fff;
  color: #264653;
  cursor: pointer;
  transition: all 0.12s ease;
}

.cct-mini-chip.selected {
  background: #2a9d8f;
  color: #fff;
  border-color: #2a9d8f;
  font-weight: 700;
}

/* Submit Button */
.cct-submit-btn {
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 1.15rem;
  font-weight: 800;
  width: 100%;
  box-shadow: 0 6px 18px rgba(27, 67, 50, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.cct-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(27, 67, 50, 0.45);
}

.cct-submit-btn:active {
  transform: translateY(1px);
}

/* ============================================================================
   Multi-store patch: layout classes replacing the inline styles that used to be
   interpolated into innerHTML (they now go through esc()), plus theme chrome so
   茶餐廳 stops rendering inside the ramen paper sheet.
   ========================================================================== */

.cct-badge-gold {
  background: #e7c169;
  color: #133324;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
}

.cct-set-toggle {
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cct-option-desc {
  font-size: 0.72rem;
  color: #718096;
  margin-top: 2px;
}

/* Quantity steppers (mains, snacks, host specials, drinks) */
.cct-counter {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cct-qty-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.cct-qty-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cct-qty-value {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
}

/* Drinks */
.cct-drink-item-card {
  padding: 12px 0;
  border-bottom: 1px solid #e2efe7;
}

.cct-drink-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.cct-drink-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
}

.cct-drink-pick {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #1b4332;
  white-space: nowrap;
}

.cct-chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cct-chip-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #555;
}

.cct-remarks {
  width: 100%;
  resize: vertical;
}

.cct-card-custom {
  border: 2px solid #9d4edd;
}

.cct-custom-title {
  color: #7209b7;
}

.cct-option-btn:focus-visible,
.cct-mini-chip:focus-visible,
.cct-qty-btn:focus-visible,
.cct-submit-btn:focus-visible {
  outline: 3px solid #1b4332;
  outline-offset: 2px;
}

/* Theme chrome: a HK diner sheet, not a Japanese order slip. */
body.theme-cct #guest-view.ramen-sheet {
  background: #f4faf6;
  border-color: #cfe3d6;
}

body.theme-cct #guest-view .sheet-banner {
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  border-color: #14342a;
  color: #fff;
}

/* FIX CONTRAST-1: `.sheet-title h1` sets its own dark `color: var(--text)`, so
   recolouring the banner alone left near-black text on the dark green banner. */
body.theme-cct #guest-view .sheet-title h1 {
  color: #ffffff;
}

body.theme-cct #guest-view .sheet-subtitle {
  color: rgba(255, 255, 255, 0.88);
}

/* `.sheet-notice` keeps its core light-yellow chip + brown text. Overriding its
   colour to white put white text on a #fffbe6 background — unreadable. */

body.theme-cct #guest-view .sheet-banner .badge {
  background: #e7c169;
  color: #133324;
}
