/* ============================================
   Vehicle Detail Page — Veneza Motos e Veículos
   ============================================ */

:root {
  --azul-escuro: #020617;
  --azul: #1d4ed8;
  --preto: #000000;
  --branco: #ffffff;
}

/* ===== Base =====
   body vira um flex column esticando até a altura da tela: o conteúdo
   principal (.container-fluid) cresce para preencher o espaço disponível
   e empurra o footer para o fim — sem isso, em páginas com pouco conteúdo
   o footer ficava "solto" no meio da tela e sobrava uma faixa em branco
   abaixo dele até completar os 100vh do body. */
html {
  height: 100%;
}

body {
  background:
    radial-gradient(ellipse at top left, rgba(29, 78, 216, 0.16) 0, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(29, 78, 216, 0.08) 0, transparent 55%),
    linear-gradient(160deg, #020617 0%, #0b1120 50%, #050a18 100%);
  color: #ffffff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding-bottom: 0;
}

/* ===== Animações de entrada ===== */
@media (prefers-reduced-motion: no-preference) {
  .detail-carousel,
  .detail-card {
    animation: vehicleEnter 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .detail-card {
    animation-delay: 0.12s;
  }
}

@keyframes vehicleEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container-fluid.mt-4.mb-5 {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(12px, 4vw, 24px);
  padding-right: clamp(12px, 4vw, 24px);
}

/* ===== Carousel ===== */
.detail-carousel {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.15);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(29, 78, 216, 0.12);
}

.detail-carousel img {
  height: clamp(260px, 42vw, 560px);
  object-fit: cover;
  width: 100%;
  display: block;
  border-radius: 0;
}

/* Subtle bottom gradient on carousel */
.detail-carousel .carousel-inner {
  position: relative;
}

.detail-carousel .carousel-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.4) 0%, transparent 45%);
  pointer-events: none;
  z-index: 1;
}

.carousel-control-prev,
.carousel-control-next {
  width: 15%;
  min-width: 44px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.detail-carousel:hover .carousel-control-prev,
.detail-carousel:hover .carousel-control-next,
.detail-carousel:focus-within .carousel-control-prev,
.detail-carousel:focus-within .carousel-control-next {
  opacity: 1;
}

@media (hover: none) {
  .carousel-control-prev,
  .carousel-control-next {
    opacity: 0.85;
  }
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 2.2rem;
  height: 2.2rem;
  background-color: rgba(15, 23, 42, 0.55);
  border-radius: 50%;
  padding: 8px;
  background-size: 55%;
}

/* ===== Detail Card (glassmorphism; escuro por omissão, claro via data-theme) ===== */
.detail-card {
  background: rgba(15, 23, 42, 0.62);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #e5e7eb;
  padding: clamp(18px, 3vw, 28px) clamp(16px, 2.5vw, 24px);
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.40), 0 4px 16px rgba(29, 78, 216, 0.10);
  height: fit-content;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .detail-card {
    background: rgba(11, 17, 32, 0.96);
  }
}

.detail-card h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #f8fafc;
  margin-bottom: 2px;
  word-break: break-word;
}

.detail-card .text-dark.fs-4 {
  color: #60a5fa !important;
  font-size: clamp(1.4rem, 3.2vw, 1.95rem) !important;
  font-weight: 700 !important;
  margin-bottom: 4px;
}

/* Available badge */
.detail-card::before {
  display: none;
}

/* Table */
.detail-card .table-responsive-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.detail-card .table {
  font-size: 0.92rem;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
  min-width: 260px;
  --bs-table-bg: transparent;
  --bs-table-color: #e5e7eb;
  --bs-table-striped-bg: rgba(148, 163, 184, 0.08);
  --bs-table-striped-color: #e5e7eb;
  --bs-table-border-color: rgba(148, 163, 184, 0.15);
}

.detail-card .table th {
  font-weight: 600;
  color: #cbd5e1;
  vertical-align: middle;
  white-space: nowrap;
  padding: 10px 12px;
}

.detail-card .table td {
  font-weight: 500;
  color: #e5e7eb;
  padding: 10px 12px;
  vertical-align: middle;
}

/* ícones da tabela em azul de destaque (o .text-dark do Bootstrap sumiria no vidro escuro) */
.detail-card .table svg.text-dark,
.detail-card .table [data-feather].text-dark {
  color: #60a5fa !important;
  stroke: #60a5fa;
  width: 17px;
  height: 17px;
  vertical-align: -3px;
  margin-right: 4px;
}

/* ===== CTA Buttons in detail card (desktop / tablet) ===== */
.detail-card .btn-success,
.detail-card .btn-test-drive,
.detail-card .btn-share {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px !important;
  padding: 13px 20px !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  transition: all 0.2s ease !important;
  width: 100%;
  margin-left: 0 !important;
  text-decoration: none;
}

