/* ============ Buttons ============ */
.btn {
  --bh: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--bh); padding: 0 20px; border-radius: var(--r-pill);
  font-weight: 650; font-size: var(--fs-sm); letter-spacing: -0.005em; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), background var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), color var(--t-med);
  user-select: none; position: relative;
}
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--ink-bg); color: #fff; box-shadow: 0 8px 20px -10px rgba(13,20,17,.7); }
.btn-primary:hover { background: #1f2a25; }
.btn-blaze { background: var(--blaze); color: #fff; box-shadow: 0 10px 22px -10px rgba(255,91,20,.85); }
.btn-blaze:hover { background: var(--blaze-2); }
.btn-turf { background: var(--turf-fill); color: #fff; }
.btn-turf:hover { background: var(--turf-2); }
.btn-outline { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-outline:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { background: rgba(13,20,17,.06); }
.btn-sm { --bh: 36px; padding: 0 14px; font-size: var(--fs-xs); gap: 6px; }
.btn-lg { --bh: 56px; padding: 0 26px; font-size: var(--fs-md); }
.btn-block { width: 100%; }
.btn-icon { width: var(--bh); padding: 0; }
/* Signature CTA: ink pill with a blaze disc that nudges on hover */
.btn-cta { padding-inline-end: 6px; }
.btn-cta .btn-disc {
  width: calc(var(--bh) - 10px); height: calc(var(--bh) - 10px); border-radius: 50%;
  background: var(--blaze); display: grid; place-items: center; color: #fff;
  transition: transform var(--t-med) var(--ease-spring);
}
.btn-cta:hover .btn-disc { transform: translateX(3px) rotate(-8deg); }
.btn-blaze.btn-cta .btn-disc { background: rgba(255,255,255,.22); }
.btn .spinner { width: 16px; height: 16px; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center; position: relative;
  color: var(--ink); transition: background var(--t-fast);
}
.icon-btn:hover { background: rgba(13,20,17,.06); }
.icon-btn .dot-count {
  position: absolute; top: 3px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--blaze); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--paper); font-variant-numeric: tabular-nums;
}
.icon-btn .dot-count.bump { animation: bump .5s var(--ease-spring); }
@keyframes bump { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

.link { font-weight: 650; display: inline-flex; align-items: center; gap: 6px; border-bottom: 1.5px solid transparent; transition: border-color var(--t-fast); }
.link:hover { border-color: currentColor; }
.link-blaze { color: var(--blaze-2); }

/* ============ Chips, badges ============ */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-sm); font-weight: 550; color: var(--ink-2);
  transition: all var(--t-fast) var(--ease); white-space: nowrap;
}
.chip:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-3); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--ink-bg); color: #fff; box-shadow: none; }
.chip .chip-count { font-size: 11px; opacity: .7; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chips::-webkit-scrollbar { display: none; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 650; background: var(--surface-3); color: var(--ink-2); white-space: nowrap;
}
.badge-turf { background: var(--turf-tint); color: var(--turf); }
.badge-blaze { background: var(--blaze-tint); color: var(--blaze-2); }
.badge-gold { background: var(--gold-tint); color: #8a6206; }
.badge-danger { background: var(--danger-tint); color: var(--danger); }
.badge-info { background: var(--info-tint); color: var(--info); }
.badge-ink { background: var(--ink-bg); color: #fff; }
.badge-glass { background: rgba(255,255,255,.88); color: var(--ink-fixed); backdrop-filter: blur(8px); }
.badge .live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ============ Cards ============ */
.card {
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-1);
  border: 1px solid var(--line-2);
}
.card-pad { padding: clamp(16px, 2.4vw, 24px); }
.panel { background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); }
.panel-pad { padding: clamp(18px, 3vw, 32px); }
.card-link { transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease); }
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }

/* Media frame for real photography */
.media { position: relative; overflow: hidden; background: var(--surface-3); }
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease); }
.card-link:hover .media img { transform: scale(1.045); }
.media .media-top { position: absolute; inset: 12px 12px auto 12px; display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }

/* ============ Form fields ============ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: var(--fs-sm); font-weight: 650; color: var(--ink); }
.field-hint { font-size: var(--fs-xs); color: var(--ink-3); }
.field-error { font-size: var(--fs-xs); color: var(--danger); font-weight: 600; min-height: 0; }
.input, .select, .textarea {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r-sm); background: var(--surface);
  border: 1px solid var(--line); transition: border-color var(--t-fast), box-shadow var(--t-fast); outline: none;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: var(--ring); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2346514B' stroke-width='1.8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-inline-end: 36px; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input-icon > .input { padding-inline-start: 42px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* Radio cards */
