/* === CHANGE LOG ===
 * HW-012F (2026-03-06): panel-bg/card-bg/text-muted tokens updated; detailDesc line-height 1.5;
 *   tile__desc 2-line clamp; badges min-height; r-sm/md/lg radius tiers; rail__how weight reduced.
 * HW-012E (2026-03-06): Tile overlay variants, softened tile--disabled, statusPill variants,
 *   cta--primary/secondary/hint, tile--flash.
 * HW-012B (2026-03-06): .detailGuestNotes CSS added.
 * HW-012A (2026-03-06): Two-column layout, unified detail modal, dream section removal,
 *   mobile dead code removal (openMobileDetail, bottomSheet, mobileBar, mobileDetail),
 *   submitGiftForm banner redirect to detailModal.
 * === END CHANGE LOG === */

:root {
  --rail-bg: #1b1026;
  --panel-bg: #0e0814;
  --card-bg: #1e1430;
  --text-primary: #f3ecff;
  --text-muted: #d9cce8;
  --gold: #d8b55b;
  --chip-active-bg: #d8b55b;
  --chip-active-text: #1b1026;
  --chip-border: #3c2a4d;
  --overlay-bg: rgba(0, 0, 0, 0.55);
  --focus: #d8b55b;
  --danger: #ff5a7a;
  --locator-accent: #a78bfa;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-chip: var(--r-sm);
  --r-card: var(--r-md);
  --r-tile: var(--r-md);
  --r-modal: var(--r-lg);

  --s-xs: 6px;
  --s-sm: 10px;
  --s-md: 16px;
  --s-lg: 22px;
  --s-xl: 30px;

  --shadow-chip: 0 6px 16px rgba(0,0,0,0.35);
  --shadow-card: 0 18px 60px rgba(0,0,0,0.45);
  --shadow-tile: 0 10px 26px rgba(0,0,0,0.35);
  --shadow-modal: 0 22px 90px rgba(0,0,0,0.55);

  --font-heading: "Cormorant Garamond", serif;
  --font-body: "Cormorant Garamond", serif;
  --font-accent: "Allura", cursive;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: radial-gradient(1200px 800px at 30% 20%, #2a1840 0%, var(--panel-bg) 55%, #09060f 100%);
  color: var(--text-primary);
}

.app {
  height: 100vh;
  width: 100vw;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
}

/* ---- LEFT RAIL ---- */

.rail {
  background: var(--rail-bg);
  border-right: 1px solid rgba(216,181,91,0.16);
  position: relative;
}

.rail__inner {
  height: 100vh;
  padding: var(--s-lg);
  display: flex;
  flex-direction: column;
  gap: var(--s-md);
  overflow: hidden;
}

.rail__site {
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  opacity: 0.9;
}

.rail__how {
  border: none;
  background: transparent;
  padding: var(--s-sm) 0;
  opacity: 0.85;
  font-size: 13px;
}

.rail__howTitle {
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--s-xs);
}

.rail__howList {
  margin: 0;
  padding-left: 16px;
  color: var(--text-primary);
  opacity: 0.95;
  font-size: 14px;
  line-height: 1.4;
}

.rail__controls { display: flex; flex-direction: column; gap: var(--s-sm); }

.rail__chips { display: flex; flex-direction: column; gap: var(--s-xs); }

/* Chips: toggle style, no + icon */
.chip {
  width: 100%;
  border-radius: var(--r-sm);
  border: 1px solid var(--chip-border);
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-chip);
  position: relative;
  font-family: var(--font-body);
  font-size: 15px;
  transition: background 0.15s, color 0.15s;
}

.chip:focus { outline: 2px solid var(--focus); outline-offset: 2px; }

.chip--active {
  background: var(--chip-active-bg);
  color: var(--chip-active-text);
  border-color: rgba(0,0,0,0.15);
}

.chip__label { flex: 1; text-align: left; }

.chip__indicator {
  font-size: 12px;
  opacity: 0.7;
}

.chip--active .chip__indicator { opacity: 1; }

