/* ==========================================================
   Template pages & order pages
   ========================================================== */

.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.tp-back { display: block; width: max-content; margin-bottom: 22px; font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-soft); transition: color 0.3s; }
.tp-back:hover { color: var(--gold); }

/* ---------- Template detail ---------- */

.page-template { background: var(--paper); }
.tp-hero { position: relative; overflow: hidden; padding: calc(var(--nav-h) + 50px) 0 100px; background: linear-gradient(160deg, var(--cream), var(--paper) 60%); }
.tp-glow { position: absolute; width: 70vw; height: 70vw; left: -15vw; top: -10vw; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tp-accent) 35%, transparent), transparent 65%); filter: blur(20px); pointer-events: none; }
.tp-grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.tp-visual { position: relative; display: grid; place-items: center; min-height: 70vh; perspective: 1200px; }
.tp-card { width: min(460px, 100%); transform-style: preserve-3d; will-change: transform; }
.tp-card img { width: 100%; height: auto; filter: drop-shadow(0 40px 50px rgba(58, 42, 31, 0.3)); }
.tp-card img.is-arched { border-radius: 240px 240px 20px 20px; }
.tp-sprite { position: absolute; pointer-events: none; z-index: 2; filter: drop-shadow(0 14px 18px rgba(58, 42, 31, 0.2)); }
.tp-sprite--a { width: 110px; top: 6%; right: 2%; }
.tp-sprite--b { width: 80px; bottom: 8%; left: 0; }
.tp-title { font-size: clamp(3rem, 6.4vw, 5.6rem); line-height: 0.98; margin: 18px 0 18px; }
.tp-tagline { font: italic 400 1.5rem/1.35 var(--serif); color: var(--lavender); margin: 0 0 18px; }
.tp-desc { color: var(--ink-soft); margin: 0 0 28px; max-width: 520px; }
.tp-palette { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }
.tp-palette span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(58, 42, 31, 0.2); }
.tp-palette em { margin-left: 8px; font-size: 0.85rem; color: var(--ink-soft); }
.tp-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-bottom: 30px; }
.tp-price strong { font: 400 3rem/1 var(--serif); }
.tp-price s { color: var(--ink-soft); }
.tp-price span { width: 100%; font-size: 0.85rem; color: var(--ink-soft); }
.tp-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }
.tp-included { list-style: none; padding: 20px 0 0; margin: 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.9rem; color: var(--ink-soft); }
.tp-included li::before { content: '✦ '; color: var(--gold); }

.tp-more { background: var(--cream); }
.tp-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.tp-features > div { padding: 34px 28px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.tp-features span { font: italic 1.1rem var(--serif); color: var(--gold); }
.tp-features h3 { font-size: 1.5rem; margin: 14px 0 10px; }
.tp-features p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

.tp-pager { display: flex; justify-content: space-between; gap: 20px; padding: 70px 0 90px; }
.tp-pager-link { display: flex; align-items: center; gap: 20px; }
.tp-pager-link img { width: 110px; height: 140px; object-fit: contain; transition: transform 0.6s var(--ease); }
.tp-pager-link:hover img { transform: translateY(-8px) rotate(-3deg); }
.tp-pager-link span { font: 400 1.6rem/1.2 var(--serif); }
.tp-pager-link em { display: block; font: normal 0.68rem var(--sans); letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.tp-pager-link--next { text-align: right; }

/* ---------- Order pages ---------- */

.page-wizard { background: var(--cream); }
.wz-hero { position: relative; overflow: hidden; padding: calc(var(--nav-h) + 50px) 0 40px; text-align: center; }
.wz-hero-flower { position: absolute; right: -40px; top: 40px; width: clamp(150px, 18vw, 260px); pointer-events: none; }
.wz-title { font-size: clamp(2.6rem, 5.6vw, 4.6rem); margin: 18px 0 14px; }
.wz-intro { max-width: 560px; margin: 0 auto 36px; color: var(--ink-soft); }
.wz-dots { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0; margin: 0; }
.wz-dots button { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border: 1px solid transparent; border-radius: 999px; background: none; font-size: 0.8rem; color: var(--ink-soft); transition: all 0.4s var(--ease); }
.wz-dots button span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); font: italic 0.95rem/1 var(--serif); transition: all 0.4s var(--ease); }
.wz-dots button:disabled { opacity: 0.5; cursor: default; }
.wz-dots li.is-done button span { background: var(--gold-light); border-color: var(--gold-light); color: #fff; }
.wz-dots li.is-active button { border-color: var(--gold); background: var(--paper); color: var(--ink); }
.wz-dots li.is-active button span { background: var(--gold); border-color: var(--gold); color: #fff; }

.wz-grid { display: grid; grid-template-columns: 1fr 380px; gap: 30px; align-items: start; padding-bottom: 110px; }
.wz-form { padding: clamp(24px, 4vw, 44px); border-radius: 26px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.wz-progress { height: 3px; border-radius: 3px; background: var(--sand); overflow: hidden; margin-bottom: 14px; }
.wz-progress span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), var(--lavender)); transform: scaleX(0); transform-origin: left; }
.wz-count { display: flex; justify-content: space-between; align-items: center; margin: 0 0 28px; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.wz-back { background: none; border: 0; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }

.wz-step { margin: 0; padding: 0; border: 0; min-width: 0; }
.wz-step-title { display: flex; align-items: center; gap: 14px; padding: 0; margin-bottom: 10px; font: 400 clamp(1.7rem, 3vw, 2.2rem)/1.1 var(--serif); }
.wz-step-title span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--plum); color: var(--gold-light); font: italic 1.2rem/1 var(--serif); flex-shrink: 0; }
.wz-step-sub { margin: 0 0 28px; color: var(--ink-soft); }
.wz-step-sub strong { color: var(--ink); font-weight: 400; }
.wz-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 26px 0 12px; font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); }
.wz-label span { letter-spacing: 0.08em; text-transform: none; color: var(--ink-soft); font-size: 0.85rem; }
.wz-free-left { color: var(--lavender) !important; }
.wz-note { margin: 18px 0 0; font-size: 0.88rem; color: var(--ink-soft); }
.wz-actions { display: flex; justify-content: flex-end; margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--line); }
.wz-actions .btn { min-width: 220px; }
.wz-secure { margin: 16px 0 0; font-size: 0.8rem; color: var(--ink-soft); text-align: right; }