.choice { position: relative; display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.choice:hover { border-color: var(--ink-3); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--ink); background: var(--surface-2); box-shadow: 0 0 0 1px var(--ink); }
.choice:has(input:focus-visible) { box-shadow: var(--ring); }
.choice .radio-dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; display: grid; place-items: center; }
.choice:has(input:checked) .radio-dot { border-color: var(--ink); }
.choice:has(input:checked) .radio-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--blaze); }

/* Quantity stepper */
.qty { display: inline-flex; align-items: center; height: 42px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
.qty button { width: 40px; height: 100%; display: grid; place-items: center; border-radius: 50%; }
.qty button:hover { background: var(--surface-2); }
.qty output { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.qty-sm { height: 34px; }
.qty-sm button { width: 32px; }

/* Segmented tabs */
.tabs { display: inline-flex; padding: 4px; border-radius: var(--r-pill); background: var(--surface-3); gap: 2px; position: relative; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { height: 38px; padding: 0 16px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: color var(--t-fast), background var(--t-med) var(--ease); }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* Underline sub-nav */
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { padding: 12px 14px; font-weight: 600; font-size: var(--fs-sm); color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color var(--t-fast); }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); border-color: var(--blaze); }

/* Rating */
.stars { display: inline-flex; gap: 1px; color: var(--blaze); }
.rating { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: var(--fs-sm); }
.rating .count { color: var(--ink-3); font-weight: 500; }

/* Avatars */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-3); display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-inline-start: -9px; }
.avatar-stack .avatar:first-child { margin-inline-start: 0; }
.avatar-stack .avatar.more { background: var(--ink-bg); font-size: 11px; }

/* Progress / slot meter */
.meter { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--turf-fill); border-radius: inherit; transition: width var(--t-slow) var(--ease); }
.meter.is-hot > span { background: var(--blaze); }

/* Spots: one pip per player slot */
.spots { display: flex; gap: 4px; flex-wrap: wrap; }
.spots i { width: 14px; height: 14px; border-radius: 50%; background: var(--turf-fill); display: block; }
.spots i.open { background: transparent; box-shadow: inset 0 0 0 1.5px var(--blaze); }

