.group-shell { padding-bottom: 40px; overflow-x: hidden; }
body { overflow-x: hidden; }
.group-hero { padding: 22px; }
.group-gallery { position: relative; margin-bottom: 16px; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { width: 100%; flex: none; scroll-snap-align: center; display: block; object-fit: cover; aspect-ratio: 1 / 1; background: #fff; }
.gallery-dots { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 6px; }
.gallery-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.65); box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: .2s; }
.gallery-dots button.active { background: #fff; width: 22px; }
.group-hero h1 { font-size: 26px; margin: 10px 0 6px; line-height: 1.25; }
.group-subtitle { color: var(--muted); line-height: 1.6; }
.group-description { margin-top: 14px; color: #3d2a32; line-height: 1.75; white-space: pre-wrap; }
.pill.dark { background: var(--wine); color: #fff; border-color: transparent; }
.pill.closed { background: #8b8b8b; color: #fff; border-color: transparent; }

.countdown { margin: 18px 0 4px; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, #78123d, #c61f62); color: #fff; text-align: center; }
.countdown.urgent { animation: pulseUrgent 1.2s infinite; }
@keyframes pulseUrgent { 0%, 100% { box-shadow: 0 0 0 0 rgba(198,31,98,.5); } 50% { box-shadow: 0 0 0 10px rgba(198,31,98,0); } }
.countdown-label { font-size: 13px; font-weight: 800; opacity: .9; }
.countdown-clock { display: flex; justify-content: center; gap: 10px; margin: 10px 0 6px; }
.countdown-clock div { min-width: 62px; padding: 10px 6px; border-radius: 14px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); }
.countdown-clock b { display: block; font-size: 30px; font-weight: 950; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown-clock small { display: block; margin-top: 4px; font-size: 11px; opacity: .85; }
.closes-at { display: block; font-size: 12.5px; opacity: .9; }

.progress-block { margin-top: 16px; }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.progress-head b { color: var(--wine); font-size: 15px; }
.progress-bar { height: 12px; border-radius: 999px; background: #f3e2ea; overflow: hidden; }
.progress-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--wine), var(--wine2)); transition: width .4s ease; }
.progress-bar.mini { height: 8px; margin: 10px 0 4px; }

.group-items { margin: 16px 0; display: grid; gap: 10px; }
.group-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; padding: 16px 18px; }
.group-item-info { min-width: 0; }
.group-item-info b { display: block; line-height: 1.4; overflow-wrap: anywhere; }
.group-item-info small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.group-item-price { grid-column: 2; text-align: right; font-size: 21px; font-weight: 950; color: var(--wine); white-space: nowrap; }
.group-item-price small { font-size: 12px; color: var(--muted); font-weight: 700; }
.qty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.qty button { width: 42px; height: 42px; border-radius: 14px; border: 1px solid #dabcc8; background: #fff; color: var(--wine); font-size: 22px; font-weight: 900; line-height: 1; }
.qty button:active { background: #fff1f5; }
.qty b { min-width: 34px; text-align: center; font-size: 20px; font-variant-numeric: tabular-nums; }

.group-summary { margin-top: 4px; }
.group-summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; color: var(--muted); }
.group-summary-row b { white-space: nowrap; }
.group-summary-row b { color: var(--ink); font-size: 18px; font-weight: 900; }
.group-summary-row.total b { color: var(--wine); font-size: 30px; font-weight: 950; }
.group-note { display: grid; gap: 6px; margin: 12px 0; font-weight: 800; font-size: 13px; }
.group-note input { width: 100%; padding: 14px; border: 1px solid #e5ccd6; border-radius: 14px; background: #fffbfc; }
#submit-order:disabled { opacity: .5; }

.group-card { margin-bottom: 12px; cursor: pointer; }
.group-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.group-card-head small { color: var(--muted); font-size: 12.5px; }
.group-card > b { display: block; font-size: 18px; line-height: 1.4; }
.group-card > small { display: block; margin-top: 4px; color: var(--muted); }

/* 倒數在窄螢幕自動縮小，避免撐破版面 */
@media (max-width: 400px) {
  .countdown-clock { gap: 7px; }
  .countdown-clock div { min-width: 0; flex: 1; padding: 9px 4px; }
  .countdown-clock b { font-size: 26px; }
  .group-item-price { font-size: 19px; }
}

.checkout-block { margin: 14px 0; }
.checkout-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.checkout-label { display: block; font-weight: 800; font-size: 13px; margin-bottom: 8px; }
.choice-row { display: flex; gap: 10px; }
.choice { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 8px; border: 1px solid #e5ccd6; border-radius: 14px; background: #fffbfc; font-weight: 800; cursor: pointer; text-align: center; }
.choice:has(input:checked) { border-color: var(--wine); background: #fff1f5; color: var(--wine); }
.choice input { accent-color: var(--wine); }
.choice.hidden { display: none; }
.ship-region { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ship-region select { width: 100%; padding: 14px; border: 1px solid #e5ccd6; border-radius: 14px; background: #fffbfc; font: inherit; }
.link-button { background: transparent; color: var(--wine); font-weight: 800; font-size: 13.5px; text-decoration: underline; padding: 4px 0; }
.bank-info { margin: 10px 0; padding: 14px 16px; border-radius: 14px; background: #fff8e8; border: 1px solid #f0dfae; line-height: 1.7; }
.bank-info b { display: block; color: #6b4b00; margin-bottom: 4px; }
.bank-info .account { font-size: 20px; font-weight: 950; color: var(--wine); letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.bank-info small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.order-status { margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: #f6fbf8; border: 1px solid #cfe8d9; }
.order-status h3 { font-size: 15px; margin-bottom: 8px; color: #0e7a45; }
.order-status div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 14px; color: var(--muted); }
.order-status div b { color: var(--ink); text-align: right; font-weight: 800; }
.order-status .need-transfer b { color: #b45309; }
.choice.disabled { opacity: .45; cursor: not-allowed; }
.ship-hint { margin: 8px 0 4px; padding: 10px 14px; border-radius: 12px; background: #fff4e6; border: 1px solid #f3d5a8; color: #8a5b00; font-size: 13px; font-weight: 700; line-height: 1.6; }

.gallery-track img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(20, 8, 14, .93); padding: 20px; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: 12px; object-fit: contain; }
.lightbox-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-size: 20px; font-weight: 900; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 66px; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; font-size: 34px; line-height: 1; }
.lightbox-nav.prev { left: 10px; }
.lightbox-nav.next { right: 10px; }
.lightbox-count { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; font-size: 13px; font-weight: 800; }
body.lightbox-open { overflow: hidden; }

.group-note .req { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #fde8ee; color: #c2185b; font-size: 11px; font-weight: 900; font-style: normal; vertical-align: middle; }
.field-error { border-color: #d32f2f !important; background: #fff5f5 !important; }
.submit-hint { margin: 4px 0 10px; padding: 10px 14px; border-radius: 12px; background: #fff4e6; border: 1px solid #f3d5a8; color: #8a5b00; font-size: 13px; font-weight: 800; line-height: 1.6; text-align: center; }
