/* 購入モーダル専用CSS */
/* 既存CSSと衝突しないよう、全て .purchase-modal-overlay 配下で定義 */

/* ========================================
   オーバーレイ（背景）
   ======================================== */
.purchase-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh; /* ビューポート全体の高さ */
  z-index: 999997; /* ポップアップ通知（999998）より低い */
  display: none; /* 初期状態は非表示 */
  align-items: flex-start; /* 上寄せ */
  justify-content: center; /* 左右中央 */
  padding: 20px 0; /* 上下に余白 */
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* 表示時 */
.purchase-modal-overlay.active {
  display: flex;
  opacity: 1;
}

/* ========================================
   モーダルコンテンツ
   ======================================== */
.purchase-modal-content {
  position: relative;
  max-width: 390px; /* スマホサイズ統一 */
  width: 90%;
  margin: 0 auto; /* 中央配置 */
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.purchase-modal-overlay.active .purchase-modal-content {
  transform: scale(1);
}

/* ========================================
   閉じるボタン
   ======================================== */
.purchase-modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #fff;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
}

.purchase-modal-close:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* ========================================
   モーダルボディ
   ======================================== */
.purchase-modal-body {
  padding: 32px 24px 24px;
  text-align: center;
}

/* ========================================
   アイコン
   ======================================== */
.purchase-modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

/* 確認モーダルのアイコン（紫） */
.purchase-modal-icon-confirm {
  background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
  color: #fff;
}

/* 成功アイコン（緑） */
.purchase-modal-icon-success {
  background: #10b981;
  color: #fff;
}

/* エラーアイコン（赤） */
.purchase-modal-icon-error {
  background: #ef4444;
  color: #fff;
}

/* ========================================
   タイトル
   ======================================== */
.purchase-modal-title {
  font-size: 20px;
  font-weight: bold;
  color: #333;
  margin: 0 0 16px;
}

/* ========================================
   商品名
   ======================================== */
.purchase-modal-product {
  font-size: 16px;
  font-weight: bold;
  color: #555;
  margin-bottom: 20px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}

/* ========================================
   詳細情報
   ======================================== */
.purchase-modal-details {
  margin-bottom: 24px;
}

.purchase-modal-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
}

.purchase-modal-detail-item:last-child {
  border-bottom: none;
}

.purchase-modal-detail-label {
  font-size: 14px;
  color: #6b7280;
}

.purchase-modal-detail-value {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

/* ========================================
   メッセージ
   ======================================== */
.purchase-modal-message {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 24px;
  white-space: pre-line; /* 改行を反映 */
}

/* ========================================
   ボタン
   ======================================== */
.purchase-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.purchase-modal-btn {
  flex: 1;
  max-width: 160px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* キャンセルボタン */
.purchase-modal-btn-cancel {
  background: #e5e7eb;
  color: #6b7280;
}

.purchase-modal-btn-cancel:hover {
  background: #d1d5db;
}

/* 購入ボタン（紫グラデーション） */
.purchase-modal-btn-confirm {
  background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}

.purchase-modal-btn-confirm:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  box-shadow: 0 6px 16px rgba(147, 51, 234, 0.4);
  transform: translateY(-2px);
}

/* プライマリボタン（成功時：緑、エラー時：赤） */
.purchase-modal-btn-primary {
  background: #10b981;
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.purchase-modal-btn-primary:hover {
  background: #059669;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

/* エラー時のボタン */
.purchase-modal-btn-error {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.purchase-modal-btn-error:hover {
  background: #dc2626;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

/* ========================================
   レスポンシブ対応
   ======================================== */
@media (max-width: 480px) {
  .purchase-modal-content {
    width: 95%;
    max-width: 340px;
  }

  .purchase-modal-body {
    padding: 28px 20px 20px;
  }

  .purchase-modal-icon {
    width: 56px;
    height: 56px;
    font-size: 28px;
  }

  .purchase-modal-title {
    font-size: 18px;
  }

  .purchase-modal-product {
    font-size: 15px;
  }

  .purchase-modal-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}
