:root{
  --pink1:#fff0f6;
  --pink2:#ffe3ee;
  --red1:#ff2d55;
  --red2:#ff4d6d;

  --card: rgba(255,255,255,0.94);
  --text:#1a1a1a;
  --muted:#6a4b57;

  --shadow: 0 22px 65px rgba(0,0,0,0.12);
  --radius: 22px;
}

*{ box-sizing:border-box; }

html, body{
  width: 100%;
  overflow-x: hidden;
}

body{
  margin:0;
  min-height:100vh;
  display:grid;
  place-items:center;
  background:
    radial-gradient(circle at 20% 10%, var(--pink2), var(--pink1)),
    radial-gradient(circle at 90% 85%, rgba(255,45,85,0.18), transparent 50%);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
}

.confetti{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:50;
}

.card{
  width:min(900px, calc(100% - 32px));
  padding:28px;
  border-radius:var(--radius);
  background: var(--card);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  position:relative;
  overflow: visible;
}

h1{
  margin:0 0 6px;
  font-size:42px;
  letter-spacing:-0.9px;
}

.askTitle{
  margin:0 0 18px;
  font-size:30px;
  font-weight:950;
  letter-spacing:-0.6px;
}

.sub{
  margin:0 0 18px;
  color:var(--muted);
  line-height:1.45;
}
.sub.tight{ margin:0 0 10px; }

.stage{ margin-top: 8px; }
.hidden{ display:none !important; }

