/*
 * 詳細頁通用樣式（單一車輛頁 single-cars）
 *
 * 由 enqueue.php 於 is_singular('cars') 條件載入。
 * 與 vehicle-detail-cta.css 分工：本檔放詳細頁「通用」樣式，CTA 樣式留在 -cta.css。
 *
 * 收錄三段原本內嵌在 Pods Template `car_detail` 的 <style>（wave 1 抽離）：
 *   1. 圖片全螢幕 Lightbox（.gallery-modal-*）— 注意：對應的開關 JS 仍在 Pods 的 Splide 區塊
 *   2. 購車注意事項折疊（.car-disclaimer*）
 *   3. 驗車里程 badge + Modal（.miles-verified-btn / .miles-modal-* / @keyframes miles-pulse）
 *
 * 不含：週年慶促銷樣式（.ann-*）。週年慶屬限時活動（見 CLAUDE.md §3.2 / §6.3），
 *       不進 plugin，續留 Simple CSS / Pods Template，活動結束整批刪。
 *
 * 對應 HTML：仍在 Pods Template car_detail（鏡像見 pods/car_detail.html）。
 * 對應原始：Pods Template car_detail 內嵌 <style>（非 WPCode）
 */

/* ============================================================
   1. 圖片全螢幕 Lightbox
   （JS 開關在 Pods Template 的 Splide DOMContentLoaded 區塊）
   z-index 9998：比 miles-modal 的 9999 低一層，刻意如此
   ============================================================ */
.gallery-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9998;
  justify-content: center;
  align-items: center;
}

/* modal 內的 Splide 填滿畫面 */
.gallery-modal-splide {
  width: 100%;
  height: 100%;
}
.gallery-modal-splide .splide__track {
  height: 100%;
}
.gallery-modal-splide .splide__list {
  height: 100%;
}
.gallery-modal-splide .splide__slide {
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-modal-splide .splide__slide img {
  max-width: 100%;
  max-height: 100dvh;
  object-fit: contain; /* 完整顯示，不裁切 */
  border-radius: 0;
  cursor: default;
}

/* 關閉按鈕 */
.gallery-modal-close {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 10;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-tap-highlight-color: transparent;
}
.gallery-modal-close:active {
  background: rgba(255,255,255,0.3);
}

/* 主輪播圖片加 zoom-in 提示（桌機 hover） */
@media (hover: hover) {
  .car-gallery .splide__slide img:hover {
    opacity: 0.92;
    transition: opacity 0.15s;
  }
}

/* ============================================================
   2. 購車注意事項折疊區塊（.car-disclaimer）
   ============================================================ */
.car-disclaimer {
  margin: 12px 0 20px;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}
.car-disclaimer-toggle {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  color: #555;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.car-disclaimer-toggle::before {
  content: '▶';
  font-size: 10px;
  transition: transform 0.2s;
}
details[open] .car-disclaimer-toggle::before {
  transform: rotate(90deg);
}
.car-disclaimer-list {
  margin: 0;
  padding: 0 16px 14px 16px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #555;
  line-height: 1.6;
  border-top: 1px solid #e1e4e8;
}

/* ============================================================
   3. 驗車里程：查核 badge + 證明圖 Modal
   ============================================================ */

/* Badge Pulse 動畫 */
@keyframes miles-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.miles-verified-btn {
  cursor: pointer;
  border: none;
  font: inherit;
  animation: miles-pulse 2s infinite;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  vertical-align: bottom;
}
.miles-verified-btn:hover {
  opacity: 0.85;
  transform: scale(1.03);
  transition: all 0.2s ease;
}
.mvb-hint {
  font-size: 11px;
  color: #16a34a;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Modal */
.miles-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.miles-modal-box {
  position: relative;
  max-width: 540px;
  width: 100%;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}
.miles-modal-title {
  margin: 0;
  padding: 14px 16px 10px;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  border-bottom: 1px solid #f0f0f0;
}
.miles-modal-box img {
  width: 100%;
  height: auto;
  display: block;
}
.miles-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
