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

/* ─── Tablet (768px and below) ─── */
@media (max-width: 768px) {
  /* スワイプ可能な横並びレイアウト（共通） */
  .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;
  }

  /* 追従要素でフッターが隠れないようにボディに余白を追加 */
  body {
    padding-bottom: 80px;
  }
}
@media (max-width: 768px) {
  :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: fixed;
    top: var(--header-height-mobile);
    left: 0;
    right: 0;
    bottom: 0;
    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%;
  }

  /* 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 */
  .pricing-table-wrapper, 
  .pricing-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: var(--space-md);
  }

  .pricing-table {
    min-width: 600px; /* 横幅を確保して崩れ防止 */
    font-size: var(--font-size-xs);
    white-space: nowrap;
  }

  .pricing-table th,
  .pricing-table td {
    padding: var(--space-sm);
  }

  /* 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;
  }
}

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

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

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