/* Ask typing */
.typingWrap{
  position:relative;
  margin-bottom:14px;
  height:52px;
  display:flex;
  align-items:center;
}
.typingBubble{
  display:inline-flex;
  align-items:center;
  gap:2px;
  padding:12px 14px;
  border-radius:16px;
  background: rgba(255,45,85,0.06);
  border: 1px solid rgba(255,45,85,0.14);
  font-weight:900;
  color:#2b2b2b;
  min-width:min(520px, 100%);
  overflow:hidden;
  white-space:nowrap;
}
.cursor{
  display:inline-block;
  width:10px;
  opacity:0.75;
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink{
  0%, 49% { opacity:0.15; }
  50%, 100% { opacity:0.85; }
}

.buttons{
  position:relative;
  height:76px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px;
  border-radius:18px;
  background: rgba(255,45,85,0.06);
  border: 1px solid rgba(255,45,85,0.14);
}

.resumeRow{
  margin-top: 12px;
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px;
  border-radius:18px;
  background: rgba(255,45,85,0.05);
  border: 1px solid rgba(255,45,85,0.14);
}

.askDisclaimer{
  margin-top:12px;
  font-size:12px;
  color: rgba(106,75,87,0.92);
}

.btn{
  border:0;
  border-radius:16px;
  padding:14px 20px;
  font-size:16px;
  font-weight:800;
  cursor:pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
  user-select:none;
  white-space:nowrap;
}
.btn:active{ transform: scale(0.98); }

.yes{
  background: linear-gradient(135deg, var(--red1), var(--red2));
  color:white;
  box-shadow: 0 14px 28px rgba(255,45,85,0.28);
}

.ghost{
  background: transparent;
  border: 2px solid rgba(255,45,85,0.25);
  color: var(--text);
}

.no{
  background: linear-gradient(135deg, #2b2b2b, #111);
  color:white;
  position:absolute;
  left:190px;
  top:10px;
  transition:
    left 150ms cubic-bezier(0.12, 0.92, 0.18, 1),
    top 150ms cubic-bezier(0.12, 0.92, 0.18, 1),
    transform 150ms cubic-bezier(0.12, 0.92, 0.18, 1);
  will-change:left, top, transform;
}
.no.shrunk{ transform: scale(0.70); }

.tiny{
  margin-top:10px;
  font-size:12px;
  color: rgba(106,75,87,0.85);
  min-height:16px;
}

/* Quiz */
.quizHeader h1{
  margin:0 0 8px;
  font-size:40px;
  letter-spacing:-0.8px;
}

.quiz{
  margin-top:6px;
  padding:18px;
  border-radius:18px;
  background: rgba(255,45,85,0.05);
  border: 1px solid rgba(255,45,85,0.14);
  overflow-x: hidden;
}

.qtitle{
  font-weight:900;
  margin-bottom:12px;
  font-size:20px;
}

.choices{ display:grid; gap:10px; }
.choice{
  display:flex;
  gap:12px;
  align-items:center;
  padding:14px 14px;
  border-radius:16px;
  border: 1px solid rgba(255,45,85,0.14);
  background: rgba(255,255,255,0.85);
}
.choice input{ transform: scale(1.08); }

/* Greyed-out and NOT clickable option */
.choice.softDisabled{
  opacity: 0.45;
  filter: grayscale(0.9);
  cursor: not-allowed;
}
.choice.softDisabled input{ cursor: not-allowed; }
.choice.softDisabled:hover{ opacity: 0.45; }

.textInput{
  width:100%;
  border-radius:16px;
  border: 1px solid rgba(255,45,85,0.18);
  padding:14px;
  font-size:15px;
  outline:none;
  background: rgba(255,255,255,0.92);
}

.qtext{
  width:100%;
  resize:vertical;
  border-radius:16px;
  border: 1px solid rgba(255,45,85,0.18);
  padding:14px;
  font-size:15px;
  outline:none;
  background: rgba(255,255,255,0.92);
}

.error{
  margin-top:10px;
  color:#b00020;
  font-size:13px;
  font-weight:800;
}

/* Address suggest */
.addressWrap{ position: relative; }
.suggest{
  position:absolute;
  left:0;
  right:0;
  top: calc(100% + 8px);
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(255,45,85,0.20);
  border-radius:16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.16);
  overflow:hidden;
  z-index:40;
}
.suggestItem{
  padding:12px 14px;
  font-weight:850;
  cursor:pointer;
  border-bottom: 1px solid rgba(255,45,85,0.10);
}
.suggestItem:last-child{ border-bottom:0; }
.suggestItem:hover{ background: rgba(255,45,85,0.08); }
.suggestSub{
  font-size:12px;
  font-weight:700;
  color: rgba(106,75,87,0.9);
  margin-top:4px;
}

/* Consent */
.agreeBox{
  margin-top:14px;
  padding:14px;
  border-radius:16px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,45,85,0.14);
}
.agreeLine{
  display:flex;
  gap:10px;
  align-items:flex-start;
  font-size:14px;
  color: rgba(26,26,26,0.9);
}
.reqStar{
  color: #d1002a;
  font-weight: 950;
  margin-left: 2px;
}
.disclosure{
  margin-top:10px;
  font-size:12px;
  color: rgba(106,75,87,0.9);
}

/* Time dropdown */
.timePicker{ position:relative; }
.timeButton{
  width:100%;
  border: 1px solid rgba(255,45,85,0.18);
  background: rgba(255,255,255,0.92);
  border-radius:16px;
  padding:14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  cursor:pointer;
  font-weight:850;
}
.chev{ opacity:0.65; }

.timeDropdown{
  position:absolute;
  z-index:30;
  left:0;
  right:0;
  top: calc(100% + 10px);
  border-radius:16px;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(255,45,85,0.20);
  box-shadow: 0 24px 60px rgba(0,0,0,0.16);
  overflow:hidden;
  max-width: 100%;
}
.timeCols{
  display:grid;
  grid-template-columns: 1fr 0.55fr;
}
.timeColTitle{
  padding:12px 14px;
  font-size:12px;
  font-weight:900;
  background: rgba(255,45,85,0.06);
  border-bottom: 1px solid rgba(255,45,85,0.12);
}
.timeList, .ampmList{
  max-height: 320px;
  overflow:auto;
  padding:10px;
}
.timeItem, .ampmItem{
  padding:12px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:850;
}
.timeItem:hover, .ampmItem:hover{ background: rgba(255,45,85,0.08); }
.timeItem.selected, .ampmItem.selected{ background: rgba(255,45,85,0.14); }

