/* ==============================================
   在庫一覧ページ（Archive Car Page）用CSS
   ============================================== */

/* ============== 在庫一覧ページ全体のレイアウト ============== */

/* 在庫一覧ページ全体を包むコンテナ */
.inventory-page-container {
    margin-top: 20px;
  }
  
  /* 上部検索ボックス */
  .inventory-top-search {
    margin-top: 20px;
    margin-bottom: 20px;
  }
  
  .top-search-form {
    display: flex;
    gap: 5px;
    align-items: center;
  }
  
  .top-search-form input[type="text"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
  }
  
  .top-search-form button {
    background-color: #0068B7;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
  }
  
  .top-search-form button:hover {
    background-color: #0056b3;
  }
  
  /* ============== 左サイドバー + 右コンテンツの2カラム ============== */
  
  /* PC版で2カラム */
  .inventory-layout {
    display: flex;
    gap: 20px;
  }
  
  /* 左サイドバー */
  .inventory-filters {
    flex: 0 0 250px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 15px;
    box-sizing: border-box;
    align-self: flex-start;
    position: sticky;
    top: 20px;
  }
  
  .inventory-filters h3 {
    margin-top: 0;
    margin-bottom: 10px;
  }
  
  .filter-group {
    margin-bottom: 10px;
  }
  
  .filter-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 3px;
  }
  
  .filter-group input,
  .filter-group select {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
  }
  
  .btn-filter-submit {
    background-color: #0068B7;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
  }
  
  .btn-filter-submit:hover {
    background-color: #0056b3;
  }
  
  /* 右側の在庫リストエリア */
  .inventory-results {
    flex: 1;
  }
  
  /* PC → スマホで縦並び */
  @media (max-width: 768px) {
    /* スマホでは縦並びにする */
    .inventory-layout {
      display: block;
    }
    .inventory-filters,
    .inventory-results {
      width: 100%;
      margin-bottom: 20px;
    }
  }
  
  /* ============== Refine Search 折りたたみ用 ============== */
  
  /* PC向けデフォルト */
  .refine-toggle-btn {
    display: none;
  }
  
  .refine-content {
    display: block;
  }
  
  /* スマホ向け折りたたみ挙動 */
  @media (max-width: 768px) {
    /* トグルボタンを表示 */
    .refine-toggle-btn {
      display: block;
      width: 100%;
      background: #eee;
      border: 1px solid #ccc;
      padding: 10px 15px;
      text-align: left;
      cursor: pointer;
      font-size: 1rem;
    }
  
    /* プラスマイナスアイコンを右端に */
    .refine-toggle-btn .plus-minus-icon {
      float: right;
      font-weight: bold;
    }
  
    /* モバイルでは中身を折りたたみがデフォルト */
    .refine-content {
      display: none;
    }
  
    /* JSで .is-open を付与したときだけ表示 */
    .refine-content.is-open {
      display: block;
    }
  }
  
  /* ============== 在庫ヘッダーエリア ============== */
  
  .inventory-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
  }
  
  /* Car Inventory の見出しに上下余白を追加 */
  .inventory-title {
    margin-top: 20px;
    margin-bottom: 20px;
  }
  
  /* ============== カーリスト表示 ============== */
  
  /* 車両グリッド表示 */
  .car-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .car-item {
    border: 1px solid #ddd;
    padding: 1rem;
    width: calc(25% - 2rem);
    box-sizing: border-box;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    overflow: hidden;
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
  }
  
  .car-item:hover {
    box-shadow: 0 3px 6px rgba(0,0,0,0.16);
  }
  
  .car-item img {
    max-width: 100%;
    height: auto;
    display: block;
  }
  
  /* Car Inventory ページのリンク下線を削除 */
  .car-list a,
  .inventory-results a {
    text-decoration: none;
  }
  
  /* 必要に応じてホバー時の下線も削除 */
  .car-list a:hover,
  .inventory-results a:hover {
    text-decoration: none;
  }
  
  /* カードスライダー */
  .card-slider {
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px 4px 0 0;
  }
  
  /* 矢印だけは別のカーソルにする（オプション） */
  .card-slider .slick-arrow {
    cursor: default;
  }
  
  /* 車両情報全体のレイアウト */
  .car-meta {
    padding: 12px 15px;
  }
  
  /* 車名行のスタイル */
  .car-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
  }
  
  /* 車名をボールドで大文字に */
  .car-name {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
    flex: 1;
    padding-left: 0;
  }
  
  /* お気に入りアイコン */
  .heart-btn {
    text-decoration: none;
    font-size: 22px;
    color: #ff6b6b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .heart-icon {
    transition: transform 0.2s ease;
  }
  
  .heart-btn:hover .heart-icon {
    transform: scale(1.2);
  }
  
  /* 情報行のスタイル */
  .car-info-row {
    display: flex;
    justify-content: flex-start; /* space-betweenからflex-startに変更 */
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
  }
  
  /* VINと走行距離の間隔 */
  .car-vin, .car-mileage {
    display: inline-block;
  }
  
  /* 価格表示を大きく目立たせる */
  .car-price {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-top: 5px;
  }
  
  /* ブレークポイント対応 */
  @media (max-width: 768px) {
    .car-item {
      width: calc(50% - 1rem);
    }
    
    /* VINを非表示にする */
    .car-vin {
      display: none !important;
    }
    
    /* マイル数を左揃えにする */
    .car-info-row {
      justify-content: flex-start;
    }
  }
  
  @media (max-width: 480px) {
    .car-item {
      width: 100%;
    }
  }
  
  /* ============== おすすめ車両(Featured Cars)セクション ============== */
  
  .featured-cars-block {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
  }
  
  .featured-cars-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
  }
  
  /* おすすめ車両セクションのグリッドを4列に変更 */
  @media (min-width: 768px) {
    .featured-cars-block .car-list {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 20px;
    }
  }
  
  /* 各車両アイテムの幅を調整して適切に収まるようにする */
  .featured-cars-block .car-item {
    width: 100%;
    margin-bottom: 0;
  }
  
  /* カードが詰まりすぎている場合は、パディングを減らす */
  .featured-cars-block .car-meta {
    padding: 10px 12px;
  }
  
  /* 4列レイアウト用にタイトルを小さくする */
  .featured-cars-block .car-name {
    font-size: 16px;
  }
  
  /* 画像のアスペクト比を維持する */
  .featured-cars-block .slide-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }
  
  /* ============== ページネーション ============== */
  
  .pagination {
    margin-top: 20px;
    text-align: center;
  }
  
  .pagination .page-numbers {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    color: #333;
  }
  
  .pagination .page-numbers.current {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
  }
  
  .pagination .prev, .pagination .next {
    padding: 8px 12px;
  }
  
  /* カスタムページネーション */
  .custom-pagination a,
  .custom-pagination span {
    display: inline-block !important;
    position: relative !important;
    width: auto !important;
    height: auto !important;
    margin: 0 5px !important;
    padding: 5px 10px !important;
    border: 1px solid #ddd !important;
    background: #fff !important;
    color: #333 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    text-align: center !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
  }
  
  .custom-pagination .current {
    background: #007bff !important;
    color: #fff !important;
    border-color: #007bff !important;
  }
  
  .custom-pagination a:hover {
    background: #f5f5f5 !important;
  }
  
  /* デバッグ用ページネーション（必要に応じて） */
  .nav-pagination {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    width: 100% !important;
    margin: 30px 0 !important;
    padding: 15px 0 !important;
    text-align: center !important;
    position: relative !important;
    float: none !important;
    z-index: 50 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    clear: both !important;
  }
  
  .debug-pagination {
    padding: 5px !important;
    margin-bottom: 10px !important;
    font-weight: bold !important;
    color: red !important;
  }
  
  .nav-pagination ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
  }
  
  .nav-pagination li {
    display: inline-block !important;
    margin: 0 3px !important;
  }
  
  .nav-pagination a,
  .nav-pagination span {
    display: inline-block !important;
    padding: 5px 10px !important;
    border: 1px solid #ccc !important;
    background: #fff !important;
    color: #333 !important;
    text-decoration: none !important;
    border-radius: 3px !important;
  }
  
  .nav-pagination .current {
    background: #4a90e2 !important;
    color: #fff !important;
    border-color: #3a80d2 !important;
  }


  /* このブロックをarchive-car.cssに追加 */

