/* ==========================================================================
   套票商城頁專屬樣式
   ========================================================================== */

.ticket-hero {
  padding: 44px 0;
  color: #fff;
  background: var(--gradient-primary);
}

.ticket-hero h1 {
  font-size: 30px;
  margin: 0 0 6px;
}

.ticket-hero p {
  margin: 0;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.9);
}

.ticket-main {
  padding: 40px 0 72px;
}

.ticket-toolbar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

.ticket-search {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 12px 18px;
}

.ticket-search svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.ticket-search input {
  border: none;
  outline: none;
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  background: transparent;
}

.ticket-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  border: 1.5px solid var(--color-border);
  background: #fff;
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.filter-chip[aria-pressed="true"] {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}

.filter-chip[aria-pressed="true"]::after {
  content: "✓";
  margin-left: 6px;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 8px;
}

.trust-strip-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.trust-strip-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-primary);
  margin-top: 2px;
}

.trust-strip-item strong {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}

.trust-strip-item span {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.trust-strip-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11.5px;
  color: var(--color-text-muted);
  margin: 10px 0 28px;
  line-height: 1.6;
}

.trust-strip-disclaimer svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  margin-top: 1.5px;
}

.ticket-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

.ticket-rating svg {
  width: 13px;
  height: 13px;
  color: #f5a623;
}

.ticket-rating .rating-note {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.ticket-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ticket-section-head h2 {
  font-size: 22px;
  margin: 0 0 4px;
}

.ticket-section-head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.results-count {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0 0 20px;
}

.results-count strong {
  color: var(--color-text);
}

.cart-open-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  background: var(--gradient-primary);
  color: #fff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
}

.cart-open-btn svg {
  width: 18px;
  height: 18px;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: var(--shadow-sm);
}

.cart-count[hidden] {
  display: none;
}

/* Ticket cards */

.tickets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.ticket-card {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.ticket-photo {
  position: relative;
  aspect-ratio: 4 / 3;
}

.ticket-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ticket-flag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
}

.ticket-fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.ticket-fav-btn svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  transition: color 0.15s ease, fill 0.15s ease;
}

.ticket-fav-btn.is-active svg {
  color: var(--color-primary);
  fill: var(--color-primary);
}

.ticket-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ticket-body h3 {
  font-size: 16px;
  margin: 0 0 6px;
}

.ticket-body .desc {
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin: 0 0 10px;
}

.ticket-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ticket-tags span {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--color-primary);
}

.ticket-line {
  background: #f8f8f8;
  color: var(--color-text-muted);
  font-size: 10.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: inline-block;
  margin-right: 6px;
  margin-bottom: 12px;
}

.ticket-validity {
  font-size: 10.5px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.ticket-validity strong {
  display: block;
  color: var(--color-text);
  font-weight: 400;
  font-size: 10.5px;
  margin-top: 2px;
}

.ticket-price-label {
  font-size: 10.5px;
  color: var(--color-text-muted);
  margin: 10px 0 2px;
}

.ticket-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 14px;
}

.ticket-qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.qty-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: none;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--color-text);
}

.qty-btn:disabled {
  opacity: 0.5;
  background: transparent;
  border: 1.5px dashed var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.qty-value-wrap {
  flex: 1;
  text-align: center;
}

.qty-value-wrap span:first-child {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
}

.qty-value {
  font-size: 16px;
  font-weight: 700;
}

.add-cart-btn {
  margin-top: auto;
  border: none;
  border-radius: var(--radius-lg);
  padding: 14px;
  background: var(--gradient-primary);
  color: #fff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
}

.add-cart-btn.is-added {
  background: #22c55e;
}

/* Cart drawer */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cart-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(434px, 100vw);
  background: #fff;
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -8px 0 20px rgba(0, 0, 0, 0.15);
}

.cart-overlay.is-open .cart-drawer {
  transform: translateX(0);
}

.cart-drawer-head {
  background: var(--gradient-primary);
  color: #fff;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.cart-drawer-head h2 {
  margin: 0;
  font-size: 22px;
}

.cart-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-close-btn svg {
  width: 18px;
  height: 18px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  background: #fcfbf9;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
  font-size: 14px;
}

.cart-item {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.cart-item img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-info h3 {
  font-size: 15px;
  margin: 0 0 6px;
}

.cart-item-price {
  font-size: 12.5px;
  color: var(--color-primary);
  margin: 0 0 10px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item-controls .qty-btn {
  width: 29px;
  height: 29px;
}

.cart-item-controls .qty-value {
  min-width: 24px;
  text-align: center;
  font-size: 14px;
}

.cart-remove-btn {
  margin-left: auto;
  border: none;
  background: none;
  color: #ef4444;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
}

.cart-summary {
  border-top: 1px solid var(--color-border);
  padding: 20px 22px;
  flex-shrink: 0;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 8px;
}

.cart-summary-row.is-total {
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
}

.cart-summary-row.is-total span:last-child {
  color: var(--color-primary);
}

.cart-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 12px;
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 14px 0;
  line-height: 1.6;
}

.cart-note svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--color-primary);
  margin-top: 1px;
}

.cart-note strong {
  color: var(--color-text);
  font-weight: 700;
}

.cart-checkout-btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--gradient-primary);
  color: #fff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cart-checkout-btn svg {
  width: 18px;
  height: 18px;
}

.cart-checkout-btn:disabled {
  opacity: 0.5;
}

.cart-hint {
  text-align: center;
  font-size: 11px;
  color: var(--color-text-muted);
  margin: 10px 0 0;
}

/* Confirmation toast */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-text);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Checkout confirm / success dialog（沿用 style.css 的 .modal-overlay / .modal-panel） */

.checkout-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fff8ec;
  border: 1px solid #f2e2bd;
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  font-size: 12.5px;
  color: #6b5115;
  margin-bottom: 18px;
  line-height: 1.6;
}

.checkout-notice svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.checkout-summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}

.checkout-summary-list div {
  display: flex;
  justify-content: space-between;
}

.checkout-summary-total {
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
}

.checkout-summary-total span:last-child {
  color: var(--color-primary);
}

.checkout-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout-actions .btn-outline {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 13px;
  background: #fff;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.checkout-success {
  text-align: center;
}

.checkout-success .success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-success-bg);
  color: var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.checkout-success .success-icon svg {
  width: 28px;
  height: 28px;
}

/* Responsive */

@media (max-width: 1100px) {
  .tickets-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .tickets-grid {
    grid-template-columns: 1fr;
  }

  .trust-strip {
    grid-template-columns: 1fr;
  }

  .ticket-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}