/* Nav */
.quizNav{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:12px;
  align-items:center;
  margin-top:16px;
}
.progressWrap{ display:grid; gap:6px; }
.progressBar{
  height:10px;
  border-radius:999px;
  background: rgba(255,45,85,0.12);
  overflow:hidden;
}
#progressFill{
  height:100%;
  width:20%;
  background: linear-gradient(135deg, var(--red1), var(--red2));
  transition: width 160ms ease;
}
.progressText{
  font-size:12px;
  color: rgba(106,75,87,0.9);
}

.errorBox{
  margin-top:14px;
  padding:12px 14px;
  border-radius:16px;
  background: rgba(176,0,32,0.08);
  border: 1px solid rgba(176,0,32,0.15);
  color:#7a0016;
  font-size:13px;
}

.submitResult{
  margin-top:14px;
  padding:18px;
  border-radius:18px;
  border: 1px solid rgba(255,45,85,0.14);
  background: rgba(255,255,255,0.90);
}
.thanksBig{
  font-size:30px;
  font-weight:950;
  letter-spacing:-0.4px;
}

/* Itinerary / Voucher */
.itinerary{
  margin-top:18px;
  padding-top:16px;
  border-top: 1px solid rgba(255,45,85,0.16);
}
.itTitle{
  font-size:20px;
  font-weight:950;
  margin-bottom:12px;
}
.itGrid{
  display:grid;
  grid-template-columns: 170px 1fr;
  gap:10px 14px;
  padding:14px;
  border-radius:16px;
  background: rgba(255,45,85,0.05);
  border: 1px solid rgba(255,45,85,0.14);
}
.itLabel{
  font-size:12px;
  font-weight:950;
  color: rgba(106,75,87,0.95);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.itValue{
  font-weight:900;
  color:#1a1a1a;
  word-break: break-word;
  white-space: pre-line;
}

.voucher{
  margin-top:14px;
  display:flex;
  justify-content:space-between;
  gap:14px;
  padding:14px;
  border-radius:16px;
  background: rgba(255,255,255,0.92);
  border: 1px dashed rgba(255,45,85,0.35);
  overflow: hidden;
}
.voucherTitle{ font-weight:950; font-size:16px; }
.voucherSub{
  margin-top:4px;
  color: rgba(106,75,87,0.9);
  font-size:12px;
  font-weight:800;
}
.voucherCode{
  margin-top:10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight:950;
  letter-spacing: 0.06em;
  color:#7a0b2b;
  overflow-wrap: anywhere;
}
.fakeQr{
  width:116px;
  height:116px;
  border-radius:14px;
  background: rgba(255,45,85,0.06);
  border: 1px solid rgba(255,45,85,0.18);
  display:grid;
  place-items:center;
  overflow:hidden;
}
.printBtn{ margin-top:14px; width: 100%; }

/* Shop */
.shopWrap{
  display:grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap:14px;
  margin-top:12px;
}
.shopCol, .cartCol{
  border-radius:18px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,45,85,0.14);
  overflow:hidden;
  min-width: 0;
}
.shopHeader{
  padding:12px 14px;
  font-weight:950;
  background: rgba(255,45,85,0.06);
  border-bottom: 1px solid rgba(255,45,85,0.12);
}
.shopList{
  max-height: 320px;
  overflow:auto;
  padding:12px;
  display:grid;
  gap:12px;
}
.product{
  border-radius:18px;
  border: 1px solid rgba(255,45,85,0.14);
  background: rgba(255,255,255,0.92);
  padding:12px;
  display:grid;
  gap:10px;
}
.productTop{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
}
.productLeft{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width: 0;
}
.productName{ font-weight:950; }
.productRight{
  display:flex;
  align-items:center;
  gap:10px;
}
.priceTag{
  font-size:12px;
  font-weight:950;
  padding:7px 10px;
  border-radius:999px;
  color: #7a0b2b;
  background: rgba(255,45,85,0.10);
  border: 1px solid rgba(255,45,85,0.18);
  white-space: nowrap;
}
.productActions{ display:flex; gap:10px; }

