/**
 * 価格シミュレーター - サイト統一モダンデザイン版
 * アイリィデザインのデザインシステムに準拠
 */

/* ==========================================================================
   CSS変数（サイト統一カラー）
   ========================================================================== */
:root {
  /* メインカラー */
  --ps-red: #c11920;
  --ps-red-dark: #a01018;
  --ps-pink: #f354a4;
  --ps-orange: #ff6633;
  --ps-orange-dark: #e85020;

  /* ニュートラル */
  --ps-white: #FFFFFF;
  --ps-black: #2b2b2b;
  --ps-gray-100: #f8f9fa;
  --ps-gray-200: #f0f0f0;
  --ps-gray-300: #e0e0e0;
  --ps-gray-400: #c2c2c2;
  --ps-gray-500: #9d9d9d;
  --ps-gray-600: #666666;

  /* アクセント */
  --ps-green: #28a745;
  --ps-blue: #09b3fc;

  /* 共通スタイル */
  --ps-radius-sm: 5px;
  --ps-radius-md: 8px;
  --ps-radius-lg: 12px;
  --ps-radius-xl: 20px;
  --ps-radius-full: 50px;

  --ps-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
  --ps-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --ps-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --ps-shadow-glow: 0 0 8px rgba(0, 0, 0, 0.15);

  --ps-font: 'Noto Sans Japanese', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', sans-serif;
  --ps-transition: all 0.3s ease-in-out;
}

/* ==========================================================================
   コンテナ
   ========================================================================== */
.price-simulator {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px 40px;
  font-family: var(--ps-font);
  color: var(--ps-black);
}

/* ==========================================================================
   メイン価格表示（ヒーロー）
   ========================================================================== */
.price-hero {
  position: relative;
  text-align: center;
  padding: 35px 25px;
  margin-bottom: 30px;
  background: linear-gradient(145deg, var(--ps-orange) 0%, var(--ps-orange-dark) 100%);
  border-radius: var(--ps-radius-lg);
  color: var(--ps-white);
  box-shadow: 0 0 8px gray;
  overflow: hidden;
}

.price-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.price-hero__label {
  font-size: 14px;
  font-weight: bold;
  opacity: 0.95;
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}

.price-hero__amount {
  font-size: 48px;
  font-weight: bold;
  line-height: 1.1;
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.price-hero__summary {
  font-size: 14px;
  opacity: 0.9;
  background: rgba(255,255,255,0.15);
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--ps-radius-full);
}

.price-hero__summary span {
  margin: 0 5px;
}

/* ==========================================================================
   スライダーセクション
   ========================================================================== */
.slider-section {
  margin-bottom: 20px;
  padding: 20px 24px;
  background: var(--ps-white);
  border: 1px solid var(--ps-gray-300);
  border-radius: var(--ps-radius-md);
  box-shadow: var(--ps-shadow-sm);
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.slider-label {
  font-size: 15px;
  font-weight: bold;
  color: var(--ps-black);
  display: flex;
  align-items: center;
  gap: 8px;
}

.slider-label::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--ps-pink);
  border-radius: 2px;
}

.slider-value {
  font-size: 18px;
  font-weight: bold;
  color: var(--ps-orange);
}

.slider-input {
  width: 110px;
  padding: 10px 14px;
  border: 2px solid var(--ps-gray-300);
  border-radius: var(--ps-radius-sm);
  font-size: 17px;
  font-weight: bold;
  text-align: right;
  color: var(--ps-orange);
  transition: var(--ps-transition);
}

.slider-input:focus {
  outline: none;
  border-color: var(--ps-orange);
  box-shadow: 0 0 0 3px rgba(255, 102, 51, 0.15);
}

/* スライダー本体 */
.slider {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--ps-gray-300);
  border-radius: 4px;
  outline: none;
  margin: 15px 0 10px;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  background: var(--ps-white);
  border: 3px solid var(--ps-orange);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(255, 102, 51, 0.3);
}

.slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  background: var(--ps-white);
  border: 3px solid var(--ps-orange);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.slider-range {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ps-gray-500);
}

/* ==========================================================================
   納期比較カード
   ========================================================================== */
.delivery-comparison {
  margin-bottom: 25px;
  padding: 20px;
  background: var(--ps-gray-100);
  border-radius: var(--ps-radius-md);
}

.comparison-title {
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  color: var(--ps-gray-600);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.comparison-title::before,
.comparison-title::after {
  content: '';
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: var(--ps-gray-400);
}

.comparison-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.comparison-card {
  padding: 18px 15px;
  border: 2px solid var(--ps-gray-300);
  border-radius: var(--ps-radius-md);
  text-align: center;
  cursor: pointer;
  transition: var(--ps-transition);
  background: var(--ps-white);
}

.comparison-card:hover {
  border-color: var(--ps-orange);
  transform: translateY(-2px);
  box-shadow: var(--ps-shadow-md);
}

.comparison-card.is-selected {
  border-color: var(--ps-orange);
  background: linear-gradient(180deg, #fff8f5 0%, #fff 100%);
  box-shadow: 0 4px 15px rgba(255, 102, 51, 0.2);
}

.card-label {
  font-size: 11px;
  font-weight: bold;
  color: var(--ps-gray-500);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-price {
  font-size: 22px;
  font-weight: bold;
  color: var(--ps-black);
  margin-bottom: 4px;
}

.comparison-card.is-selected .card-price {
  color: var(--ps-orange);
}

.card-days {
  font-size: 13px;
  color: var(--ps-gray-600);
  margin-bottom: 8px;
}

.card-diff {
  font-size: 11px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: var(--ps-radius-full);
  display: inline-block;
}

.card-diff--extra {
  color: var(--ps-red);
  background: rgba(193, 25, 32, 0.1);
}

.card-diff--save {
  color: var(--ps-green);
  background: rgba(40, 167, 69, 0.1);
}

/* ==========================================================================
   ご注文方法セクション
   ========================================================================== */
.order-method-section {
  margin-bottom: 25px;
  padding: 24px;
  background: var(--ps-white);
  border-radius: var(--ps-radius-md);
  border: 1px solid var(--ps-gray-300);
  box-shadow: var(--ps-shadow-sm);
}

.section-label {
  font-size: 15px;
  font-weight: bold;
  color: var(--ps-black);
  margin-bottom: 18px;
  padding-left: 14px;
  border-left: 4px solid var(--ps-pink);
  line-height: 1.3;
}

.order-method-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 0;
}

.order-method-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 20px;
  background: var(--ps-white);
  border: 2px solid var(--ps-gray-300);
  border-radius: var(--ps-radius-md);
  font-size: 15px;
  font-weight: bold;
  color: var(--ps-gray-600);
  cursor: pointer;
  transition: var(--ps-transition);
}

.order-method-tab:hover {
  border-color: var(--ps-pink);
  color: var(--ps-pink);
  transform: translateY(-2px);
}

.order-method-tab.is-active {
  background: linear-gradient(145deg, var(--ps-pink) 0%, #e0458f 100%);
  border-color: var(--ps-pink);
  color: var(--ps-white);
  box-shadow: 0 4px 15px rgba(243, 84, 164, 0.35);
}

.order-method-tab i {
  font-size: 20px;
}

/* デザインプラン選択 */
.design-plan-select {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--ps-gray-400);
}

.design-plan-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.design-plan-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  background: var(--ps-gray-100);
  border: 2px solid transparent;
  border-radius: var(--ps-radius-md);
  cursor: pointer;
  transition: var(--ps-transition);
  text-align: center;
}

.design-plan-option:hover {
  background: var(--ps-white);
  border-color: var(--ps-pink);
  transform: translateY(-2px);
}

.design-plan-option.is-selected {
  background: var(--ps-white);
  border-color: var(--ps-pink);
  box-shadow: 0 4px 15px rgba(243, 84, 164, 0.2);
}

