/* ==========================================================================
   JDM HUNTER - COMPONENTS STYLESHEET
   Cards, Photo Gallery, Valuation Meters, Landed Cost, Modals, Toasts
   ========================================================================== */

/* Vehicle Listing Card */
.car-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.car-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

/* Card Media / Photo Preview */
.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.car-card:hover .card-img {
  transform: scale(1.04);
}

/* Photo Badges & Counter */
.media-badges-top {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.badge-25yr {
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow-sm);
}

.badge-source {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.photo-count-pill {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* Card Watchlist Star Button */
.watch-star-btn {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition-fast);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 5;
}

.watch-star-btn:hover {
  color: var(--accent-gold);
  transform: scale(1.15);
}

.watch-star-btn.watched {
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-gold);
}

/* Card Content Body */
.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title-row {
  margin-bottom: 0.6rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.22;
  letter-spacing: -0.45px;
}

.card-chassis {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-top: 0.25rem;
  letter-spacing: 0.2px;
}

/* Specs Strip */
.card-specs-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.spec-chip {
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  letter-spacing: -0.1px;
}

.spec-chip.spec-highlight {
  color: var(--accent-gold);
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.spec-chip.spec-manual {
  color: var(--accent-blue-light);
  border-color: #bccdf7;
  background: #eef2fe;
}

.spec-chip.spec-clean {
  color: var(--accent-emerald);
  border-color: #b3e2d1;
  background: #e9f7f2;
}

.spec-chip.spec-accident {
  color: var(--accent-red);
  border-color: #f6c2ce;
  background: #fdeef2;
}

/* Price Row & Landed Estimate */
.card-price-section {
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.85rem;
  margin-bottom: 1rem;
}

.price-main-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.price-usd {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.8px;
}

.price-yen {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.landed-cost-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border-subtle);
}

.landed-cost-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-emerald);
}

/* Deal / Market Value Meter */
.card-deal-meter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.75rem;
}

