/* checkout.css */

/* チェックアウトページのスタイル */
.page-title {
  text-align: center;
  margin: 30px 0;
  font-size: 28px;
  color: #333;
}

/* チェックアウトコンテナ */
.checkout-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-bottom: 50px;
}

.checkout-form-container {
  flex: 3;
  min-width: 300px;
}

.order-summary-container {
  flex: 1;
  min-width: 250px;
}

.checkout-section {
  background-color: white;
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.section-title {
  font-size: 20px;
  margin-bottom: 25px;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
}

/* フォームスタイル */
.form-row {
  display: flex;
  gap: 20px;
}

.form-row .form-group {
  flex: 1;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.required {
  color: #ff6b6b;
}

input, select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

input:focus, select:focus, textarea:focus {
  border-color: #fedc5e;
  outline: none;
}

.hint {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}

.error-message {
  color: #ff6b6b;
  font-size: 12px;
  margin-top: 5px;
  min-height: 18px;
}

/* ボタン */
.form-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

.button {
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
}

.button.primary {
  background-color: #fedc5e;
  color: white;
}

.button.primary:hover {
  background-color: #ecc656;
}

.button.primary:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.button.secondary {
  background-color: #f5f5f5;
  color: #333;
}

.button.secondary:hover {
  background-color: #e9e9e9;
}

/* 注文サマリー */
.order-summary {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  position: sticky;
  top: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.summary-title {
  font-size: 18px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
}

.summary-item-name {
  font-weight: 500;
}

.summary-item-quantity {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.summary-totals {
  margin-top: 20px;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

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

.summary-row.total {
  font-weight: bold;
  font-size: 18px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.empty-cart-message {
  text-align: center;
  padding: 15px 0;
  color: #666;
}

/* スピナー（ロード中表示） */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 非表示クラス */
.hidden {
  display: none;
}

/* レスポンシブデザイン */
@media screen and (max-width: 768px) {
  .checkout-container {
    flex-direction: column;
  }
  
  .order-summary-container {
    order: -1;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .form-buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  .button {
    width: 100%;
    text-align: center;
  }
}

/* スピナー（ロード中表示） */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* クーポンコード関連 */
.coupon-input-container {
  display: flex;
  gap: 10px;
}

.coupon-input-container input {
  flex: 1;
}

.apply-coupon-btn {
  padding: 10px 20px;
  background-color: #fedc5e;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  white-space: nowrap;
}

.apply-coupon-btn:hover {
  background-color: #ecc656;
}

.apply-coupon-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.coupon-message {
  margin-top: 5px;
  font-size: 14px;
  min-height: 20px;
}

.coupon-message.success {
  color: #4CAF50;
}

.coupon-message.error {
  color: #ff6b6b;
}

/* 割引情報の表示 */
.summary-row.discount {
  color: #4CAF50;
}

.remove-coupon-btn {
  padding: 10px 20px;
  background-color: #ff6b6b;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  white-space: nowrap;
}

.remove-coupon-btn:hover {
  background-color: #ff5252;
}