.design-plan-option input[type="radio"] {
  display: none;
}

.design-plan-label {
  font-size: 14px;
  font-weight: bold;
  color: var(--ps-black);
}

.design-plan-option.is-selected .design-plan-label {
  color: var(--ps-pink);
}

.design-plan-price {
  font-size: 13px;
  color: var(--ps-gray-600);
  font-weight: bold;
  background: var(--ps-gray-200);
  padding: 4px 12px;
  border-radius: var(--ps-radius-full);
}

.design-plan-option.is-selected .design-plan-price {
  background: rgba(243, 84, 164, 0.15);
  color: var(--ps-pink);
}

/* ==========================================================================
   アコーディオン
   ========================================================================== */
.accordion {
  margin-bottom: 15px;
  border: 1px solid var(--ps-gray-300);
  border-radius: var(--ps-radius-md);
  overflow: hidden;
  background: var(--ps-white);
  box-shadow: var(--ps-shadow-sm);
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  background: var(--ps-white);
  transition: var(--ps-transition);
}

.accordion-header:hover {
  background: var(--ps-gray-100);
}

.accordion-title {
  font-size: 15px;
  font-weight: bold;
  color: var(--ps-black);
  margin-bottom: 4px;
}

.accordion-summary {
  font-size: 13px;
  color: var(--ps-gray-500);
}

.accordion-icon {
  font-size: 12px;
  color: var(--ps-gray-500);
  transition: var(--ps-transition);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ps-gray-100);
  border-radius: 50%;
}

.accordion-body {
  padding: 0 20px 20px;
  background: var(--ps-white);
}

/* ==========================================================================
   オプショングループ
   ========================================================================== */
.option-group {
  margin-bottom: 20px;
}

.option-group:last-child {
  margin-bottom: 0;
}

.option-group__title {
  font-size: 13px;
  font-weight: bold;
  color: var(--ps-gray-600);
  margin-bottom: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--ps-gray-200);
}

.option-group:first-child .option-group__title {
  padding-top: 0;
  border-top: none;
}

/* カード型オプション */
.option-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-cards--grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.option-card {
  padding: 16px;
  border: 2px solid var(--ps-gray-300);
  border-radius: var(--ps-radius-md);
  cursor: pointer;
  transition: var(--ps-transition);
  background: var(--ps-white);
}

.option-card:hover {
  border-color: var(--ps-red);
  transform: translateY(-1px);
}

.option-card.is-selected {
  border-color: var(--ps-red);
  background: linear-gradient(180deg, #fff5f5 0%, #fff 100%);
  box-shadow: 0 2px 10px rgba(193, 25, 32, 0.15);
}

.option-card__name {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 4px;
  color: var(--ps-black);
}

.option-card.is-selected .option-card__name {
  color: var(--ps-red);
}

.option-card__desc {
  font-size: 12px;
  color: var(--ps-gray-500);
}

/* ==========================================================================
   見積サマリー
   ========================================================================== */
.estimate-summary {
  background: linear-gradient(180deg, var(--ps-gray-100) 0%, var(--ps-white) 100%);
  border-radius: var(--ps-radius-md);
  padding: 22px 24px;
  margin-bottom: 24px;
  border: 1px solid var(--ps-gray-300);
}

.estimate-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 14px;
  color: var(--ps-black);
  border-bottom: 1px dotted var(--ps-gray-300);
}

.estimate-row:last-child {
  border-bottom: none;
}

.estimate-row.total {
  border-top: 2px solid var(--ps-orange);
  border-bottom: none;
  margin-top: 12px;
  padding-top: 16px;
  font-size: 20px;
  font-weight: bold;
  color: var(--ps-orange);
}

/* ==========================================================================
   注文ボタン
   ========================================================================== */