.deal-tag {
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Status pills — solid tinted fills rather than low-alpha overlays, which
   washed out to near-white once the theme went light. */
.deal-great { background: #e3f5ee; color: var(--accent-emerald); border: 1px solid #b3e2d1; }
.deal-good { background: #e6ecfd; color: var(--accent-blue-light); border: 1px solid #bccdf7; }
.deal-fair { background: var(--bg-inset); color: var(--text-secondary); border: 1px solid var(--border-strong); }
.deal-premium { background: #fbeedd; color: var(--accent-gold); border: 1px solid #f0d5ae; }
.deal-high { background: #fce8ed; color: var(--accent-red); border: 1px solid #f6c2ce; }

.price-drop-indicator {
  color: var(--accent-emerald);
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Card Dealer & Action Buttons */
.card-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dealer-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dealer-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.card-action-btns {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.btn-details {
  background: var(--text-primary);
  color: #fff;
  border: none;
  padding: 0.62rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.1px;
  cursor: pointer;
  text-align: center;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-details:hover {
  background: var(--accent-red);
  box-shadow: 0 4px 14px var(--accent-red-glow);
}

.btn-source-link {
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

.btn-source-link:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  text-decoration: none;
}

/* Table View Styling */
.cars-table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.cars-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.cars-table th {
  background: var(--bg-card);
  padding: 0.85rem 1rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.cars-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.cars-table tr:hover td {
  background: var(--bg-card-hover);
}

.table-thumb {
  width: 64px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

/* ==========================================================================
   MODALS (Car Detail, Landed Cost Calculator, Alerts Manager)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1050px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform var(--transition-smooth);
}

.modal-overlay.active .modal-dialog {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 10;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
}

.modal-close-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

/* Tab Navigation in Modal */
.modal-nav-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
  gap: 0.5rem;
}

.modal-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-tab-btn:hover {
  color: var(--text-primary);
}

.modal-tab-btn.active {
  color: var(--accent-blue-light);
  border-bottom-color: var(--accent-blue);
}

/* Detail Modal Gallery Carousel */
.modal-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.gallery-main-view {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: zoom-in;
}

.gallery-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, transparent 100%);
  padding: 1rem;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}

.gallery-filmstrip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.strip-thumb {
  width: 100px;
  height: 65px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.7;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.strip-thumb:hover {
  opacity: 1;
}

.strip-thumb.active {
  border-color: var(--accent-blue);
  opacity: 1;
}

/* Translation Side-by-Side Box */
.translation-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.translation-col-header {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.trans-notes-text {
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-line;
}

.trans-notes-text.ja {
  color: var(--text-secondary);
  font-family: 'Hiragino Sans', 'Meiryo', sans-serif;
}

.trans-notes-text.en {
  color: var(--text-primary);
}

/* Auction Inspection Sheet Viewer */
.inspection-viewer {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.inspection-points-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.inspect-point-card {
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.inspect-code-badge {
  background: var(--accent-red);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* Landed Cost Breakdown Card inside Modal */
.landed-cost-calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.calc-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cost-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.cost-breakdown-table tr {
  border-bottom: 1px solid var(--border-subtle);
}

.cost-breakdown-table td {
  padding: 0.6rem 0;
}

.cost-breakdown-table td.val-col {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
}

.cost-total-row {
  border-top: 2px solid var(--border-strong);
  font-size: 1.1rem;
  font-weight: 800;
}

.cost-total-row td {
  padding-top: 1rem;
  color: var(--accent-emerald);
}

/* Toast Notifications Container */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
  pointer-events: none;
}

.jdm-toast {
  background: #2a2f3c;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.jdm-toast:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue);
}

.toast-indicator {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-red);
}

.toast-thumb {
  width: 58px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.toast-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.toast-body {
  flex: 1;
}

.toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}

.toast-tag {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.toast-time {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.toast-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.toast-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.toast-price {
  color: var(--accent-emerald);
  font-family: var(--font-mono);
  font-weight: 700;
}

.toast-loc {
  color: var(--text-muted);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

/* Lightbox Fullscreen Overlay */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img-wrapper {
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 40px rgba(0,0,0,0.9);
}

.lightbox-controls {
  position: absolute;
  bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lightbox-nav-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.lightbox-nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Compare Drawer */
.compare-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 2px solid var(--accent-blue);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  transform: translateY(100%);
  transition: transform var(--transition-smooth);
  padding: 1rem 1.5rem;
}

.compare-drawer.active {
  transform: translateY(0);
}

.compare-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.compare-items-row {
  display: flex;
  gap: 1rem;
}

.compare-item-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
}

.compare-item-thumb {
  width: 40px;
  height: 30px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* Animations */
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.animate-slide-in {
  animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-out {
  animation: fadeOut 0.35s ease forwards;
}

/* ==========================================================================
   MOBILE RESPONSIVE OVERRIDES
   ========================================================================== */
@media (max-width: 768px) {
  .modal-dialog {
    max-height: 95vh;
    border-radius: var(--radius-md);
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  /* Scroll the tab strip horizontally instead of wrapping/squishing five
     tabs into a too-narrow column */
  .modal-nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }

  .modal-tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .translation-container {
    grid-template-columns: 1fr;
  }

  .card-action-btns {
    grid-template-columns: 1fr;
  }

  .lightbox-img-wrapper {
    max-width: 92vw;
  }
}

/* ==========================================================================
   CONTACT / INQUIRY FORM
   ========================================================================== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-label .req { color: var(--accent-red); }
.contact-label .opt {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.contact-input {
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

.contact-input::placeholder { color: var(--text-muted); }

.contact-input:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px var(--accent-red-glow);
}

.contact-textarea {
  resize: vertical;
  min-height: 110px;
  font-family: inherit;
  line-height: 1.5;
}

.contact-submit {
  background: var(--text-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  margin-top: 0.25rem;
}

.contact-submit:hover {
  background: var(--accent-red);
  box-shadow: 0 4px 16px var(--accent-red-glow);
}

.contact-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  min-height: 1.1rem;
}

.contact-note.is-error { color: var(--accent-red); }
.contact-note.is-success { color: var(--accent-emerald); }

@media (max-width: 560px) {
  .contact-row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Per-car actions in the detail modal (enquire + share)
   ========================================================================== */
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 1.1rem;
}

.car-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.1rem;
  min-height: 44px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.car-action:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }

.car-action-primary {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}
.car-action-primary:hover { background: #b91839; border-color: #b91839; }

/* Fallback menu, shown only where the Web Share API is unavailable. */
.share-wrap { position: relative; }

.share-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 0.3rem;
  z-index: 30;
  display: flex;
  flex-direction: column;
}

.share-menu a,
.share-menu button {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.88rem;
  color: var(--text-primary);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  text-decoration: none;
}
.share-menu a:hover,
.share-menu button:hover { background: var(--bg-inset); text-decoration: none; }

@media (max-width: 560px) {
  .modal-actions { flex-direction: column; }
  .car-action { width: 100%; justify-content: center; }
  .share-wrap { width: 100%; }
  .share-menu { left: 0; right: 0; }
}

/* Paging control under the results. Doubles as the marker the scroll observer
   watches, so it sits in the normal flow rather than being positioned. */
.cars-more {
  display: flex;
  justify-content: center;
  padding: 1.75rem 0 0.5rem;
}

.cars-more .header-btn {
  padding: 0.7rem 1.6rem;
  font-weight: 600;
}

/* A listing that is not importable yet. Same shape as the legal badge so the
   layout is identical, but amber rather than green — a car you cannot buy for
   another few months must not wear the same colour as one you can. */
.badge-25yr.badge-pending {
  background: rgba(180, 105, 10, 0.92);
}

/* "Almost Ready" — the prompt for cars that become importable within the
   public horizon. Deliberately styled as an offer rather than another filter
   row: it is the one thing in the sidebar asking to be pressed, and the cars
   behind it cannot be found any other way while the 25-year filter is on.

   Amber to match the badge those cars carry on their cards, so the colour
   means the same thing in both places: real, but not yet. */
.almost-ready {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.65rem 0.8rem;
  text-align: left;
  cursor: pointer;
  background: rgba(180, 105, 10, 0.08);
  border: 1px solid rgba(180, 105, 10, 0.35);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.almost-ready:hover {
  background: rgba(180, 105, 10, 0.14);
  border-color: rgba(180, 105, 10, 0.55);
}

.almost-ready-title {
  font-size: 0.82rem;
  font-weight: 700;
}

.almost-ready-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* ---- The import expert, inside a car dialog ----------------------------- */
/*
   Not a tab in the nav: a visitor reading a car should not have to leave it to
   ask about it. These rules live here rather than being shared with the
   members stylesheet, which the public page does not load.
*/

.pub-expert {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, .12));
}

.pub-expert-nudge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--accent-cyan, #35b6c9);
  border-radius: 10px;
  background: rgba(53, 182, 201, .08);
  font-size: 0.88rem;
}
.pub-expert-nudge .nudge-copy { flex: 1 1 14rem; line-height: 1.4; }
.pub-expert-nudge .nudge-copy strong { display: block; }

.pub-expert .expert-cta {
  flex: 0 0 auto;
  padding: 0.5rem 0.9rem;
  border: 1.5px solid var(--accent-cyan, #35b6c9);
  border-radius: 8px;
  background: transparent;
  color: var(--accent-cyan, #35b6c9);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}
.pub-expert .expert-cta:hover { background: rgba(53, 182, 201, .15); }
.pub-expert .expert-cta:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.pub-expert-panel { margin-top: 0.75rem; }

.pub-expert .expert-thread {
  max-height: 34vh;
  overflow-y: auto;
  padding: 0.6rem;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, .12));
  border-radius: 8px;
}
.pub-expert .expert-msg { margin: 0 0 0.75rem; font-size: 0.88rem; line-height: 1.5; }
.pub-expert .expert-msg:last-child { margin-bottom: 0; }
.pub-expert .expert-who {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: .7;
  margin-bottom: 0.15rem;
}
.pub-expert .expert-msg.is-you > div {
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: rgba(127, 127, 127, .12);
}
.pub-expert .expert-typing { opacity: .7; font-style: italic; }

.pub-expert .expert-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.6rem 0;
}
.pub-expert .expert-starters .header-btn { font-size: 0.78rem; }

.pub-expert .expert-ask { display: flex; gap: 0.5rem; align-items: flex-end; }
.pub-expert .expert-ask textarea {
  flex: 1 1 auto;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, .15));
  border-radius: 8px;
  background: rgba(127, 127, 127, .08);
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
/* 16px on touch, or iOS zooms the page when the field takes focus. */
@media (pointer: coarse) { .pub-expert .expert-ask textarea { font-size: 16px; } }

.pub-expert-caveat { margin: 0.5rem 0 0; font-size: 0.78rem; opacity: .7; }

.pub-expert .visually-hidden,
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

/* ---- Landed-cost pop-up and the buttons that open it ---- */
.landed-popup-btn { width: 100%; background: var(--bg-inset); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 0.55rem 0.7rem; cursor: pointer; font: inherit; color: var(--text-secondary); text-align: left; margin-top: 0.5rem; }
.landed-popup-btn:hover, .landed-popup-btn:focus-visible { border-color: var(--accent-emerald); }
.landed-popup-btn small { color: var(--text-muted); font-size: 0.68rem; }
.landed-popup-btn .landed-cost-val { font-size: 1.1rem; font-weight: 800; color: var(--accent-emerald); font-family: var(--font-mono); }
.landed-open-btn { margin-top: 0.5rem; width: 100%; padding: 0.55rem; border-radius: var(--radius-md); border: 1px solid var(--accent-emerald); background: transparent; color: var(--accent-emerald); font-weight: 700; cursor: pointer; }
.lp-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.lp-box { position: relative; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); width: min(30rem, 100%); max-height: 92vh; overflow: auto; padding: 1.25rem; }
.lp-close { position: absolute; top: .5rem; right: .75rem; background: none; border: 0; color: var(--text-secondary); font-size: 1.6rem; cursor: pointer; line-height: 1; }
.lp-head { font-weight: 700; padding-right: 1.5rem; }
.lp-stock { display: inline-block; font-family: var(--font-mono); font-size: .75rem; color: var(--accent-cyan); margin-left: .4rem; }
.lp-total-label { margin-top: .9rem; font-size: .78rem; color: var(--text-secondary); }
.lp-total { font-family: var(--font-mono); font-size: 2.2rem; font-weight: 800; color: var(--accent-emerald); line-height: 1.1; }
.lp-sub { font-size: .75rem; color: var(--text-muted); margin-bottom: .9rem; }
.lp-port { display: block; font-size: .78rem; color: var(--text-secondary); margin-bottom: .7rem; }
.lp-port select { display: block; width: 100%; margin-top: .25rem; padding: .45rem; background: var(--bg-inset); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.lp-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.lp-table td { padding: .35rem 0; border-bottom: 1px solid var(--border-subtle); }
.lp-val { text-align: right; font-family: var(--font-mono); white-space: nowrap; padding-left: .75rem; }
.lp-total-row td { font-weight: 800; border-bottom: 0; padding-top: .6rem; }
.lp-note { font-size: .7rem; color: var(--text-muted); margin: .7rem 0; }
.lp-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.lp-actions button { flex: 1 1 8rem; padding: .6rem; border-radius: var(--radius-md); font-weight: 700; cursor: pointer; border: 1px solid var(--border-subtle); background: var(--bg-inset); color: var(--text-primary); }
.lp-copy { border-color: var(--accent-emerald) !important; color: var(--accent-emerald) !important; }
.auction-line { font-size: .72rem; color: var(--accent-gold); margin-bottom: .2rem; letter-spacing: .02em; }
.member-badge-auction { display: inline-block; font-size: .65rem; font-weight: 800; letter-spacing: .06em; padding: .1rem .4rem; border-radius: 4px; background: var(--accent-gold); color: #000; margin-right: .35rem; }