/* Card Slider for Archive Page */
.car-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, 290px); /* auto-fit → auto-fill に変更、固定幅290px */
  gap: 20px;
  margin: 0;
  padding: 0;
  justify-content: flex-start; /* 左寄せ */
}

.car-item {
  position: relative;
  background: white;
  border: 1px solid #eee;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  width: 100% !important;
  margin: 0 0 20px 0 !important;
  padding-bottom: 10px;
  max-width: 290px; /* 最大幅を制限 */
  transition: box-shadow 0.3s ease, transform 0.2s;
}

.car-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.16);
}

.car-meta {
  padding: 10px;
}

.car-item h3 {
  padding: 10px 10px 0 10px;
  margin: 0;
}

.car-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

.car-name {
  font-size: 18px;
  font-weight: bold;
  margin: 0;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
  flex: 1;
  padding-left: 0;
}

.heart-btn {
  text-decoration: none;
  font-size: 22px;
  color: #ff6b6b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.heart-icon {
  transition: transform 0.2s ease;
}

.heart-btn:hover .heart-icon {
  transform: scale(1.2);
}

.car-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.car-vin, .car-mileage {
  display: inline-block;
}

.car-price {
  font-size: 22px;
  font-weight: bold;
  color: #333;
  margin-top: 5px;
}

