/* ============================================
   カーレスキュー - グローバルスタイル
   最先端デザイン + 高齢者対応
   ============================================ */

/* リセット */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 18px;
  line-height: 1.8;
  color: #333;
  background-color: #fff;
  overflow-x: hidden;
}

/* ============================================
   カラースキーム
   ============================================ */
:root {
  --primary-red: #E53935;
  --primary-blue: #1565C0;
  --accent-orange: #FF6F00;
  --accent-gold: #FFD700;
  --light-gray: #f5f5f5;
  --border-gray: #ddd;
  --text-dark: #333;
  --text-light: #666;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-dark: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ============================================
   タイポグラフィ
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  color: var(--primary-red);
}

h2 {
  font-size: 2rem;
  color: var(--primary-blue);
}

h3 {
  font-size: 1.5rem;
  color: var(--text-dark);
}

h4 {
  font-size: 1.25rem;
  color: var(--text-dark);
}

p {
  margin-bottom: 1rem;
  font-size: 18px;
  line-height: 1.8;
}

a {
  color: var(--primary-blue);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-orange);
  text-decoration: underline;
}

/* ============================================
   コンテナ・レイアウト
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 60px 20px;
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2rem;
  color: var(--primary-blue);
}

/* ============================================
   ボタン
   ============================================ */
.btn {
  display: inline-block;
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-red) 0%, #d32f2f 100%);
  color: white;
  box-shadow: var(--shadow-medium);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-dark);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--primary-blue) 0%, #0d47a1 100%);
  color: white;
  box-shadow: var(--shadow-medium);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary-red);
  border: 2px solid var(--primary-red);
}

.btn-outline:hover {
  background: var(--primary-red);
  color: white;
}

.btn-block {
  display: block;
  width: 100%;
}

/* ============================================
   ヘッダー
   ============================================ */
header {
  background: linear-gradient(135deg, #fff 0%, var(--light-gray) 100%);
  padding: 20px 0;
  box-shadow: var(--shadow-light);
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  width: 100px;
  height: auto;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-red);
}

nav {
  display: flex;
  gap: 30px;
  align-items: center;
}

nav a {
  font-size: 18px;
  color: var(--text-dark);
  font-weight: 500;
}

nav a:hover {
  color: var(--primary-red);
}

.phone-btn-header {
  background: var(--primary-red);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 18px;
}

/* ============================================
   フッター
   ============================================ */
footer {
  background: linear-gradient(135deg, #222 0%, #333 100%);
  color: white;
  padding: 40px 20px;
  margin-top: 60px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-section h3 {
  color: var(--accent-gold);
  font-size: 20px;
  margin-bottom: 15px;
}

.footer-section a {
  display: block;
  color: #ccc;
  margin-bottom: 10px;
  font-size: 18px;
}

.footer-section a:hover {
  color: var(--accent-gold);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 16px;
}

/* ============================================
   モーダル
   ============================================ */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
  overflow-y: auto; /* モーダル自体もスクロール可能に */
}
.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0; /* 上下にパディングを追加 */
}
.modal-content {
  background-color: white;
  padding: 40px;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh; /* ビューポートの高さの90%に制限 */
  overflow-y: auto; /* コンテンツがはみ出たらスクロール */
  box-shadow: var(--shadow-dark);
  animation: slideUp 0.3s ease;
  margin: auto; /* 中央配置を維持 */
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: sticky; /* ヘッダーを固定 */
  top: 0;
  background-color: white;
  z-index: 1;
  padding-bottom: 10px;
}
.modal-header h2 {
  margin: 0;
  font-size: 24px;
}
.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-dark);
}
.close-btn:hover {
  color: var(--primary-red);
}
.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
  margin-top: 20px;
  padding-bottom: 10px; /* 最後の要素が見やすいように */
}
.area-btn {
  padding: 12px 16px;
  background: var(--light-gray);
  border: 2px solid var(--border-gray);
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}
.area-btn:hover {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

/* スマホ対応 */
@media (max-width: 768px) {
  .modal-content {
    padding: 20px;
    width: 95%;
    max-height: 85vh; /* スマホでは少し低めに */
  }
  .modal-header h2 {
    font-size: 20px;
  }
  .area-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
  }
  .area-btn {
    padding: 10px 12px;
    font-size: 14px;
  }
}
/* ============================================
   固定電話ボタン（スマホのみ）
   ============================================ */
.fixed-phone-btn {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: auto;
  border-radius: 10%;
  background-image: url('https://carres9.com/img/denwa.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: var(--shadow-dark);
  cursor: pointer;
  z-index: 999;
  transition: all 0.3s ease;
}

.fixed-phone-btn:hover {
  transform: translateX(-50%) scale(1.1);
  box-shadow: 0 0 20px rgba(229, 57, 53, 0.6);
}

/* スマホサイズで表示 */
@media (max-width: 768px) {
  .fixed-phone-btn {
    display: block;
  }
}

/* ============================================
   ヒーロー画像
   ============================================ */
.hero {
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-blue) 100%);
  color: white;
  padding: 80px 20px;
  text-align: center;
}

.hero h1 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.hero p {
  font-size: 20px;
  margin-bottom: 30px;
}