/* Design picker */
.design-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.design { position: relative; cursor: pointer; }
.design input { position: absolute; opacity: 0; pointer-events: none; }
.design-body { position: relative; display: flex; flex-direction: column; height: 100%; padding: 16px 16px 40px; border-radius: 18px; border: 1px solid var(--line); background: #fff; transition: border-color 0.3s, box-shadow 0.4s, transform 0.5s var(--ease); }
.design:hover .design-body { transform: translateY(-4px); box-shadow: var(--shadow); }
.design input:checked + .design-body { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(168, 132, 79, 0.25), var(--shadow); }
.design input:focus-visible + .design-body { outline: 2px solid var(--lavender); outline-offset: 3px; }
.design-img { display: grid; place-items: center; height: 190px; margin-bottom: 12px; overflow: hidden; }
.design-img img { width: 100%; height: 100%; min-height: 0; object-fit: contain; transition: transform 0.6s var(--ease); }
.design-img img.is-arched { width: auto; border-radius: 90px 90px 10px 10px; }
.design:hover .design-img img { transform: scale(1.05) rotate(-1.5deg); }
.design strong { font: 400 1.3rem/1.2 var(--serif); }
.design small { color: var(--ink-soft); font-size: 0.82rem; line-height: 1.45; margin-top: 4px; }
.design-check { position: absolute; top: 12px; left: 12px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #fff; transform: scale(0); }
.design input:checked + .design-body .design-check { transform: scale(1); }
.design .chip-badge { position: absolute; top: 12px; right: 12px; z-index: 1; }
.design-link { position: absolute; left: 16px; bottom: 14px; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.design-link:hover { text-decoration: underline; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; display: inline-flex; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip-body, .chip--fixed, .chip--added { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 0.92rem; transition: all 0.3s var(--ease); }
.chip:hover .chip-body { border-color: var(--gold); transform: translateY(-2px); }
.chip input:checked + .chip-body { background: var(--plum); border-color: var(--plum); color: #fff; }
.chip input:focus-visible + .chip-body { outline: 2px solid var(--lavender); outline-offset: 2px; }
.chip--fixed { background: var(--lavender-soft); border-color: transparent; color: var(--ink-soft); cursor: default; }
.chip--fixed em { font-style: normal; font-size: 0.75rem; color: var(--lavender); }
.chip--added { background: var(--lavender-soft); border-color: rgba(141, 111, 174, 0.3); }
.chip--added button { background: none; border: 0; font-size: 1.1rem; line-height: 1; color: var(--lavender); padding: 0 0 0 4px; }
.chip-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; background: var(--gold); color: #fff; font: 500 0.56rem/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.chip-price { font-style: normal; font-size: 0.78rem; color: var(--gold); }
.chip-price.is-free { color: var(--ok); }
.chip input:checked + .chip-body .chip-price { color: var(--gold-light); }
.chip input:checked + .chip-body .chip-price.is-free { color: #a7d6b0; }
.chips--large .chip-body { padding: 13px 20px; }

.custom-add { display: flex; gap: 10px; }
.custom-add input, .custom-add select { flex: 1; min-width: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: 300 1rem var(--sans); color: var(--ink); }
.custom-add input:focus, .custom-add select:focus { outline: none; border-color: var(--gold); }
.custom-add + .chips { margin-top: 12px; }
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
#lang-extra { margin-top: 14px; }

/* Touches */
.touch-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.touch { position: relative; display: block; cursor: pointer; }
.touch input { position: absolute; opacity: 0; pointer-events: none; }
.touch-body { position: relative; display: flex; align-items: center; gap: 14px; height: 100%; padding: 18px 18px; border-radius: 16px; border: 1px solid var(--line); background: #fff; transition: all 0.35s var(--ease); }
.touch:hover .touch-body { border-color: var(--gold); transform: translateY(-2px); }
.touch input:checked + .touch-body { border-color: var(--gold); background: #fff8ec; box-shadow: 0 0 0 3px rgba(168, 132, 79, 0.18); }
.touch input:focus-visible + .touch-body { outline: 2px solid var(--lavender); outline-offset: 2px; }
.touch-text { display: grid; gap: 3px; flex: 1; }
.touch-text strong { font: 400 1.2rem/1.2 var(--serif); }
.touch-text small { font-size: 0.82rem; line-height: 1.45; color: var(--ink-soft); }
.touch-price { font-style: normal; font-size: 0.9rem; color: var(--gold); white-space: nowrap; }
.touch .chip-badge { position: absolute; top: -9px; left: 16px; }
.touch-included { display: none; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--lavender); }
.touch.is-covered { pointer-events: none; }
.touch.is-covered .touch-body { background: var(--lavender-soft); border-style: dashed; }
.touch.is-covered .touch-price { display: none; }
.touch.is-covered .touch-included { display: block; }
.touch--express .touch-body { background: linear-gradient(120deg, #fff, #fbf1dd); }
.touch-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--plum); color: var(--gold-light); }
.touch--bundle .touch-body { background: linear-gradient(120deg, #fff, var(--lavender-soft)); }

/* Counters */
.counter-card { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px; border-radius: 16px; border: 1px solid var(--line); background: #fff; margin-bottom: 14px; }
.counter-card strong { display: block; font: 400 1.3rem var(--serif); }
.counter-card small { display: block; font-size: 0.85rem; color: var(--ink-soft); max-width: 420px; }
.counter { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.counter button { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 0.78rem; color: var(--ink); transition: all 0.3s; }
.counter button:hover { border-color: var(--gold); background: var(--gold); color: #fff; }
.counter input { width: 64px; height: 42px; text-align: center; border: 1px solid var(--line); border-radius: 12px; font: 400 1.3rem var(--serif); color: var(--ink); background: #fff; -moz-appearance: textfield; }
.counter input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Terms checkbox */
.check { display: flex; align-items: flex-start; gap: 12px; margin-top: 18px; font-size: 0.92rem; color: var(--ink-soft); cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--gold); }
.check a { color: var(--gold); text-decoration: underline; }
.check.is-invalid span { color: var(--bad); }

/* Summary */
.wz-summary { position: sticky; top: calc(var(--nav-h) + 20px); }
.wz-summary-inner { padding: 30px; border-radius: 26px; background: var(--plum); color: #f6ecdf; box-shadow: var(--shadow); }
.wz-summary .eyebrow { color: var(--gold-light); }
.wz-summary h3 { font-size: 1.8rem; margin: 6px 0 4px; }
.wz-summary-art { display: grid; place-items: center; min-height: 0; margin: 18px 0 8px; }
.wz-summary-art img { max-height: 190px; width: auto; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.4)); }
.wz-summary-art:empty { display: none; }
.wz-summary-delivery { margin: 0 0 18px; font-size: 0.85rem; color: rgba(246, 236, 223, 0.65); }
.wz-lines { display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; margin: 0 0 18px; padding-top: 18px; border-top: 1px solid rgba(216, 185, 127, 0.25); font-size: 0.92rem; }
.wz-lines dt { color: rgba(246, 236, 223, 0.78); }
.wz-lines dd { margin: 0; text-align: right; }
.wz-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 16px; border-top: 1px solid rgba(216, 185, 127, 0.25); }
.wz-total strong { font: 400 2.8rem/1 var(--serif); color: var(--gold-light); }
.wz-trust { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; font-size: 0.85rem; color: rgba(246, 236, 223, 0.75); }
.wz-trust li { display: flex; align-items: center; gap: 8px; }
.wz-trust .ic { color: var(--gold-light); }
.wz-summary-toggle { display: none; }

/* ---------- Brief form ---------- */

.brief-form .vs-form { margin-top: 26px; }
.brief-form fieldset { border: 0; padding: 0; margin: 20px 0 0; display: grid; gap: 16px; }
.brief-form legend { font: 400 1.6rem var(--serif); margin-bottom: 6px; }
.upload { display: grid; place-items: center; gap: 6px; padding: 30px; border: 1.5px dashed var(--gold-light); border-radius: 16px; background: #fff; text-align: center; color: var(--ink-soft); cursor: pointer; }
.upload input { max-width: 100%; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .tp-features { grid-template-columns: repeat(2, 1fr); }
  .wz-grid { grid-template-columns: 1fr 320px; }
  .design-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .tp-grid { grid-template-columns: 1fr; }
  .tp-visual { min-height: 0; padding-top: 10px; }
  .tp-card { width: min(360px, 86%); }
  .wz-grid { grid-template-columns: 1fr; padding-bottom: 130px; }
  .wz-summary { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 50; }
  .wz-summary-inner { position: absolute; left: 10px; right: 10px; bottom: 70px; max-height: 70vh; overflow-y: auto; transform: translateY(120%); transition: transform 0.6s var(--ease); }
  .wz-summary.is-open .wz-summary-inner { transform: none; }
  .wz-summary-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 18px 22px calc(18px + env(safe-area-inset-bottom)); background: var(--plum); color: #f6ecdf; border: 0; border-top: 1px solid rgba(216, 185, 127, 0.3); font-size: 0.9rem; }
  .wz-summary-toggle strong { font: 400 1.5rem var(--serif); color: var(--gold-light); margin-left: 8px; }
  .wz-summary-toggle em { font-style: normal; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; }
  .wz-dots button { font-size: 0; padding: 4px; gap: 0; }
  .wz-dots button span { font-size: 0.95rem; }
  .wz-dots li.is-active button { font-size: 0.8rem; padding: 4px 14px 4px 4px; gap: 10px; }
}

@media (max-width: 640px) {
  .tp-features { grid-template-columns: 1fr; }
  .tp-pager-link span { font-size: 1.2rem; }
  .tp-pager-link img { width: 70px; height: 90px; }
  .design-grid, .design-grid--3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .design-img { height: 140px; }
  .design small { display: none; }
  .touch-grid { grid-template-columns: 1fr; }
  .lang-grid { grid-template-columns: 1fr; }
  .counter-card { flex-direction: column; align-items: flex-start; }
  .wz-actions .btn { width: 100%; min-width: 0; }
  .wz-secure { text-align: center; }
}

/* Promo code (guest links) */
.promo-card { display: grid; gap: 10px; padding: 16px 18px; margin-bottom: 14px; border-radius: 16px; border: 1px dashed var(--gold); background: #fffaf0; }
.promo-card span { font-size: 0.92rem; color: var(--ink-soft); }
.promo-card strong { color: var(--ink); }
.promo-card b { color: var(--gold-deep); letter-spacing: 0.08em; }
.promo-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font: 500 16px/1.2 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; background: #fff; }

/* Coupon (applied automatically) and referral code */
.promo-card--applied { grid-template-columns: auto 1fr; align-items: center; border-style: solid; border-color: rgba(79, 138, 91, 0.45); background: #f1f8f2; }
.promo-card--applied strong { display: block; color: #3c7a49; }
.promo-tick { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #4f8a5b; color: #fff; }
.promo-tick .ic { width: 18px; height: 18px; }
.ref-field { margin: 4px 0 14px; }
.ref-input { display: flex; gap: 8px; }
.ref-input input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 0.1em; }
.ref-status { margin: -4px 0 0; padding: 10px 14px; border-radius: 12px; background: #f3ecfa; color: #4b2a63; font-size: 0.86rem; }
.ref-status b { letter-spacing: 0.08em; }
.wz-lines .is-discount { color: #e3c8ff; }
.wz-ref { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: rgba(141, 111, 174, 0.25); color: #f1dcff; font-size: 0.8rem; }