/* メディアクエリの統合 */
@media (max-width: 1200px) {
  .car-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .car-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .car-vin {
    display: none !important;
  }
  
  .car-info-row {
    justify-content: flex-start; /* centerからflex-startに変更 */
  }
}

@media (max-width: 576px) {
  .car-list {
    grid-template-columns: 1fr;
  }
}

/* このCSSをarchive-car.cssに追加してみてください */
/* スライダーが初期化される前に画像を隠す */
.card-slider:not(.slick-initialized) {
  position: relative;
  visibility: hidden;
  height: 200px;
  background: #f5f5f5;
}

/* スライダーが初期化される前に中の画像を隠す */
.card-slider:not(.slick-initialized) .slide-item {
  opacity: 0;
  position: absolute;
}

/* スライダーが初期化されたら表示 */
.card-slider.slick-initialized {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* カードサイズを変更 - 100%で4列、ズームで見切れない */
.car-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)) !important;
  gap: 20px !important;
}

/* 車両ステータスオーバーレイ（Reserved, Coming Soon, Sold）*/
.car-status-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.car-status-overlay-text {
  color: white;
  font-size: 22px !important;
  font-weight: bold;
  text-transform: uppercase;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}

/* ============== Seller チェックボックスフィルター用CSS ============== */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
    margin: 0;
    padding: 0;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    margin-left: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-text {
    color: #333;
    user-select: none;
    cursor: pointer;
}

.checkbox-label:hover .checkbox-text {
    color: #007cba;
}

/* 既存の .filter-group スタイルと統一 */
.filter-group .checkbox-group {
    border: none;
    background: none;
    padding: 0;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .checkbox-group {
        gap: 6px;
    }
    
    .checkbox-label {
        font-size: 13px;
    }
    
    .checkbox-label input[type="checkbox"] {
        width: 14px;
        height: 14px;
        margin-right: 6px;
    }
}