/* Scroll locator: thin accent, distinct from chip active fill */
.chip__leftAccent {
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  border-radius: 8px 0 0 8px;
  background: transparent;
  transition: background 0.2s;
}

.chip--locator .chip__leftAccent {
  background: var(--locator-accent);
}

/* Budget */
.rail__budget {
  border: 1px solid rgba(216,181,91,0.12);
  border-radius: var(--r-md);
  padding: var(--s-sm) var(--s-md);
  background: rgba(255,255,255,0.04);
}

.rail__budgetRow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--s-xs);
}

.rail__budgetLabel {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rail__budgetValue {
  font-size: 17px;
  font-weight: 600;
}

.rail__budgetSlider { width: 100%; }

.rail__clear { display: flex; gap: var(--s-xs); }

.btn {
  border: 1px solid rgba(216,181,91,0.18);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
}

.btn:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn--ghost:hover { background: rgba(255,255,255,0.06); }

.btn--primary {
  background: var(--gold);
  color: #1b1026;
  border-color: rgba(0,0,0,0.15);
  font-weight: 700;
}

.btn--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---- MIDDLE PANEL ---- */

.middle {
  background: linear-gradient(180deg, #0f0916 0%, var(--panel-bg) 55%, #07050c 100%);
  border-right: 1px solid rgba(216,181,91,0.10);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.middle__sticky {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(18,11,26,0.96), rgba(18,11,26,0.78));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(216,181,91,0.10);
  z-index: 10;
}

.middle__title {
  margin: 0;
  padding: var(--s-md) var(--s-lg);
  font-size: 30px;
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
}

.middle__scroll {
  overflow: auto;
  padding: 0 var(--s-lg) var(--s-xl) var(--s-lg);
  height: 100%;
}

.h3 {
  margin: 0 0 var(--s-sm) 0;
  font-size: 20px;
  font-family: var(--font-heading);
  letter-spacing: 0.01em;
}

.dream {
  margin: var(--s-md) 0 var(--s-lg) 0;
  padding: var(--s-md);
  background: rgba(216,181,91,0.04);
  border: 1px solid rgba(216,181,91,0.10);
  border-radius: var(--r-md);
}

.dream__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-lg);
}

.section { margin: 0 0 var(--s-lg) 0; }

.section__title {
  margin: 0 0 var(--s-sm) 0;
  font-size: 24px;
  font-family: var(--font-heading);
}

/* Improved density: 3-column tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-sm);
}

.tiles--dream {
  grid-template-columns: 1fr;
  gap: var(--s-sm);
}

.tiles--mini { grid-template-columns: 1fr; }

.tile {
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(216,181,91,0.12);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-tile);
  position: relative;
  min-height: 100px;
  transition: border-color 0.15s;
}

.tile:hover { border-color: rgba(216,181,91,0.30); }
.tile:focus { outline: 2px solid var(--focus); outline-offset: 2px; }

.tile__img {
  height: 90px;
  width: 100%;
  background-size: cover;
  background-position: center;
  filter: saturate(1.05);
}

.tile__body { padding: var(--s-sm); }

.tile__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 3px 0;
  line-height: 1.2;
}

.tile__desc {
  margin: 0 0 4px 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile__price {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 4px;
}

.badges { display: flex; gap: 4px; flex-wrap: wrap; min-height: 22px; align-items: flex-end; }

.badge {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid rgba(216,181,91,0.16);
  background: rgba(216,181,91,0.10);
  color: var(--text-primary);
}

.tile--disabled {
  filter: grayscale(0.6) saturate(0.5);
  opacity: 0.78;
}

.tile__overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.tile__overlay--pending {
  background: rgba(167, 139, 250, 0.25);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #c4b5fd;
}

.tile__overlay--claimed {
  background: rgba(216, 181, 91, 0.20);
  border: 1px solid rgba(216, 181, 91, 0.30);
  color: var(--gold);
}

.tile--flash {
  border-color: rgba(216, 181, 91, 0.55) !important;
  box-shadow: 0 0 20px rgba(216, 181, 91, 0.15), var(--shadow-tile);
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* Outside budget */
.outside {
  border-top: 1px solid rgba(216,181,91,0.10);
  padding-top: var(--s-lg);
  margin-top: var(--s-md);
}