.hero-image {
  width: 100%;
  max-width: 1200px;
  height: auto;
  margin-top: 30px;
  border-radius: 12px;
  box-shadow: var(--shadow-dark);
}

/* ============================================
   サービスボタン（トップページ）
   ============================================ */
.service-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin: 40px 0;
}

.service-card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow-light);
  transition: all 0.3s ease;
  cursor: pointer;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-dark);
}

.service-card img {
  width: 100%;
  max-width: 150px;
  height: auto;
  margin-bottom: 20px;
}

.service-card h3 {
  font-size: 22px;
  margin-bottom: 15px;
}

.service-card p {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 20px;
}

/* ============================================
   特徴セクション
   ============================================ */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

.feature-item {
  background: linear-gradient(135deg, var(--light-gray) 0%, #fff 100%);
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid var(--primary-red);
}

.feature-item h4 {
  color: var(--primary-red);
  margin-bottom: 10px;
}

.feature-item p {
  font-size: 16px;
  color: var(--text-light);
}

/* ============================================
   口コミセクション
   ============================================ */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

.review-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow-light);
  border-top: 4px solid var(--accent-gold);
}

.review-rating {
  color: var(--accent-gold);
  font-size: 18px;
  margin-bottom: 10px;
}

.review-text {
  font-size: 16px;
  color: var(--text-dark);
  margin-bottom: 15px;
  line-height: 1.8;
}

.review-author {
  font-weight: 600;
  color: var(--primary-blue);
  font-size: 16px;
}

.review-date {
  font-size: 14px;
  color: var(--text-light);
}

/* ============================================
   Q&Aセクション
   ============================================ */
.faq-container {
  max-width: 800px;
  margin: 40px auto;
}

.faq-item {
  background: white;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}

.faq-question {
  background: linear-gradient(135deg, var(--light-gray) 0%, #fff 100%);
  padding: 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 18px;
  transition: all 0.3s ease;
}

.faq-question:hover {
  background: var(--primary-blue);
  color: white;
}

.faq-toggle {
  font-size: 24px;
  transition: transform 0.3s ease;
}

.faq-answer {
  display: none;
  padding: 20px;
  background: #fafafa;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-light);
}

.faq-answer.show {
  display: block;
}

/* ============================================
   料金表
   ============================================ */
.price-table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  box-shadow: var(--shadow-light);
  border-radius: 8px;
  overflow: hidden;
}

.price-table th {
  background: linear-gradient(135deg, var(--primary-blue) 0%, #0d47a1 100%);
  color: white;
  padding: 16px;
  text-align: left;
  font-size: 18px;
  font-weight: 600;
}

.price-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-gray);
  font-size: 16px;
}

.price-table tr:nth-child(even) {
  background: var(--light-gray);
}

.price-table tr:hover {
  background: #efefef;
}

/* ============================================
   CTA（行動喚起）セクション
   ============================================ */
.cta-section {
  background: linear-gradient(135deg, var(--primary-red) 0%, #d32f2f 100%);
  color: white;
  padding: 60px 20px;
  text-align: center;
  border-radius: 12px;
  margin: 60px 0;
}

.cta-section h2 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.cta-section p {
  font-size: 20px;
  margin-bottom: 30px;
}

.cta-phone {
  display: inline-block;
  background: white;
  color: var(--primary-red);
  padding: 20px 40px;
  border-radius: 8px;
  font-size: 24px;
  font-weight: 700;
  margin: 10px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.cta-phone:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-dark);
}

/* ============================================
   レスポンシブデザイン
   ============================================ */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .section {
    padding: 40px 20px;
  }

  nav {
    gap: 15px;
  }

  nav a {
    font-size: 16px;
  }

  .hero {
    padding: 40px 20px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 18px;
  }

  .modal-content {
    padding: 20px;
  }

  .area-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-buttons {
    grid-template-columns: 1fr;
  }

  .cta-phone {
    font-size: 20px;
    padding: 16px 32px;
  }

  .price-table th,
  .price-table td {
    padding: 12px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .container {
    padding: 0 15px;
  }

  .section {
    padding: 30px 15px;
  }

  .header-container {
    flex-direction: column;
    gap: 15px;
  }

  nav {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  nav a {
    font-size: 14px;
  }

  .hero {
    padding: 30px 15px;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 16px;
  }

  .modal-content {
    width: 95%;
    padding: 15px;
  }

  .area-grid {
    grid-template-columns: 1fr;
  }

  .area-btn {
    padding: 10px 12px;
    font-size: 14px;
  }

  .fixed-phone-btn {
    width: 150px;
    height: 70px;
    bottom: 15px;
  }

  .cta-section h2 {
    font-size: 1.5rem;
  }

  .cta-phone {
    font-size: 18px;
    padding: 12px 24px;
  }
}

/* ============================================
   アニメーション
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   遅延読み込み画像
   ============================================ */
img[loading="lazy"] {
  background: var(--light-gray);
}

/* ============================================
   アクセシビリティ
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* フォーカス状態の強化（キーボード操作対応） */
button:focus,
a:focus,
input:focus {
  outline: 3px solid var(--primary-red);
  outline-offset: 2px;
}

/* 高コントラストモード対応 */
@media (prefers-contrast: more) {
  body {
    color: #000;
  }

  .btn-primary,
  .btn-secondary {
    border: 2px solid #000;
  }
}