.detail-card .btn-success {
  background: linear-gradient(135deg, #16a34a, #15803d) !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3) !important;
  margin-top: 16px !important;
}

.detail-card .btn-success:hover {
  background: linear-gradient(135deg, #15803d, #166534) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.4) !important;
  color: #ffffff !important;
}

.detail-card .btn-test-drive {
  background: transparent !important;
  color: #93c5fd !important;
  border: 2px solid #3b82f6 !important;
  font-size: 0.95rem !important;
  margin-top: 10px !important;
}

.detail-card .btn-test-drive:hover {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.3) !important;
}

.detail-card .btn-test-drive i {
  color: #93c5fd !important;
}

.detail-card .btn-test-drive:hover i {
  color: #ffffff !important;
}

.detail-card .btn-share {
  background: transparent !important;
  color: #e5e7eb !important;
  border: 1.5px solid rgba(148, 163, 184, 0.35) !important;
  font-size: 0.95rem !important;
  margin-top: 10px !important;
}

.detail-card .btn-share:hover {
  background: rgba(148, 163, 184, 0.12) !important;
  border-color: rgba(148, 163, 184, 0.6) !important;
  transform: translateY(-2px);
}

.detail-card .btn-share i {
  color: inherit !important;
}

/* Buttons row wraps side-by-side from tablet up for a tidier layout */
@media (min-width: 480px) {
  .detail-card .cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .detail-card .cta-row .btn-success,
  .detail-card .cta-row .btn-test-drive,
  .detail-card .cta-row .btn-share {
    width: auto;
    flex: 1 1 200px;
    margin-top: 0 !important;
  }

  .detail-card .cta-row {
    margin-top: 16px;
  }
}

/* ===== Footer ===== */
.site-footer {
  flex-shrink: 0;
  text-align: center;
  color: #cbd5e1;
  background-color: rgba(2, 6, 23, 0.85);
  padding: 18px 16px;
  border-top: 1px solid rgba(29, 78, 216, 0.45);
  width: 100%;
  font-size: 0.9rem;
  margin-top: 40px;
}

/* ===== Mobile Sticky CTA Bar ===== */
.vehicle-mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: rgba(2, 6, 23, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: 8px;
}

.vehicle-mobile-cta .mob-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 9px 6px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  cursor: pointer;
  line-height: 1.15;
  -webkit-tap-highlight-color: transparent;
}

.vehicle-mobile-cta .mob-btn:active {
  transform: scale(0.94);
}

.vehicle-mobile-cta .mob-btn svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.vehicle-mobile-cta .mob-btn-call {
  background: transparent;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.vehicle-mobile-cta .mob-btn-call:hover,
.vehicle-mobile-cta .mob-btn-call:active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.7);
}

.vehicle-mobile-cta .mob-btn-wa {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff;
}

.vehicle-mobile-cta .mob-btn-wa:hover,
.vehicle-mobile-cta .mob-btn-wa:active {
  background: linear-gradient(135deg, #15803d, #166534);
  color: #ffffff;
}

.vehicle-mobile-cta .mob-btn-share {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
}

.vehicle-mobile-cta .mob-btn-share:hover,
.vehicle-mobile-cta .mob-btn-share:active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
}

/* ===== Light Theme ===== */
body[data-theme="light"] {
  background:
    radial-gradient(ellipse at top left, rgba(37, 99, 235, 0.10) 0, transparent 55%),
    linear-gradient(160deg, #f4f9ff 0%, #e8eefb 60%, #f8fafc 100%);
  color: #0f172a;
}

body[data-theme="light"] .detail-card {
  background: rgba(255, 255, 255, 0.65);
  color: #0f172a;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 20px 50px rgba(29, 78, 216, 0.10), 0 2px 8px rgba(15, 23, 42, 0.06);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body[data-theme="light"] .detail-card {
    background: rgba(255, 255, 255, 0.94);
  }
}

body[data-theme="light"] .detail-card h2 {
  color: #0f172a;
}

body[data-theme="light"] .detail-card .text-dark.fs-4 {
  color: #1d4ed8 !important;
}

body[data-theme="light"] .detail-card .table {
  --bs-table-color: #1f2937;
  --bs-table-striped-bg: rgba(241, 245, 249, 0.85);
  --bs-table-striped-color: #1f2937;
  --bs-table-border-color: rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .detail-card th {
  color: #374151;
}

body[data-theme="light"] .detail-card td {
  color: #1f2937;
}

body[data-theme="light"] .detail-card .table svg.text-dark,
body[data-theme="light"] .detail-card .table [data-feather].text-dark {
  color: #1d4ed8 !important;
  stroke: #1d4ed8;
}

body[data-theme="light"] .detail-card .btn-test-drive {
  color: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}

body[data-theme="light"] .detail-card .btn-test-drive i {
  color: #1d4ed8 !important;
}

body[data-theme="light"] .detail-card .btn-test-drive:hover,
body[data-theme="light"] .detail-card .btn-test-drive:hover i {
  color: #ffffff !important;
}

body[data-theme="light"] .detail-card .btn-share {
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.25) !important;
}

body[data-theme="light"] .detail-card .btn-share:hover {
  background: rgba(15, 23, 42, 0.06) !important;
  border-color: rgba(15, 23, 42, 0.45) !important;
}

body[data-theme="light"] .detail-carousel {
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18), 0 4px 16px rgba(29, 78, 216, 0.08);
}

body[data-theme="light"] .site-footer {
  background: #0f172a;
  color: #e5e7eb;
}

/* ===== Focus visibility (accessibility) ===== */
.detail-card a:focus-visible,
.detail-card button:focus-visible,
.vehicle-mobile-cta a:focus-visible,
.vehicle-mobile-cta button:focus-visible,
.vehicle-fs-btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
}

/* ===== Responsive ===== */
@media (max-width: 767px) {
  body {
    padding-bottom: 82px;
  }

  .vehicle-mobile-cta {
    display: flex;
  }

  /* Hide inline CTA buttons on mobile — handled by the bottom bar */
  .detail-card .cta-row {
    display: none;
  }

  .detail-card {
    padding: 18px 16px 20px;
  }

  .detail-card h2 {
    font-size: 1.25rem;
  }

  .site-footer {
    margin-top: 20px;
  }
}

@media (max-width: 380px) {
  .vehicle-mobile-cta .mob-btn {
    font-size: 0.66rem;
    padding: 8px 4px;
  }

  .vehicle-mobile-cta .mob-btn svg {
    width: 17px;
    height: 17px;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .detail-carousel img {
    height: clamp(320px, 46vw, 460px);
  }
}