/* Stepper (checkout progress) */
.steps { display: flex; gap: 6px; align-items: center; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; }
.steps li + li::before { content: ""; width: 24px; height: 1.5px; background: var(--line); margin-inline-end: 2px; }
.steps .step-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; box-shadow: inset 0 0 0 1.5px var(--line); }
.steps li.is-done { color: var(--turf); }
.steps li.is-done .step-n { background: var(--turf-fill); color: #fff; box-shadow: none; }
.steps li.is-current { color: var(--ink); }
.steps li.is-current .step-n { background: var(--ink-bg); color: #fff; box-shadow: none; }

/* Key-value list */
.kv { display: grid; gap: 12px; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; font-size: var(--fs-sm); }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 650; text-align: end; }
.kv .total { font-size: var(--fs-lg); padding-top: 12px; border-top: 1px dashed var(--line); }
.kv .total dt { color: var(--ink); font-weight: 650; }

/* Tables */
.table { font-size: var(--fs-sm); }
.table th { text-align: start; font-weight: 600; color: var(--ink-3); font-size: var(--fs-xs); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: end; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.is-me { background: var(--blaze-tint); }
.table-wrap { overflow-x: auto; }

/* Empty state */
.empty { text-align: center; padding: clamp(32px, 6vw, 64px) 20px; display: grid; justify-items: center; gap: 12px; }
.empty .empty-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--surface-3); display: grid; place-items: center; color: var(--ink-2); }
.empty p { color: var(--ink-3); max-width: 42ch; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--surface-3) 0%, #f3f4f1 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Overlays ============ */
.overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.overlay-scrim { position: absolute; inset: 0; background: rgba(13,20,17,.45); backdrop-filter: blur(3px); animation: fadeIn var(--t-med) var(--ease); }
.modal {
  position: relative; width: min(560px, 100%); max-height: calc(100dvh - 40px); overflow: auto; background: var(--surface);
  border-radius: var(--r-lg); box-shadow: var(--shadow-3); animation: modalIn var(--t-slow) var(--ease);
}
.modal-wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.modal-body { padding: 18px 24px 24px; }
.modal-foot { padding: 16px 24px 22px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: var(--surface); }
.drawer { position: absolute; top: 0; inset-inline-end: 0; bottom: 0; width: min(420px, 100%); background: var(--surface); box-shadow: var(--shadow-3); display: flex; flex-direction: column; animation: drawerIn var(--t-slow) var(--ease); }
.drawer.left { inset-inline-start: 0; inset-inline-end: auto; animation-name: drawerInL; }
.drawer-body { flex: 1; overflow: auto; padding: 20px 24px; }
.overlay.is-closing .modal, .overlay.is-closing .drawer { animation: modalOut 180ms var(--ease) forwards; }
.overlay.is-closing .overlay-scrim { animation: fadeOut 180ms forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes drawerIn { from { transform: translateX(100%); } }
@keyframes drawerInL { from { transform: translateX(-100%); } }
@media (max-width: 640px) {
  .overlay:not(.overlay-drawer) { place-items: end stretch; padding: 0; }
  .overlay:not(.overlay-drawer) .modal { width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92dvh; animation-name: sheetIn; }
  @keyframes sheetIn { from { transform: translateY(100%); } }
}

/* Toasts */
.toast-root { position: fixed; z-index: 300; left: 50%; bottom: calc(var(--tabbar-h) + 20px); transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 12px; border-radius: var(--r-md); background: var(--ink-bg); color: #fff; box-shadow: var(--shadow-3); animation: toastIn var(--t-slow) var(--ease-spring); font-size: var(--fs-sm); }
.toast .toast-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); flex: none; }
.toast.success .toast-ico { background: var(--turf-2); }
.toast.error .toast-ico { background: var(--danger-fill); }
.toast .toast-action { margin-inline-start: auto; font-weight: 700; color: #FFB48F; }
.toast.is-leaving { animation: toastOut 220ms var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* Success burst (confirmation screens) */
.success-mark { width: 84px; height: 84px; border-radius: 50%; background: var(--turf-fill); color: #fff; display: grid; place-items: center; position: relative; animation: pop .6s var(--ease-spring); }
.success-mark::before, .success-mark::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--turf); opacity: 0; animation: ripple 1.6s var(--ease) .2s; }
.success-mark::after { animation-delay: .45s; }
.success-mark svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .25s var(--ease) forwards; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
@keyframes ripple { 0% { opacity: .6; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Ticket (booking/order confirmation) */
.ticket { position: relative; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: hidden; }
.ticket-cut { position: relative; height: 0; border-top: 2px dashed var(--line); margin: 0 22px; }
.ticket-cut::before, .ticket-cut::after { content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); }
.ticket-cut::before { inset-inline-start: -35px; }
.ticket-cut::after { inset-inline-end: -35px; }


/* Section header */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: clamp(18px, 2.4vw, 28px); }
.sec-head .h2 { max-width: 22ch; }
.sec-head p { color: var(--ink-3); margin-top: 8px; max-width: 52ch; }

/* Horizontal scroller */
.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: var(--col, 300px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; scroll-padding-inline: var(--gutter); }
.scroller > * { scroll-snap-align: start; }

/* Price */
.price { display: inline-flex; align-items: baseline; gap: 8px; font-weight: 750; font-variant-numeric: tabular-nums; }
.price s { color: var(--ink-3); font-weight: 500; font-size: .85em; }
.price .off { color: var(--danger); font-size: .8em; font-weight: 700; }

/* Notice bar */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-2); font-size: var(--fs-sm); }
.notice.turf { background: var(--turf-tint); border-color: transparent; color: var(--turf-deep); }
.notice.blaze { background: var(--blaze-tint); border-color: transparent; color: #7a2a05; }
.notice.gold { background: var(--gold-tint); border-color: transparent; color: #6b4b04; }

/* Countdown */
.countdown { display: inline-flex; gap: 6px; font-variant-numeric: tabular-nums; }
.countdown span { display: grid; justify-items: center; min-width: 44px; padding: 6px 4px; border-radius: var(--r-xs); background: rgba(255,255,255,.1); font-weight: 750; font-size: 1.1rem; line-height: 1.1; }
.countdown small { font-size: 10px; font-weight: 600; opacity: .7; }

/* Tags (stores, products) — each opens the shop filtered by it */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); transition: background 150ms, color 150ms; }
.tag-chip:hover { background: var(--blaze); color: #fff; border-color: transparent; }
.ss-url { padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 12.5px; word-break: break-all; }
/* Meters are often <span>s: make them blocks so their height counts and they never sit on top of the next line (A2, A14) */
.meter { display: block; }
.meter > span { display: block; }

/* Product photo still loading: same size as the photo, soft shimmer */
.garment-skel { display: block; width: 100%; max-width: 100%; border-radius: 14px; background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%); background-size: 300% 100%; animation: skelShine 1.2s linear infinite; }
@keyframes skelShine { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .garment-skel { animation: none; } }
