@charset "UTF-8";
@import 'base.css';

/* Layout */
.checkout-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  align-items: flex-start;
}

.checkout-main {
  flex: 1;
  min-width: 0;
  /* Fix flex overflow */
}

.checkout-sidebar {
  width: 380px;
  position: sticky;
  top: 100px;
  /* Header height + buffer */
}

@media (max-width: 900px) {
  .checkout-container {
    flex-direction: column;
    padding: 20px 16px;
  }

  .checkout-sidebar {
    width: 100%;
    position: static;
    margin-bottom: 40px;
    order: -1;
    /* Show sidebar (cart summary) on top or allow toggle? Usually bottom on mobile or accordion. For now let's keep simple */
  }
}

/* Step Indicator */
.step-indicator {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
  font-size: 14px;
  font-weight: bold;
  color: #ccc;
  gap: 0;
}

.step-item {
  position: relative;
  padding: 0 40px 10px;
  border-bottom: 3px solid #eee;
}

.step-item.active {
  color: #001437;
  border-bottom-color: #001437;
}

/* Forms */
.form-section {
  margin-bottom: 40px;
}

.form-label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-col {
  flex: 1;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  appearance: none;
  /* simple reset */
  background: #fff;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #001437;
  outline: none;
}

.required-badge {
  background: #ff4d4f;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 2px;
  margin-left: 6px;
  vertical-align: middle;
}

/* PayID Button */
.payid-section {
  background: #fff;
  border: 1px solid #eee;
  padding: 24px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 40px;
}

.btn-payid {
  display: block;
  width: 100%;
  background: #001437;
  /* Using brand color for now, can be specific PayID blue */
  color: #fff;
  padding: 14px;
  border-radius: 4px;
  font-weight: bold;
  margin-bottom: 12px;
  border: none;
  cursor: pointer;
  font-size: 16px;
}

.payid-note {
  font-size: 12px;
  color: #666;
}

/* Payment Methods */
/* .payment-methods container style removed to use individual items */

.payment-method-item {
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 12px;
  background: #fff;
  transition: all 0.2s;
}

.payment-method-item:hover {
  border-color: #bbb;
}

.payment-method-item:has(input:checked) {
  border-color: #001437;
  /* Highlight selected */
  box-shadow: 0 0 0 1px #001437;
}

.payment-method-header {
  padding: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.payment-method-input {
  width: 18px;
  height: 18px;
  margin-right: 16px;
  cursor: pointer;
}

.payment-method-label {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  font-weight: bold;
  font-size: 16px;
  color: #333;
}

.payment-method-body {
  display: none;
  padding: 24px;
  background: #f7f9fb;
  /* Light gray background for details */
  border-top: 1px solid #eee;
  border-radius: 0 0 6px 6px;
  font-size: 14px;
  color: #333;
}

/* Changed from sibling selector to :has() for proper expansion */
.payment-method-item:has(.payment-method-input:checked) .payment-method-body {
  display: block;
}

/* Card.js カード表示スタイル */
.card-wrapper {
  perspective: 1000px;
}

.card-wrapper .jp-card {
  margin: 0 auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.card-wrapper .jp-card.jp-card-identified {
  transform: scale(1.02);
}

/* カード入力フィールドのスタイル調整 */
#card-number,
#card-name,
#card-expiry,
#card-cvc {
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
}

#card-number {
  font-size: 18px;
}

#card-name {
  text-transform: uppercase;
}

#card-expiry,
#card-cvc {
  text-align: center;
}

/* 有効期限入力の検証状態スタイル */
#card-expiry:valid {
  border-color: #52c41a;
}

#card-expiry:invalid:not(:placeholder-shown) {
  border-color: #ff4d4f;
}

#card-expiry:focus {
  border-color: #001437;
}

.payment-banner {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}

.payment-banner-img {
  max-width: 100%;
  max-height: 40px;
  object-fit: contain;
}

.fee-info {
  margin-top: 16px;
  padding: 16px;
  background: #fff;
  text-align: center;
  border-radius: 4px;
  font-weight: bold;
}

/* Sidebar Summary */
.summary-card {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.summary-heading {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.cart-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.cart-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  background: #f5f5f5;
  border: 1px solid #eee;
}

.cart-info {
  flex: 1;
  font-size: 14px;
}

.cart-name {
  font-weight: bold;
  margin-bottom: 4px;
  line-height: 1.3;
}

.cart-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #666;
  font-size: 12px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  font-weight: bold;
  font-size: 18px;
  color: #001437;
}

.coupon-area {
  margin: 20px 0;
  display: flex;
  gap: 8px;
}

.btn-apply {
  background: #eee;
  border: none;
  border-radius: 4px;
  padding: 0 16px;
  cursor: pointer;
  font-size: 12px;
}

/* Main CTA */
.btn-primary {
  display: block;
  width: 100%;
  padding: 18px;
  background: #001437;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 40px;
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* 郵便番号検索ボタン */
.btn-zip-search {
  background: #001437;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s;
  height: 48px;
  margin-top: 0;
}

.btn-zip-search:hover {
  background: #002a5f;
}

.btn-zip-search:active {
  background: #001437;
}

.btn-zip-search:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Footer */
.checkout-footer {
  text-align: center;
  padding: 40px 0;
  font-size: 12px;
  color: #999;
}

.footer-link {
  color: #666;
  margin: 0 8px;
}

/* 確認ページのボタンレイアウト */
.confirm-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  align-items: stretch;
}

.confirm-form {
  flex: 1;
  margin: 0;
  min-width: 0;
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 32px;
  background: #f5f5f5;
  color: #333;
  font-size: 16px;
  font-weight: bold;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 140px;
}

.btn-secondary:hover {
  background: #e8e8e8;
  border-color: #bbb;
  color: #000;
}

.btn-primary--confirm {
  width: 100%;
  margin-top: 0;
  padding: 18px 32px;
  background: #001437;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-primary--confirm:hover {
  background: #002a5f;
}

.btn-primary--confirm:active {
  background: #001437;
}

/* モバイル対応 */
@media (max-width: 600px) {
  .confirm-actions {
    flex-direction: column;
    gap: 12px;
  }

  .btn-secondary {
    width: 100%;
    min-width: auto;
  }

  .confirm-form {
    width: 100%;
  }

  .btn-primary--confirm {
    width: 100%;
  }
}