/* ========================================
   BOOBOOレンタカー - Responsive Styles
   ======================================== */

/* ─── Tablet (768px and below) ─── */
@media (max-width: 768px) {
  .responsive-grid-2 {
    grid-template-columns: 1fr;
  }
  .vehicle-detail-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  /* スワイプ可能な横並びレイアウト（共通） */
  .mobile-swipeable {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: var(--space-md) !important;
    padding-top: 24px !important; /* 絶対配置のバッジが切れないように上部余白を確保 */
    padding-bottom: var(--space-md);
    margin: 0 calc(var(--space-md) * -1) !important;
    padding-left: var(--space-md) !important;
    padding-right: var(--space-md) !important;
  }
  .mobile-swipeable > * {
    scroll-snap-align: center;
    flex: 0 0 85% !important;
    min-width: 85% !important;
  }

  /* 追従要素でフッターが隠れないようにボディに余白を追加 */
  /* ページ全体の横スクロールを防止
     htmlに overflow-x: clip を指定（hidden不可：fixed要素を壊すため）
     clip はスクロールコンテナーを作らないためfixedヘッダーが正常動作する */
  html {
    overflow-x: clip;
  }
  body {
    max-width: 100%;
    overflow-x: hidden;
    padding-bottom: 80px;
  }
}
@media (max-width: 768px) {
  .responsive-grid-2 {
    grid-template-columns: 1fr;
  }
  .vehicle-detail-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  :root {
    --header-height: var(--header-height-mobile);
  }

  .container {
    padding: 0 var(--space-md);
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .section__title {
    font-size: var(--font-size-xl);
  }

  .section__subtitle {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-xl);
  }

  /* Header */
  .header__inner {
    padding: 0 var(--space-sm);
  }
  .header__logo img {
    max-width: 130px; /* ロゴとメニューの干渉を防ぐ */
  }
  .header__nav {
    display: none;
    position: absolute;
    top: var(--header-height-mobile);
    left: 0;
    right: 0;
    height: calc(100vh - var(--header-height-mobile));
    background: var(--color-white);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-lg);
    gap: 0;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
  }

  .header__nav.open {
    display: flex;
  }

  .header__nav-link {
    font-size: var(--font-size-base);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--color-border-light);
  }

  .header__nav-link::after {
    display: none;
  }

  .header__actions {
    display: none;
  }

  .header__nav.open .header__actions-mobile {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding-top: var(--space-lg);
    margin-top: var(--space-md);
    border-top: 1px solid var(--color-border);
  }

  .header__menu-toggle {
    display: flex;
  }

  .header__phone--mobile {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-right: var(--space-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding-top: var(--header-height-mobile);
  }

  .hero__inner {
    flex-direction: column;
    padding: var(--space-2xl) var(--space-md);
    gap: var(--space-xl);
  }

  .hero__title {
    font-size: var(--font-size-2xl);
  }

  .hero__description {
    font-size: var(--font-size-base);
  }

  .hero__cta {
    flex-direction: column;
  }

  .hero__cta .btn {
    width: 100%;
  }

  .hero__highlights {
    flex-direction: column;
    gap: var(--space-md);
  }

  .hero__image {
    order: -1;
  }

  /* Features */
  .features:not(.mobile-swipeable) {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .feature-card {
    display: flex;
    flex-direction: column;
  }
  /* 特徴カードのスマホ配置調整（アイコンとタイトル横並び、その下にテキスト） */
  .section#features .features .feature-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: var(--space-md);
    row-gap: var(--space-sm);
    text-align: left;
    padding: var(--space-lg);
  }
  .section#features .feature-card__icon {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    margin-bottom: 0;
    width: 48px;
    height: 48px;
    font-size: var(--font-size-lg);
    flex-shrink: 0;
  }
  .section#features .feature-card__title {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    margin-bottom: 0;
  }
  .section#features .feature-card__text {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
    margin-bottom: 0;
  }

  /* Vehicle Grid (カルーセル化) */
  .vehicle-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: var(--space-md);
    padding-bottom: var(--space-xl);
    margin: 0 calc(var(--space-md) * -1);
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    -webkit-overflow-scrolling: touch;
  }
  .vehicle-grid .vehicle-card {
    scroll-snap-align: center;
    min-width: 85%;
    flex: 0 0 85%;
    overflow: hidden; /* カード全体ではみ出し防止 */
  }
  /* 画像コンテナを明示的に高さ制限してaspect-ratioを強制 */
  .vehicle-grid .vehicle-card .vehicle-card__image {
    width: 100%;
    height: 0;
    padding-bottom: 62.5%; /* 16:10 = 62.5% */
    position: relative;
    overflow: hidden;
  }
  .vehicle-grid .vehicle-card .vehicle-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* vehicles.html の車両詳細グリッド画像
     インラインstyleのwidth:100%を上書きし、自然なアスペクト比で中央配置。 */
  .vehicle-detail-grid > img:first-child {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    display: block;
    margin: 0 auto;
    border-radius: var(--radius-xl);
  }

  /* 詳細テキスト・料金テーブルをセンター揃えに */
  .vehicle-detail-grid > div {
    text-align: center;
  }
  .vehicle-detail-grid > div .pricing-table-wrapper {
    margin: 0 auto;
  }
  .vehicle-detail-grid > div .class-name {
    text-align: center !important;
  }
  .vehicle-detail-grid > div .btn {
    display: inline-block;
  }

  /* Steps */
  .steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
  }
  .step {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: var(--space-md);
    row-gap: var(--space-sm);
    text-align: left;
  }
  .step__number {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    margin: 0;
    flex-shrink: 0;
  }
  .step__title {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    margin: 0;
  }
  .step__text {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
    margin: 0;
  }

  .steps::before {
    display: none;
  }

  .step__number {
    width: 56px;
    height: 56px;
    font-size: var(--font-size-lg);
  }

  /* Pricing Table */
  /* wrapperのみがスクロール制御 — tableにも設定すると二重になり機能しない */
  .pricing-table-wrapper {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    margin-bottom: var(--space-md);
  }

  .pricing-table {
    display: table;
    width: 100%; /* 横幅100%に指定し、画面外への右はみ出し（右ずれ）を防止 */
    min-width: unset; /* デスクトップや以前の400px指定を解除 */
    font-size: var(--font-size-xs);
    white-space: normal; /* 折り返しを許可して画面内に収める */
  }

  .pricing-table th,
  .pricing-table td {
    padding: var(--space-xs) 2px; /* モバイルではパディングを減らして文字を収める */
    font-size: 11px; /* 少しフォントサイズを下げて1行に収まりやすくする */
  }

  .pricing-table .class-name {
    white-space: normal;
  }

  /* Footer */
  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

  /* CTA Band */
  .cta-band__title {
    font-size: var(--font-size-xl);
  }

  .cta-band__buttons {
    flex-direction: column;
    align-items: center;
  }

  .cta-band__buttons .btn {
    width: 100%;
    max-width: 320px;
  }

  /* Insurance Table */
  .insurance-table-wrapper,
  .insurance-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: var(--space-md);
  }

  .insurance-table {
    min-width: 500px; /* 横幅を確保して崩れ防止 */
    white-space: nowrap;
  }
}

