/* =================================================
   Single Car Page Styles
   ================================================= */

/* 基本レイアウト - 2カラム構造 */
.car-detail-wrapper {
    display: flex;
    gap: 0.25rem;
    align-items: flex-start;
    margin-bottom: 0;
  }
  
  /* 左カラム: スライダー＋本文 */
  .car-detail-left {
    flex: 1 1 55%;
    margin-top: 1rem;
  }
  
  /* 右カラム: info＋loan calc */
  .car-detail-right {
    flex: 0 0 380px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1rem 1rem 0.5rem;
    box-sizing: border-box;
    position: sticky;
    top: 20px;
    z-index: 100;
    padding-bottom: 0 !important;
  }
  
  /* スマホ幅で縦並びに */
  @media (max-width: 768px) {
    .car-detail-wrapper {
      display: block;
    }
    .car-detail-left,
    .car-detail-right {
      width: 100%;
      margin-bottom: 1rem;
    }
  }
  
  /* 画像スライダー関連 */
  .slider-for, .slider-nav {
    margin: 5px 0;
    opacity: 0; /* 初期状態は非表示、JSで表示 */
  }
  
  .slider-nav {
    margin-top: 15px !important;
    margin-bottom: 10px;
  }
  
  .car-image-container {
    position: relative;
  }
  
  .car-status-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
  }
  
  .car-status-overlay-text {
    color: white;
    font-size: 2em;
    font-weight: bold;
    text-transform: uppercase;
  }
  
  /* 車両スペック情報 */
  .car-specs-block {
    margin: 1rem 0;
  }
  
  .car-specs-block h2 {
    margin: 0 0 0.5rem;
  }
  
  .car-specs-block p {
    margin: 0;
  }
  
  .car-specs-block p:first-of-type {
    font-size: 28px;
    font-weight: bold;
  }
  
  /* 車両詳細本文エリア */
  .car-content {
    margin-top: 1rem !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    padding: 20px 25px !important;
    background-color: #f9f9f9 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    display: block !important;
    height: auto !important;
    width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    /* slick.cssの干渉を防ぐための追加スタイル */
    position: relative !important;
    float: none !important;
    z-index: 1 !important;
    overflow: visible !important;
  }
  
  /* 右カラム - 情報コンテナ */
  .info-container {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
  }
  
  /* 車両メタ情報ボックス */
  .car-meta-box {
    margin-bottom: 1rem;
    position: relative !important;
    z-index: 90 !important;
  }
  
  /* 保証セクション */
  .car-meta-box > div:first-child {
    background-color: #e8f4f8 !important;
    border: 2px solid #0068B7 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    margin-bottom: 1rem !important;
    text-align: center !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    position: relative !important;
    z-index: 100 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: 40px !important;
  }
  
  .car-meta-box > div:first-child > div {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
  }
  
  .car-meta-box > div:first-child p {
    font-weight: bold !important;
    font-size: 1.1em !important;
    color: #2c5282 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    padding: 0 !important;
  }
  
  /* VIN情報（上部マージン追加） */
  .car-meta-box > p:first-of-type {
    margin-bottom: 0.5rem;
    margin-top: 1.2rem !important;
  }
  
  /* その他の車両メタ情報 */
  .car-meta-box p {
    margin-bottom: 0.5rem;
  }
  
  /* コンタクトボックス */
  .contact-box {
    margin-top: 1rem;
  }
  
  .contact-box button {
    display: block;
    width: 100%;
    margin-bottom: 5px;
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    background: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
  }
  
  .contact-box button:first-child {
    background: #0068B7;
    color: #fff;
    border: none;
  }
  
  .contact-box button:hover {
    opacity: 0.9;
  }
  
  /* ディーラー情報 */
  .dealer-info {
    margin-top: 1rem;
  }
  
  .dealer-info h4 {
    margin-top: 0;
    margin-bottom: 10px;
  }
  
  .dealer-info p {
    margin-bottom: 10px;
  }
  
  .dealer-info a {
    color: #0068B7;
    text-decoration: none;
  }
  
  .dealer-info a:hover {
    text-decoration: underline;
  }
  
  /* 追加ボタン（シェア・お気に入り） */
  .extra-buttons {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
  }
  
  .extra-buttons button {
    flex: 1;
    background: #f8f9fa;
    color: #495057;
    padding: 0.6rem 1rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    height: 42px;
    line-height: 1;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  
  #shareBtn {
    margin-top: 5px;
  }
  
  .extra-buttons svg {
    margin-right: 8px;
  }
  
  /* お気に入りボタンスタイル */
  .heart-btn.archive-style-heart-btn {
    background-color: #fff8f8;
    color: #666;
    border-color: #e9ecef;
  }
  
  /* ハートアイコンスタイル */
  .archive-heart-icon path {
    fill: transparent;
    stroke: #ff6b6b;
    stroke-width: 1.5;
    transition: fill 0.2s ease;
  }
  
  /* お気に入り済み状態 */
  .heart-btn.is-favorite {
    background-color: #ffe6e6;
    color: #e74c3c;
    border-color: #ffd1d1;
  }
  
  .heart-btn.is-favorite .archive-heart-icon path {
    fill: #ff6b6b;
    stroke: none;
  }
  
  /* ローン計算機セクション */
  .loan-calculator-section {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.1rem;
    margin-top: 1rem;
    background: #fafafa;
  }
  
  .loan-calculator-section h2 {
    margin-top: 0;
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  
  /* ローン計算機のボディ部分 */
  .loan-calculator-body {
    border: none;
    background: none;
    padding: 0;
  }
  
  /* 計算機の各行 */
  .calc-row {
    margin-bottom: 15px;
    width: 100%;
  }
  
  .calc-row label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: bold;
    font-size: 0.9rem;
    color: #333;
  }
  
  /* 入力グループ */
  .calc-input-group {
    position: relative;
    width: 100%;
  }
  
  .calc-input-group input {
    width: 100%;
    padding: 0.5rem 1rem;
    box-sizing: border-box;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 40px;
  }
  
  /* プレフィックス付き入力 ($) */
  .calc-input-group--with-prefix input {
    padding-left: 1.6rem;
  }
  
  .calc-prefix {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 0.9rem;
    pointer-events: none;
  }
  
  /* サフィックス付き入力 (% / Mo) */
  .calc-input-group--with-suffix input {
    padding-right: 2rem;
  }
  
  .calc-suffix {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 0.9rem;
    pointer-events: none;
  }
  
  /* 日付入力コンテナ */
  .input-container {
    width: 100%;
    position: relative;
  }
  
  .date-input {
    width: 100%;
    height: 40px;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    -webkit-appearance: none;
    appearance: none; /* 標準プロパティを追加 */
    max-width: 100%;
    background-color: white;
  }
  
  /* 計算ボタン */
  .calc-btn {
    margin-top: 1rem;
    margin-left: auto;
    margin-right: auto;
    display: block;
    width: 100%;
    background: #0068B7;
    color: #fff;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }
  
  .calc-btn:hover {
    background-color: #005a87;
  }
  
  /* 結果エリア */
  .calc-result {
    margin-top: 1rem;
  }
  
  /* スマホ向けメディアクエリ */
  @media only screen and (max-width: 767px) {
    .calc-row {
      display: flex;
      flex-direction: column;
      width: 100%;
    }
    
    .input-container {
      width: 100%;
      max-width: 100%;
      overflow: hidden;
    }
    
    .date-input {
      width: 100%;
      min-width: 0;
      max-width: 100%;
      background-color: white;
    }
    
    /* iOSのSafari向け特別対応 */
    input[type="date"] {
      font-size: 16px;
      text-align: left;
      background-color: white !important;
      -webkit-appearance: none;
      appearance: none;
    }
  }
  
  /* おすすめセクション */
  .recommend-section {
    margin-top: 1rem;
  }
  
  .recommend-section h2 {
    margin-bottom: 20px;
  }
  
  /* おすすめスライダー */
  .recommend-slider {
    margin: 0 -10px;
  }
  
  /* 車両カード */
  .car-item {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    overflow: hidden;
    position: relative;
    margin: 0 10px;
    transition: box-shadow 0.3s ease;
    height: 100%;
  }
  
  .car-item:hover {
    box-shadow: 0 3px 6px rgba(0,0,0,0.16) !important;
  }
  
  .car-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: center;
    display: block;
  }
  
  /* 車両情報 */
  .car-item > div {
    padding: 10px 12px;
  }
  
  /* 車両タイトルと価格のコンテナ */
  .car-item h3 {
    font-size: 16px;
    font-weight: bold;
    margin: 0;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85%;
    flex: 1;
  }
  
  .car-item h3 a {
    text-decoration: none;
    color: inherit;
  }
  
  /* 車両情報のフレックスコンテナ */
  .car-item > div > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
  }
  
  /* マイレージ情報 */
  .car-item > div > div:nth-child(2) {
    display: flex;
    justify-content: flex-start;
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
  }
  
  .car-item > div > div:nth-child(2) span {
    display: inline-block;
    text-align: left;
  }
  
  /* 価格表示 */
  .car-item > div > div:nth-child(3) {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-top: 5px;
    text-align: left;
  }
  
  /* お気に入りハートボタン */
  .car-item .heart-btn {
    text-decoration: none;
    font-size: 22px;
    color: #ff6b6b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
  }
  
  .car-item .heart-btn .heart-icon {
    transform: none !important;
    display: inline-block;
  }
  
  .car-item .heart-btn:hover .heart-icon {
    transform: none !important;
  }
  
  /* スライダーの矢印位置調整 */
  .recommend-slider .slick-prev,
  .recommend-slider .slick-next {
    z-index: 10;
  }
  
  .recommend-slider .slick-prev {
    left: -10px;
  }
  
  .recommend-slider .slick-next {
    right: -10px;
  }
  
  /* シングルカーページでのh2にだけ上マージンを与える */
  body.single-car h2 {
    margin-top: 20px;
  }
  
  /* シングルカーページのコンテンツ幅制限 */
  body.single-car .main-content .container,
  body.single-car .car-detail-wrapper,
  body.single-car .recommend-section {
    max-width: 1200px !important;
    margin: 0 auto !important;
  }