.btn-order {
  display: block;
  width: 100%;
  padding: 20px 24px;
  background: linear-gradient(145deg, var(--ps-orange) 0%, var(--ps-orange-dark) 100%);
  color: var(--ps-white);
  font-size: 18px;
  font-weight: bold;
  border: none;
  border-radius: var(--ps-radius-md);
  cursor: pointer;
  transition: var(--ps-transition);
  box-shadow: 0 0 8px gray;
  position: relative;
  overflow: hidden;
}

.btn-order::after {
  content: '\f138';
  font-family: 'Font Awesome 6 Pro', 'Font Awesome 6 Free', FontAwesome;
  font-weight: 900;
  margin-left: 10px;
}

.btn-order:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 102, 51, 0.4);
  opacity: 0.9;
}

.btn-order:active {
  transform: translateY(-1px);
}

.order-note {
  text-align: center;
  font-size: 12px;
  color: var(--ps-gray-500);
  margin-top: 15px;
}

/* 見積ボタン */
.btn-estimate {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: var(--ps-white);
  color: var(--ps-gray-600);
  font-size: 14px;
  font-weight: bold;
  border: 2px solid var(--ps-gray-400);
  border-radius: var(--ps-radius-md);
  cursor: pointer;
  transition: var(--ps-transition);
  margin-top: 12px;
}

.btn-estimate:hover {
  background: var(--ps-gray-600);
  border-color: var(--ps-gray-600);
  color: var(--ps-white);
}

/* ==========================================================================
   ローディング・エラー
   ========================================================================== */
.loading-overlay {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 80px;
  color: var(--ps-gray-500);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--ps-gray-300);
  border-top: 4px solid var(--ps-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-message {
  background: linear-gradient(180deg, #fff5f5 0%, #fff 100%);
  color: var(--ps-red);
  padding: 24px;
  border-radius: var(--ps-radius-md);
  text-align: center;
  border: 2px solid rgba(193, 25, 32, 0.3);
  font-weight: bold;
}

/* ==========================================================================
   見積プレビューモーダル
   ========================================================================== */
.estimate-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.estimate-modal__content {
  background: var(--ps-white);
  border-radius: var(--ps-radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.estimate-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--ps-gray-200);
  background: linear-gradient(145deg, var(--ps-red) 0%, var(--ps-red-dark) 100%);
  color: var(--ps-white);
  border-radius: var(--ps-radius-lg) var(--ps-radius-lg) 0 0;
}

.estimate-modal__header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
}

.estimate-modal__close {
  background: rgba(255,255,255,0.2);
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--ps-white);
  line-height: 1;
  padding: 4px 10px;
  border-radius: var(--ps-radius-sm);
  transition: var(--ps-transition);
}

.estimate-modal__close:hover {
  background: rgba(255,255,255,0.3);
}

.estimate-modal__body {
  padding: 24px;
}

.estimate-modal__footer {
  display: flex;
  gap: 12px;
  padding: 18px 24px;
  border-top: 1px solid var(--ps-gray-200);
  background: var(--ps-gray-100);
  border-radius: 0 0 var(--ps-radius-lg) var(--ps-radius-lg);
}

.estimate-modal__footer .btn-print {
  flex: 1;
  padding: 14px 20px;
  background: linear-gradient(145deg, var(--ps-red) 0%, var(--ps-red-dark) 100%);
  color: var(--ps-white);
  border: none;
  border-radius: var(--ps-radius-md);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--ps-transition);
}

.estimate-modal__footer .btn-print:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.estimate-modal__footer .btn-close {
  padding: 14px 24px;
  background: var(--ps-white);
  color: var(--ps-black);
  border: 2px solid var(--ps-gray-400);
  border-radius: var(--ps-radius-md);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--ps-transition);
}

.estimate-modal__footer .btn-close:hover {
  background: var(--ps-gray-600);
  border-color: var(--ps-gray-600);
  color: var(--ps-white);
}

/* 見積プレビュー本体 */
.estimate-preview {
  border: 2px solid var(--ps-gray-300);
  border-radius: var(--ps-radius-md);
  padding: 30px;
  background: var(--ps-white);
}

