/* ============================================================
   1. GERAL, RESET E CONFIGURAÇÕES BASE
   ============================================================ */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #F8F8F8;
}

/* ============================================================
   2. DASHBOARD E ADMIN (PREVIEW DE IMAGENS)
   ============================================================ */
.preview-box {
  width: 120px;
  height: 120px;
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  border: 2px solid #ddd;
  overflow: visible;
  transition: all 0.2s ease;
  padding: 4px;
  background: #fff;
}

.preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.preview-box.selected {
  border-color: #198754;
  border-width: 3px;
  box-shadow: 0 0 10px rgba(25, 135, 84, 0.5);
}

.badge-principal {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.badge-principal .badge {
  padding: 5px 10px;
  font-size: 0.75rem;
  border-radius: 20px;
}

.btn-remove-atual,
.btn-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 24px;
  height: 24px;
  padding: 0;
  line-height: 22px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: bold;
  z-index: 11;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease-in-out;
}

.preview-box:hover .btn-remove-atual,
.preview-box:hover .btn-remove {
  opacity: 1;
  visibility: visible;
}

/* ============================================================
   3. ELEMENTOS DE LAYOUT (DIVISORES E COLUNAS)
   ============================================================ */
.section-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 2rem 0;
}

.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d1d5db;
}

.section-divider span {
  padding: 0 20px;
  color: #1a1a3a;
  font-size: 1.7rem;
  font-weight: bold;
  text-transform: none;
}

/* Regra para 5 colunas em monitores grandes */
@media (min-width: 1200px) {
  .col-xl-2dot4 {
    flex: 0 0 20%;
    max-width: 20%;
  }
}

/* ============================================================
   4. CATÁLOGO DE VEÍCULOS (CARDS)
   ============================================================ */
#catalogo {
  background-color: #F8F8F8 !important;
}

#catalogo .card {
  background-color: #ffffff !important;
  border: 1px solid #eee !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03) !important;
  transition: transform 0.2s ease;
  overflow: hidden;
}

#catalogo .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08) !important;
  border: 1px solid #A2001D !important;
}

.card-img-container {
  height: 160px;
  padding: 15px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

#catalogo .card-img-top {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  object-position: center center !important;
}

#catalogo .card-body {
  padding: 15px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#catalogo .card-title {
  font-size: 0.9rem !important;
  font-weight: 800 !important;
  margin-bottom: 8px !important;
  color: #1a1a3a;
  min-height: 2em;
}

.card-info {
  font-size: 0.75rem;
  color: #777;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 5px;
  width: 100%;
}

.card-footer-custom {
  border-top: 1px solid #f1f1f1;
  padding-top: 10px;
  margin-top: auto;
  width: 100%;
}

#catalogo .stretched-link {
  font-size: 0.75rem;
  color: #A2001D !important;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.5px;
}

.card-price-container {
  border-top: 1px solid #f1f1f1;
  padding: 4px 0;
}

/* ============================================================
   5. DETALHES DO PRODUTO (VIEWPORT E GALERIA VERTICAL)
   ============================================================ */
.gallery-vertical-wrapper {
  width: 100px;
  height: 400px;
}

.gallery-vertical-scroll {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
  padding-right: 5px;
}

.gallery-vertical-scroll::-webkit-scrollbar {
  display: none;
}

.thumb-item-vertical {
  width: 85px !important;
  height: 65px !important;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid #eee;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.thumb-item-vertical:hover {
  border-color: #ddd;
}

/* No style.css - Seção 5: Substituir estas duas classes */
.main-image-viewport-small {
  width: 100%;
  height: 400px;
  background-color: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: zoom-in;
  /* Indica que pode interagir */
}

.img-main {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  transition: transform 0.1s ease-out;
  /* Remova o transition se sentir o 'pan' pesado */
  transform-origin: center center;
  position: relative;
  user-select: none;
  /* Impede de "arrastar" a imagem como arquivo */
  -webkit-user-drag: none;
}

.active-thumb {
  border-color: #A2001D !important;
  box-shadow: 0 0 8px rgba(162, 0, 29, 0.4);
  transform: scale(1.05);
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
}

.no-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f0f0f0;
  color: #999;
}

.zoom-instruction-overlay {
  position: absolute !important;
  /* Força a flutuação sobre a imagem */
  top: 15px;
  left: 15px;
  z-index: 100;
  /* Garante que fique na frente da imagem */
  background: rgba(255, 255, 255, 0.85);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.72rem;
  color: #444;
  pointer-events: none;
  /* Mouse ignora o texto e foca na imagem */
  border: 1px solid rgba(162, 0, 29, 0.15);
  display: flex;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  /* Impede o texto de quebrar linha e ficar espremido */
}

.zoom-instruction-overlay i {
  color: #A2001D;
  /* Vermelho da M3 Veículos */
  font-size: 0.85rem;
}

/* ============================================================
   6. FOOTER E NEWSLETTER
   ============================================================ */
.btn-danger-custom {
  background-color: #ff4d4d !important;
  border: none;
  color: white !important;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.btn-danger-custom:hover {
  background-color: #e60000 !important;
}

.newsletter-input {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid #ced4da !important;
  color: #333 !important;
}

.newsletter-input:focus {
  background-color: #fff !important;
  box-shadow: 0 0 0 0.25rem rgba(255, 77, 77, 0.25) !important;
}

.newsletter-section .input-group {
  max-width: 500px;
  margin: 0 auto;
}

.footer-link {
  color: rgba(255, 255, 255, 0.6) !important;
  text-decoration: none;
  transition: color 0.3s ease, padding-left 0.3s ease;
  font-size: 0.9rem;
}

.footer-link:hover {
  color: #A2001D !important;
  padding-left: 5px;
}

.footer-title {
  font-size: 1rem;
  letter-spacing: 2px;
  color: #fff;
  border-bottom: 2px solid #A2001D;
  display: inline-block;
  padding-bottom: 5px;
}

.social-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: #fff;
  font-size: 1.2rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-icon-box:hover {
  background: #A2001D;
  color: white;
  transform: translateY(-3px);
}

/* ============================================================
   7. MEDIA QUERIES (RESPONSIVIDADE)
   ============================================================ */
@media (max-width: 768px) {
  .gallery-vertical-wrapper {
    display: none !important;
  }

  .main-image-viewport-small {
    height: 300px;
  }
}

@media (max-width: 991px) {
  .footer-title {
    border-bottom: none;
    margin-bottom: 1.5rem !important;
  }

  .footer-title::after {
    content: "";
    display: block;
    width: 30px;
    height: 2px;
    background: #A2001D;
    margin: 8px auto 0;
  }
}