/* メイン画像コンテナの調整 */
.slider-for .car-image-container {
  height: 500px;
  background-color: #eee; /* 背景色をグレーに */
  position: relative;
  margin-bottom: 5px;
  overflow: hidden; /* はみ出した部分を隠す */
  display: block; /* flexではなく通常のブロック表示に */
}

/* メイン画像のスタイル */
.slider-for .car-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* contain ではなく cover に変更 */
  object-position: center;
  display: block;
}

/* スライダー全体の外側の余白を削除 */
.slider-for, .slider-nav {
  margin: 0 !important;
  padding: 0 !important;
}

/* スライダー間の余白を調整 */
.slider-nav {
  margin-top: 10px !important;
}

/* サムネイル画像の余白と高さ */
.slider-nav .slick-slide {
  padding: 0 2px;
}

.slider-nav div img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  border: 1px solid #ddd;
}

/* COMING SOONなどのオーバーレイのスタイル強化 */
.car-status-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
}

.car-status-overlay-text {
  color: white;
  font-size: 3em;
  font-weight: bold;
  text-transform: uppercase;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* スライダーのナビゲーション矢印 */
.slick-arrow {
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.slick-prev {
  left: 10px;
}

.slick-next {
  right: 10px;
}

/* 大きな画面でもはみ出ないように幅を制限 */
.car-detail-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .slider-for .car-image-container {
    height: 300px; /* モバイルでは高さを小さく */
  }
  
  .car-status-overlay-text {
    font-size: 2em;
  }
}

/* 高解像度ディスプレイ対応 */
@media (min-width: 1440px) {
  .slider-for .car-image-container {
    height: 550px;
  }
}

/* 画像の初期表示を確実に */
.slider-for, .slider-nav {
  opacity: 1 !important;
}

/* 詳細ページのスライダーが初期化されるまで隠す */
.slider-for:not(.slick-initialized),
.slider-nav:not(.slick-initialized) {
  visibility: hidden;
  opacity: 0;
}

/* 初期化後に表示 */
.slider-for.slick-initialized,
.slider-nav.slick-initialized {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease;
}