:root {
  --bg: #fdf6f0;
  --card: #ffffff;
  --ink: #3a3340;
  --muted: #8a8290;
  --accent: #f2a2b8;
  --accent-2: #a7d3d8;
  --accent-ink: #b25c78;
  --ok: #6bbf8a;
  --warn: #e08a8a;
  --line: #efe4dc;
  --shadow: 0 6px 24px rgba(120, 90, 90, 0.12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2 { font-weight: 700; }

/* ===== Intro page ===== */
.intro {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 48px;
}
.intro-inner {
  max-width: 460px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.invite {
  width: 100%;
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: block;
}
.invite.img-missing { display: none; }
.invite-full { max-width: 460px; }
.intro-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.intro-card h1 { font-size: 26px; margin: 0 0 14px; color: var(--accent-ink); }
.intro-card p { line-height: 1.6; font-size: 15px; margin: 0 0 14px; color: var(--ink); }
.intro-card .btn { margin-top: 6px; }

/* ===== List banner (invitation art at top of list) ===== */
.list-banner {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 20px 0;
}
.invite-banner {
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: rgba(253, 246, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 18px; margin: 0; flex: 1; min-width: 0; line-height: 1.25; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-round {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--accent-ink);
  cursor: pointer; box-shadow: var(--shadow); padding: 0;
}
.icon-round:active { transform: scale(0.94); }
.cart-btn {
  flex-shrink: 0;
  border: none; background: var(--accent); color: #fff;
  font-size: 16px; font-weight: 600;
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  box-shadow: var(--shadow);
}
.cart-btn:active { transform: scale(0.96); }

main { max-width: 760px; margin: 0 auto; padding: 20px; }
.items { display: grid; gap: 14px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow);
}
.card.full { opacity: 0.6; }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card-top > div { min-width: 0; }
.card-name { font-size: 17px; font-weight: 600; margin: 0; }
.card-unit { display: inline-block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-count { font-size: 14px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.card-count strong { color: var(--accent-ink); }

.bar { height: 8px; background: var(--line); border-radius: 999px; margin: 10px 0 12px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent-2); border-radius: 999px; transition: width .3s; }
.no-limit-spacer { height: 12px; }

.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qty { display: flex; align-items: center; gap: 12px; }
.qty button {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; font-size: 18px; cursor: pointer; color: var(--ink);
}
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty span { min-width: 22px; text-align: center; font-weight: 600; }
.add-btn {
  border: none; background: var(--accent-ink); color: #fff;
  padding: 9px 16px; border-radius: 10px; font-weight: 600; cursor: pointer;
}
.add-btn:disabled { background: #cbb9c1; cursor: not-allowed; }
.badge-full {
  background: #f7e9ee; color: var(--accent-ink); font-weight: 600;
  padding: 6px 12px; border-radius: 999px; font-size: 13px;
}

/* Floating checkout button — fixed, follows scroll */
.floating-checkout {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 260px;
  max-width: calc(100% - 32px);
  padding: 15px 26px;
  border: none;
  border-radius: 999px;
  background: var(--accent-ink);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(178, 92, 120, 0.45);
  transition: opacity .25s, transform .25s;
}
.floating-checkout:active { transform: translateX(-50%) scale(0.97); }
.floating-checkout .fc-count {
  background: rgba(255, 255, 255, 0.22);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.floating-checkout.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(20px);
}
/* Keep last card clear of the floating button */
main { padding-bottom: 96px; }

/* Overlays / modal */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(58, 51, 64, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.overlay.hidden { display: none; }
.modal {
  background: var(--card); border-radius: 22px; max-width: 440px; width: 100%;
  padding: 28px 26px; text-align: center; box-shadow: var(--shadow);
}
.modal-emoji { font-size: 40px; margin-bottom: 6px; }
.modal h2 { margin: 6px 0 12px; }
.modal p { color: var(--ink); line-height: 1.55; margin: 0 0 12px; font-size: 15px; }
.event-info { width: 100%; max-width: 330px; border-radius: 12px; margin: 4px auto 16px; display: block; box-shadow: var(--shadow); }
.event-info.img-missing { display: none; }

.btn { border: none; border-radius: 12px; font-size: 16px; font-weight: 600; padding: 13px 20px; cursor: pointer; width: 100%; }
.btn-primary { background: var(--accent-ink); color: #fff; margin-top: 8px; }
.btn-primary:active { transform: scale(0.98); }

/* Cart drawer */
.cart-drawer {
  background: var(--card); border-radius: 22px; max-width: 460px; width: 100%;
  padding: 22px; box-shadow: var(--shadow); max-height: 86vh; overflow-y: auto;
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h2 { margin: 0; }
.icon-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.cart-lines { margin: 16px 0; display: grid; gap: 10px; }
.cart-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-line .rm { background: none; border: none; color: var(--warn); cursor: pointer; font-size: 13px; }
/* Gift card options */
.gift-options { background: #fbf1ec; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.gift-options.hidden { display: none; }
.gift-q { font-size: 14px; font-weight: 600; color: var(--accent-ink); margin: 0 0 10px; }
.gift-options .radio { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; padding: 7px 0; cursor: pointer; }
.gift-options .radio input { margin-top: 2px; accent-color: var(--accent-ink); width: 16px; height: 16px; flex-shrink: 0; }
.payid-info { margin-top: 8px; background: #fff; border: 1px dashed var(--accent); border-radius: 10px; padding: 12px 14px; font-size: 15px; color: var(--ink); line-height: 1.5; }
.payid-info.hidden { display: none; }
.payid-info strong { color: var(--accent-ink); }

.checkout-box label { display: block; font-weight: 600; margin-bottom: 6px; }
.checkout-box input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  font-size: 16px; margin-bottom: 6px;
}
.hint { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }
.hidden { display: none; }
.error { color: var(--warn); font-size: 14px; margin-top: 10px; }
.error.hidden { display: none; }