.outside__blurb {
  margin: 0 0 var(--s-md) 0;
  color: var(--text-muted);
  font-size: 14px;
}

.outside__slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-md);
}

.outside__slotTitle {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s-xs);
}

.detailCard {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(216,181,91,0.12);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Phase 2: rebalanced right panel, hero not dominating */
.detailHero {
  height: 180px;
  background-size: cover;
  background-position: center;
}

.detailBody { padding: var(--s-md); }

.detailTitle {
  font-size: 26px;
  font-family: var(--font-heading);
  margin: 0 0 6px 0;
}

.detailStatus {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px 0;
}

.statusPill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(216,181,91,0.20);
  background: rgba(216,181,91,0.12);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.statusPill--available {
  background: rgba(74, 222, 128, 0.15);
  color: #86efac;
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.statusPill--pending {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.25);
}

.statusPill--claimed {
  background: rgba(216, 181, 91, 0.15);
  color: var(--gold);
  border: 1px solid rgba(216, 181, 91, 0.25);
}

.price {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.detailDesc { color: var(--text-muted); font-size: 15px; line-height: 1.5; }
.detailDesc p { margin: 8px 0; }

.detailGuestNotes {
  margin-top: var(--s-sm);
  padding: var(--s-sm) var(--s-md);
  border-left: 3px solid var(--gold);
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
  line-height: 1.45;
}

.linkBtn {
  width: 100%;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(216,181,91,0.18);
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 15px;
  margin-top: 6px;
}

.linkBtn:hover { background: rgba(255,255,255,0.06); }
.linkBtn:focus { outline: 2px solid var(--focus); outline-offset: 2px; }

.cta--primary {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: var(--gold);
  color: #1b1026;
  border: none;
  border-radius: var(--r-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  margin-top: 6px;
  font-family: var(--font-body);
}

.cta--primary:hover { filter: brightness(1.1); }
.cta--primary:focus { outline: 2px solid var(--focus); outline-offset: 2px; }

.cta--secondary {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: var(--r-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  margin-top: 6px;
  font-family: var(--font-body);
}

.cta--secondary:hover { background: rgba(216, 181, 91, 0.08); }
.cta--secondary:focus { outline: 2px solid var(--focus); outline-offset: 2px; }

.cta__hint {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin: 4px 0 var(--s-md) 0;
  line-height: 1.35;
}

.block {
  margin-top: var(--s-md);
  border-top: 1px solid rgba(216,181,91,0.10);
  padding-top: var(--s-md);
}

.blockTitle {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--s-xs) 0;
}

.list { margin: 0; padding-left: 16px; color: var(--text-primary); font-size: 14px; }

.msgCard {
  border: 1px solid rgba(216,181,91,0.18);
  background: rgba(216,181,91,0.08);
  border-radius: var(--r-md);
  padding: var(--s-sm);
  margin: var(--s-xs) 0 var(--s-sm) 0;
  font-size: 14px;
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: var(--s-sm);
}

.tab {
  border-radius: 999px;
  border: 1px solid rgba(216,181,91,0.18);
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
}

.tab--active {
  background: var(--gold);
  color: #1b1026;
  border-color: rgba(0,0,0,0.15);
}

/* ---- MODAL ---- */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
}

.modal--open { display: block; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}

.modal__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 900px;
  max-width: 95vw;
  background: var(--card-bg);
  border: 1px solid rgba(216,181,91,0.20);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-md);
  border-bottom: 1px solid rgba(216,181,91,0.10);
}

.modal__title {
  font-size: 20px;
  font-family: var(--font-heading);
}

.modal__body {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 0;
}

.modal__left { padding: var(--s-md); }
.modal__right {
  padding: var(--s-md);
  border-left: 1px solid rgba(216,181,91,0.10);
  background: rgba(255,255,255,0.03);
}

