/* =============================================
   vehicle_fitment.css — 车辆适配弹窗模块样式
   依赖：common.css（CSS 变量）
   ============================================= */

/* =============================================
   弹窗遮罩
   覆盖导航栏以下区域
   ============================================= */
.vf-overlay {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: var(--vf-header-h, 172px);
  background: rgba(0, 0, 0, 0) !important;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.vf-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* =============================================
   弹窗主体
   从导航栏下方开始，全宽抽屉式展开
   ============================================= */
.vf-modal {
  position: fixed;
  top: var(--vf-header-h, 172px);
  left: 0;
  right: 0;
  z-index: 1001;
  width: 100%;
  height: min(680px, calc(100vh - var(--vf-header-h, 172px)));
  background: #000;
  border-radius: 0;
  overflow: hidden;
  opacity: 1;               /* 不做 opacity 动画，用 translateY */
  transform: translateY(-14px);
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.28s ease;
  visibility: hidden;
  display: flex;
  flex-direction: column;
  /* 底部阴影增强层次感 */
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.vf-modal.active {
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

/* =============================================
   弹窗头部
   ============================================= */
.vf-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 90px;
  padding: 0 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  flex-shrink: 0;
}

.vf-modal__title {
  font-size: 28px;
  line-height: 42px;
  font-weight: 700;
  color: #ffffff;
}

.vf-modal__close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.vf-modal__close:hover { color: #ffffff; }

.vf-modal__close svg,
.vf-modal__close img {
  width: 24px;
  height: 24px;
}

.vf-modal__close svg {
  stroke: currentColor;
}

.vf-modal__close img {
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.vf-modal__close:hover img {
  opacity: 1;
}

/* =============================================
   弹窗内容区
   ============================================= */
.vf-modal__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: calc(100% - 90px);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  width: 100%;
}

/* 分割线 */
.vf-panel + .vf-panel {
  border-left: 1px solid rgba(255, 255, 255, 0.10);
}

/* =============================================
   面板公共
   ============================================= */
.vf-panel {
  padding: 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.vf-panel--vehicle {
  overflow-y: auto;
  overflow-x: hidden;
}

/* 面板标题行 */
.vf-panel__heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vf-panel__heading-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.70);
}

.vf-panel__heading-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* 将 stroke="currentColor" 的 SVG 设为白色 */
  filter: brightness(0) invert(0.7);
}

.vf-panel__label-text {
  font-size: 18px;
  line-height: 27px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #fff;
}

/* =============================================
   左侧：REGO SEARCH 面板
   ============================================= */
.vf-rego-label {
  font-size: 14px;
  line-height: 21px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: -12px;
}

/* REGO 大输入框 */
.vf-rego-input-wrap {
  position: relative;
}

.vf-rego-input {
  width: 100%;
  height: 96px;
  background: #ffffff;
  border: 1.5px solid #333;
  border-radius: 8px;
  font-size: 40px;
  line-height: 1;
  font-weight: 700;
  color: rgba(102, 102, 102, 0.9);
  text-align: center;
  letter-spacing: 4px;
  transition: border-color 0.15s ease;
  padding: 0 16px;
}

.vf-rego-input::placeholder {
  color: rgba(102, 102, 102, 0.5);
  font-weight: 700;
  font-size: 40px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.vf-rego-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* 搜索历史区 */
.vf-history-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vf-history-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vf-history-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.vf-history-icon img {
  width: 100%;
  height: 100%;
  filter: brightness(0) invert(0.6);
}

.vf-history-label {
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.vf-history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 历史标签 */
.vf-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 4px;
  font-family: 'Inter', var(--font-family);
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.vf-tag:hover {
  background: rgba(255, 255, 255, 0.14);
}

.vf-tag__remove {
  width: 14px;
  height: 14px;
  opacity: 0.55;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}

.vf-tag__remove:hover {
  opacity: 1;
}

.vf-tag__remove svg,
.vf-tag__remove img {
  width: 10px;
  height: 10px;
}

.vf-tag__remove svg {
  stroke: currentColor;
}

.vf-tag__remove img {
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.75;
}

.vf-tag__remove:hover img {
  opacity: 1;
}

/* =============================================
   右侧：VEHICLE SEARCH 面板
   ============================================= */

/* 下拉行标签 */
.vf-vehicle-label {
  font-size: 14px;
  line-height: 21px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: -12px;
}

/* Dropdown 网格 */
.vf-dropdowns {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.vf-dropdown-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.vf-dropdown-row + .vf-dropdown-row {
  margin-top: 12px;
}

/* 单个下拉 — 自定义 select 包裹器 */
.vf-select-wrap {
  position: relative;
}

.vf-select {
  width: 100%;
  height: 48px;
  padding: 0 36px 0 16px;
  background: #333;
  border: 1px solid #555;
  border-radius: 4px;
  font-size: 14px;
  color: #fff;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.vf-select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.45);
  background: #3a3a3a;
}

.vf-select:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

/* chevron 图标 */
.vf-select-wrap::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: url("../icon/chevron-down.svg") center / contain no-repeat;
  pointer-events: none;
  opacity: 0.8;
}

/* Engine + Details 行用 3 列宽度不同 */
.vf-dropdown-row--engine {
  display: flex;
  gap: 12px;
}

.vf-dropdown-row--engine .vf-select-wrap:nth-child(1) {
  width: 50%;
}

.vf-dropdown-row--engine .vf-select-wrap:nth-child(2) {
  width: 50%;
}

/* =============================================
   SEARCH BUTTON (两个面板共用)
   ============================================= */
.vf-search-btn {
  width: 100%;
  height: 48px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 18px;
  line-height: 27px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  margin-bottom: 10px;
}

.vf-search-btn:hover,
.vf-search-btn:focus {
  background: var(--color-primary);
  color: #ffffff;
  outline: none;
}

.vf-search-btn:active {
  background: var(--color-primary-active);
}

#vf-rego-search-btn {
  background: #ccc;
  color: #666;
  opacity: 0.5;
}

#vf-rego-search-btn:hover,
#vf-rego-search-btn:focus,
#vf-rego-search-btn:active {
  background: #ccc;
  color: #666;
  outline: none;
}

/* =============================================
   My Vehicles 区
   ============================================= */
.vf-my-vehicles {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vf-my-vehicles__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vf-my-vehicles__title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vf-my-vehicles__icon {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.vf-my-vehicles__icon svg,
.vf-my-vehicles__icon img {
  width: 16px;
  height: 16px;
}

.vf-my-vehicles__icon svg {
  stroke: var(--color-primary);
}

.vf-my-vehicles__icon img {
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(20%) sepia(87%) saturate(6139%) hue-rotate(352deg) brightness(93%) contrast(90%);
}

.vf-my-vehicles__title {
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.vf-my-vehicles__counter {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
}

/* 车辆卡片网格 */
.vf-vehicles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* 单张车辆卡片 */
.vf-vehicle-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
}

.vf-vehicle-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.vf-vehicle-card.is-default {
  border-color: rgba(227, 30, 36, 0.40);
  background: rgba(227, 30, 36, 0.10);
}

/* 车辆名称行 */
.vf-vehicle-card__name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.vf-vehicle-card__name {
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
  color: #fff;
  flex: 1;
}

/* DEFAULT 徽章 */
.vf-badge-default {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  padding: 0 6px;
  background: var(--color-primary);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
  white-space: nowrap;
  flex-shrink: 0;
}

.vf-badge-default__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
}

/* SET DEFAULT 按钮 */
.vf-btn-set-default {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  padding: 0 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.vf-btn-set-default:hover {
  border-color: rgba(255, 255, 255, 0.45);
  color: rgba(255, 255, 255, 0.85);
}

.vf-btn-set-default__icon {
  width: 10px;
  height: 10px;
}

.vf-btn-set-default__icon svg,
.vf-btn-set-default__icon img {
  width: 10px;
  height: 10px;
}

.vf-btn-set-default__icon svg {
  stroke: currentColor;
}

.vf-btn-set-default__icon img {
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.65;
}

.vf-btn-set-default:hover .vf-btn-set-default__icon img {
  opacity: 0.9;
}

/* 车辆详情 */
.vf-vehicle-card__details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vf-vehicle-card__detail {
  font-size: 11px;
  line-height: 16.5px;
  color: rgba(255, 255, 255, 0.6);
}

/* =============================================
   响应式 — 平板 (≤1024px)
   ============================================= */
@media (max-width: 1024px) {
  .vf-panel {
    padding: 24px 28px;
  }
}

/* =============================================
   摇动动画（输入验证错误提示）
   ============================================= */
@keyframes vf-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.vf-shake {
  animation: vf-shake 0.35s ease;
}

/* =============================================
   响应式 — 手机 (≤640px)
   ============================================= */
@media (max-width: 640px) {
  .vf-modal {
    height: calc(100vh - var(--vf-header-h, 172px));
  }

  .vf-modal__body {
    grid-template-columns: 1fr;
    overflow-y: auto;
    height: auto;
  }

  .vf-panel + .vf-panel {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
  }

  .vf-panel {
    padding: 20px 18px;
  }

  .vf-dropdown-row {
    grid-template-columns: 1fr;
  }

  .vf-dropdown-row--engine {
    grid-template-columns: 1fr 1fr;
  }

  .vf-vehicles-grid {
    grid-template-columns: 1fr;
  }

  .vf-rego-input {
    height: 72px;
    font-size: 22px;
  }
}
