/* Purchase Page Styles */

/* ========== 結帳頁面佈局 ========== */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.checkout-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-blue);
}

/* ========== 左側：票券資訊 ========== */
.checkout-ticket-card {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.checkout-ticket-image {
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.checkout-ticket-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkout-ticket-details {
  padding: 24px;
}

.checkout-ticket-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 8px 0;
}

.checkout-ticket-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.checkout-ticket-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.checkout-perk {
  padding: 6px 12px;
  background: rgba(30, 95, 168, 0.1);
  color: var(--primary-blue);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 20px;
}

/* 適用飯店區塊 */
.applicable-hotels-section {
  background: var(--off-white);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.applicable-hotels-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.applicable-hotels-icon {
  font-size: 1.2rem;
}

.applicable-hotels-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.applicable-hotels-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.applicable-hotel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: var(--surface);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.applicable-hotel-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.applicable-hotel-image {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.applicable-hotel-info {
  flex: 1;
  min-width: 0;
}

.applicable-hotel-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.applicable-hotel-location {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 數量控制 */
.checkout-quantity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.checkout-quantity label {
  font-weight: 600;
  color: var(--text-main);
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 16px;
}

.quantity-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  background: var(--surface);
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

#quantity-display {
  font-size: 1.2rem;
  font-weight: 700;
  min-width: 30px;
  text-align: center;
}

/* 價格摘要 */
.checkout-price-summary {
  padding-top: 8px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.price-row.total {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--secondary-orange);
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
  padding-top: 16px;
}

/* ========== 右側：信用卡付款 ========== */
.checkout-payment-section {
  background: var(--surface);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  height: fit-content;
}

.payment-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-group input {
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: var(--surface);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(30, 95, 168, 0.1);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.payment-notice {
  background: rgba(30, 95, 168, 0.05);
  padding: 12px 16px;
  border-radius: 8px;
  text-align: center;
}

.payment-notice p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-checkout {
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 12px;
  margin-top: 8px;
}

.btn-checkout:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ========== 成功頁面 ========== */
.checkout-success {
  text-align: center;
  padding: 60px 20px;
  max-width: 500px;
  margin: 0 auto;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
  font-size: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.checkout-success h2 {
  font-size: 1.8rem;
  color: var(--text-main);
  margin: 0 0 12px 0;
}

.checkout-success > p {
  color: var(--text-muted);
  margin: 0 0 32px 0;
}

.success-details {
  background: var(--off-white);
  padding: 24px;
  border-radius: 12px;
  text-align: left;
  margin-bottom: 32px;
}

.success-details p {
  margin: 8px 0;
  color: var(--text-main);
}

.success-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* ========== 錯誤頁面 ========== */
.checkout-error {
  text-align: center;
  padding: 60px 20px;
}

.checkout-error p {
  color: var(--secondary-red);
  margin-bottom: 24px;
}

/* ========== 票券選擇列表 ========== */
.tickets-list-section {
  max-width: 900px;
  margin: 0 auto;
}

.tickets-list-section .section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.tickets-list-section .section-subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
}

.tickets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.ticket-select-card {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.3s ease;
}

.ticket-select-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.ticket-select-image {
  height: 160px;
  overflow: hidden;
}

.ticket-select-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.ticket-select-card:hover .ticket-select-image img {
  transform: scale(1.05);
}

.ticket-select-info {
  padding: 20px;
}

.ticket-select-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.ticket-select-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.ticket-select-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--secondary-orange);
}

/* 票券卡片 - 適用飯店資訊 */
.ticket-applicable-hotels {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.applicable-label {
  color: var(--text-muted);
}

.applicable-count {
  color: var(--primary-blue);
  font-weight: 600;
}

.ticket-hotel-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.hotel-tag {
  padding: 4px 10px;
  background: var(--off-white);
  color: var(--text-muted);
  font-size: 0.75rem;
  border-radius: 12px;
  white-space: nowrap;
}

.hotel-tag.more {
  background: rgba(30, 95, 168, 0.1);
  color: var(--primary-blue);
}

/* ========== RWD ========== */
@media (max-width: 900px) {
  .checkout-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .checkout-payment-section {
    padding: 24px;
  }
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .success-actions {
    flex-direction: column;
  }

  .success-actions .btn {
    width: 100%;
  }

  .tickets-grid {
    grid-template-columns: 1fr;
  }
}