.modal__rightTitle {
  margin: 0 0 var(--s-xs) 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.modal__rightList { margin: 0; padding-left: 16px; font-size: 14px; }

.modal__rightMerchant { margin-top: var(--s-md); }

.form { display: flex; flex-direction: column; gap: var(--s-sm); }

.field__label { display: flex; gap: 8px; align-items: baseline; }

.field__req {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field__input, .field__textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(216,181,91,0.20);
  background: rgba(0,0,0,0.18);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
}

.field__input:focus, .field__textarea:focus { outline: 2px solid var(--focus); outline-offset: 2px; }

.form__actions { display: flex; gap: var(--s-xs); }

.form__note {
  color: var(--text-muted);
  font-size: 13px;
}

.form__error {
  color: var(--danger);
  font-size: 13px;
  min-height: 16px;
}

/* ---- TICKET 3: Claim flow banners ---- */

.claim-success {
  padding: var(--s-sm) var(--s-md);
  margin-bottom: var(--s-sm);
  border-radius: var(--r-md);
  border: 1px solid rgba(216,181,91,0.30);
  background: rgba(216,181,91,0.14);
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.claim-warning {
  padding: var(--s-sm) var(--s-md);
  margin-bottom: var(--s-sm);
  border-radius: var(--r-md);
  border: 1px solid rgba(255,90,122,0.30);
  background: rgba(255,90,122,0.12);
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---- HW-010a: FORM FIELD CLASSES (modal claim form) ---- */

.gift-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-sm);
}

.form__row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form__label {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 14px;
  color: var(--text-primary);
}

.form__input, .form__textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(216,181,91,0.20);
  background: rgba(0,0,0,0.18);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
}

.form__input:focus, .form__textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.form__textarea {
  min-height: 80px;
  resize: vertical;
}

.form__req {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form__shipping {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

/* ---- HW-010a: MODAL CLOSE BUTTON ---- */

.modal__close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(216,181,91,0.18);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
}

.modal__close:hover { background: rgba(255,255,255,0.06); }
.modal__close:focus { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---- HW-010a: COMPACT BUTTON VARIANT ---- */

.btn--sm {
  padding: 5px 8px;
  font-size: 12px;
  border-radius: 10px;
}

/* ---- HW-010a: DREAM COLUMN OVERFLOW FIX ---- */

.dream__col {
  min-width: 0;
}

/* ---- DETAIL MODAL (HW-012A) ---- */

.detailModal {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--panel-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detailModal[hidden] { display: none; }

.detailModal__header {
  display: flex;
  align-items: center;
  padding: var(--s-sm) var(--s-md);
  border-bottom: 1px solid rgba(216, 181, 91, 0.10);
  flex-shrink: 0;
}

.detailModal__back {
  background: none;
  border: none;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 0;
  font-weight: 600;
}

.detailModal__back:hover { text-decoration: underline; }

.detailModal__scroll {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--s-lg);
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}

/* ---- HW-010b: RESPONSIVE BREAKPOINT ---- */

@media (max-width: 767px) {

  /* --- Hide desktop panels --- */
  .rail { display: none; }

  /* --- Single-column app grid --- */
  .app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  /* --- Middle panel full-width --- */
  .middle {
    border-right: none;
  }

  .middle__scroll {
    padding-bottom: 200px; /* space for bottom sheet */
  }

  /* --- Two-column tile grid --- */
  .tiles {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-xs);
  }

  .tile__img {
    height: 70px;
  }

  .tile__body {
    padding: var(--s-xs);
  }

  .tile__title {
    font-size: 13px;
  }

  .tile__desc {
    font-size: 11px;
  }

  .tile__price {
    font-size: 12px;
  }

  .badge {
    font-size: 9px;
    padding: 2px 5px;
  }

  /* --- Modal: full-width on mobile --- */
  .modal__panel {
    width: 100%;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: none;
    overflow-y: auto;
  }

  .modal__body {
    grid-template-columns: 1fr;
  }

  .modal__right {
    border-left: none;
    border-top: 1px solid rgba(216,181,91,0.10);
  }

  .modal__header {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 10;
  }

  /* --- Outside budget slots: single column on mobile --- */
  .outside__slots {
    grid-template-columns: 1fr;
  }
}