/* ─── Small phones (480px and below) ─── */
@media (max-width: 480px) {
  .hero__title {
    font-size: var(--font-size-xl);
  }

  /* stepsはすでに768pxでflex rowにしているので不要 */

  .btn--xl {
    padding: 16px 32px;
    font-size: var(--font-size-base);
  }

  .access-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
}

/* ─── Large screens (1200px+) ─── */
@media (min-width: 1200px) {
  .hero__title {
    font-size: var(--font-size-4xl);
  }
}

/* ─── Desktop only (769px+) ─── */
@media (min-width: 769px) {
  .header__phone--mobile {
    display: none;
  }

  .header__actions-mobile {
    display: none;
  }
}

/* ─── Mid-size desktop (769px〜1100px): ナビが折り返さないよう文字・間隔を縮小 ─── */
@media (min-width: 769px) and (max-width: 1100px) {
  .header__inner {
    padding: 0 var(--space-md);
  }

  .header__nav {
    gap: var(--space-md);   /* 24px → 16px */
  }

  .header__nav-link {
    font-size: 0.8rem;      /* 14px → 12.8px */
  }

  .header__actions {
    gap: 6px;
  }

  .header__phone {
    font-size: 0.8rem;
  }

}

/* ─── Print ─── */
@media print {
  .header,
  .footer,
  .cta-band,
  .btn {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  .section {
    padding: 20pt 0;
    page-break-inside: avoid;
  }
}