.cartList{
  max-height: 320px;
  overflow:auto;
  padding:12px;
  display:grid;
  gap:12px;
}
.cartItem{
  border-radius:18px;
  border: 1px solid rgba(255,45,85,0.14);
  background: rgba(255,255,255,0.92);
  padding:12px;
  display:grid;
  gap:10px;
}
.cartTop{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
.qtyRow{
  display:flex;
  gap:10px;
  align-items:center;
}
.qtyBtn{
  width:38px;
  height:38px;
  border-radius:14px;
  border: 1px solid rgba(255,45,85,0.18);
  background: rgba(255,45,85,0.05);
  cursor:pointer;
  font-weight:950;
  color: var(--text);
}
.qtyBtn:disabled{ opacity:0.45; cursor:not-allowed; }
.qtyText{
  min-width:26px;
  text-align:center;
  font-weight:950;
}

/* Print */
@media print{
  body{ background:white; }
  .confetti{ display:none !important; }
  .buttons, .typingWrap, .askDisclaimer, .quizNav, #editBtn, #printBtn, .resumeRow { display:none !important; }
  .card{ box-shadow:none; width: 100%; }
  .submitResult{ border:none; }
}

/* ================================
   MOBILE RESPONSIVE FIXES
   ================================ */
@media (max-width: 720px){
  .card{
    width: calc(100% - 20px);
    padding: 16px;
    border-radius: 18px;
  }

  h1{ font-size: 30px; }
  .askTitle{ font-size: 22px; }

  .typingWrap{ height: auto; }
  .typingBubble{
    min-width: 100%;
    white-space: normal;
    line-height: 1.25;
  }

  /* ✅ Keep buttons stacked, BUT keep NO as absolute so it can dodge */
  .buttons{
    height: 160px;                 /* enough room for the NO to slide */
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px;
    position: relative;            /* required for absolute NO */
    overflow: hidden;              /* keep NO inside the box */
  }

  .yes{
    width: 100%;
    padding: 14px 16px;
  }

  /* ✅ Mobile NO: smaller + absolute again so JS left/top movement works */
  .no{
    position: absolute;
    width: 160px;                  /* smaller so it can move away */
    max-width: 70%;
    left: 50%;
    top: 86px;
    transform: translateX(-50%);   /* centered by default */
  }

  /* When JS shrinks it, keep it usable on mobile */
  .no.shrunk{
    transform: translateX(-50%) scale(0.88);
  }

  .resumeRow{
    flex-direction: column;
    align-items: stretch;
  }

  .quizHeader h1{ font-size: 28px; }

  /* ✅ Mobile nav: Next ABOVE Back, and Step text BELOW both */
  .quizNav{
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* force order */
  #nextBtn, #submitBtn{ order: 1; width: 100%; }
  #backBtn{ order: 2; width: 100%; }
  .progressWrap{ order: 3; }

  /* Make progress text sit under the buttons */
  .progressWrap{
    margin-top: 2px;
  }
  .progressText{
    text-align: left;
  }

  /* Time dropdown: stack columns */
  .timeCols{
    grid-template-columns: 1fr;
  }

  /* Shop: stack Shop + Cart vertically */
  .shopWrap{
    grid-template-columns: 1fr;
  }
  .shopList, .cartList{
    max-height: 260px;
  }

  /* Product layout mobile so Add is always visible */
  .productTop{
    flex-direction: column;
    align-items: stretch;
  }
  .productRight{
    width: 100%;
    justify-content: space-between;
  }
  .productActions{
    width: 100%;
  }
  .productActions .btn{
    width: 100%;
    padding: 12px 14px !important;
  }

  /* Itinerary becomes single column */
  .itGrid{
    grid-template-columns: 1fr;
  }

  /* Voucher stacks */
  .voucher{
    flex-direction: column;
    align-items: flex-start;
  }
  .fakeQr{
    width: 140px;
    height: 140px;
  }
}