.estimate-preview__header {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 3px double var(--ps-red);
}

.estimate-preview__date {
  font-size: 12px;
  color: var(--ps-gray-500);
  margin-bottom: 12px;
}

.estimate-preview__header h2 {
  font-size: 24px;
  margin: 0 0 10px 0;
  letter-spacing: 0.2em;
  color: var(--ps-black);
}

.estimate-preview__company {
  font-size: 14px;
  color: var(--ps-red);
  font-weight: bold;
  margin: 0;
}

.estimate-preview__table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.estimate-preview__table th,
.estimate-preview__table td {
  border: 1px solid var(--ps-gray-300);
  padding: 14px;
  text-align: left;
  font-size: 13px;
}

.estimate-preview__table th {
  background: var(--ps-gray-100);
  font-weight: bold;
  color: var(--ps-black);
}

.estimate-preview__table tfoot td {
  text-align: right;
}

.estimate-preview__table .total-row {
  background: linear-gradient(180deg, #fff5f5 0%, #fff 100%);
}

.estimate-preview__table .total-row td {
  font-size: 16px;
  color: var(--ps-red);
  padding: 16px 14px;
}

.estimate-preview__footer {
  text-align: center;
  font-size: 12px;
  color: var(--ps-gray-500);
  padding-top: 20px;
  border-top: 1px solid var(--ps-gray-300);
}

.estimate-preview__footer p {
  margin: 5px 0;
}

/* 印刷時のスタイル */
@media print {
  body * {
    visibility: hidden;
  }

  .estimate-modal,
  .estimate-modal * {
    visibility: visible;
  }

  .estimate-modal {
    position: absolute;
    left: 0;
    top: 0;
    background: white;
    padding: 0;
  }

  .estimate-modal__content {
    box-shadow: none;
    max-height: none;
  }

  .estimate-modal__header,
  .estimate-modal__footer {
    display: none;
  }

  .estimate-preview {
    border: none;
    padding: 20px;
  }
}

/* ==========================================================================
   レスポンシブ対応
   ========================================================================== */
@media (max-width: 768px) {
  .price-simulator {
    padding: 0 15px 30px;
  }

  .price-hero {
    padding: 28px 20px;
    border-radius: var(--ps-radius-md);
  }

  .price-hero__amount {
    font-size: 40px;
  }

  .comparison-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .comparison-card {
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
  }

  .card-label {
    width: 100%;
    text-align: left;
    margin-bottom: 5px;
  }

  .card-price {
    font-size: 20px;
    margin-bottom: 0;
  }

  .card-days {
    margin-bottom: 0;
  }

  .order-method-tabs {
    grid-template-columns: 1fr;
  }

  .design-plan-options {
    grid-template-columns: 1fr;
  }

  .option-cards--grid {
    grid-template-columns: 1fr;
  }

  .slider-section {
    padding: 18px;
  }

  .slider-input {
    width: 90px;
  }

  .estimate-modal {
    padding: 10px;
  }

  .estimate-modal__content {
    max-height: 95vh;
    border-radius: var(--ps-radius-md);
  }

  .estimate-modal__header {
    border-radius: var(--ps-radius-md) var(--ps-radius-md) 0 0;
  }

  .estimate-preview {
    padding: 20px 15px;
  }

  .estimate-preview__header h2 {
    font-size: 20px;
  }

  .estimate-preview__table th,
  .estimate-preview__table td {
    padding: 10px;
    font-size: 12px;
  }

  .btn-order {
    font-size: 16px;
    padding: 18px 20px;
  }
}

@media (max-width: 480px) {
  .price-hero__amount {
    font-size: 34px;
  }

  .price-hero__summary {
    font-size: 12px;
    padding: 5px 12px;
  }

  .slider-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .slider-input {
    width: 100%;
  }

  .estimate-modal__footer {
    flex-direction: column;
  }

  .estimate-modal__footer .btn-close {
    width: 100%;
  }
}
