/* ==========================================================
   GAC Dealer Locator 2.0
   Isolado da implementação atual de #mapa-de-concessionarios
   ========================================================== */

#dealer-locator-v2-page {
  width: 100%;
}
#dealer-locator-v2 {
  --dealer-v2-red: #d71920;
  --dealer-v2-dark: #061522;
  --dealer-v2-panel: rgba(6, 21, 34, 0.92);
  --dealer-v2-border: rgba(255, 255, 255, 0.15);
  position: relative;
  width: 100%;
  min-height: 720px;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #d8e8ef;
}
#dealer-locator-v2-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
#dealer-locator-v2 .leaflet-container {
  font-family: var(--font);
  background: #d8e8ef;
}
#dealer-locator-v2 .leaflet-tile-pane {
  filter: saturate(1.22) contrast(1.06) brightness(0.98);
}
#dealer-locator-v2 .leaflet-control-zoom {
  border: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
#dealer-locator-v2 .leaflet-control-zoom a {
  color: var(--black);
  border: none;
}
.dealer-v2-map-gradient {
  position: absolute;
  inset: 0 auto 0 0;
  width: min(670px, 52vw);
  z-index: 400;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(4, 16, 27, 0.98) 0%,
    rgba(4, 16, 27, 0.94) 58%,
    rgba(4, 16, 27, 0.62) 78%,
    rgba(4, 16, 27, 0) 100%
  );
}
.dealer-v2-sidebar {
  position: absolute;
  z-index: 900;
  top: 90px;
  bottom: 0;
  left: max(24px, calc((100vw - var(--limit)) / 2 + 24px));
  width: min(475px, calc(100vw - 48px));
  display: flex;
  flex-direction: column;
  padding: 28px 0 26px;
  color: var(--white);
}
.dealer-v2-sidebar-header {
  flex: 0 0 auto;
  padding-right: 8px;
}
.dealer-v2-sidebar h2 {
  margin: 0 0 20px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.15;
  color: var(--white);
}
.dealer-v2-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}
.dealer-v2-search {
  position: relative;
}
.dealer-v2-search input {
  width: 100%;
  height: 46px;
  padding: 0 48px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 5px;
  outline: none;
  background: rgba(7, 23, 37, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font);
  font-weight: 400;
  font-size: 13px;
  color: var(--white);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.dealer-v2-search input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}
.dealer-v2-search input:focus {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(7, 23, 37, 0.88);
}
.dealer-v2-search button {
  position: absolute;
  top: 0;
  right: 0;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
}
.dealer-v2-search button svg,
.dealer-v2-nearest svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dealer-v2-nearest {
  min-width: 46px;
  height: 46px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 5px;
  background: rgba(7, 23, 37, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: var(--white);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.dealer-v2-nearest:hover {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(7, 23, 37, 0.9);
}
.dealer-v2-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.dealer-v2-filter {
  min-height: 36px;
  padding: 7px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(5, 18, 30, 0.55);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: var(--white);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.dealer-v2-filter img {
  width: 17px;
  height: 17px;
  filter: brightness(0) invert(1);
}

.dealer-v2-filter small {
  font-size: 10px;
  line-height: 1;
  opacity: 0.62;
}

.dealer-v2-filter:hover {
  border-color: rgba(255, 255, 255, 0.7);
}

.dealer-v2-filter.active {
  background: var(--white);
  border-color: var(--white);
  color: var(--black);
}

.dealer-v2-filter.active img {
  filter: brightness(0);
}

.dealer-v2-list {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 20px;
  padding: 0 8px 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.5) rgba(255, 255, 255, 0.08);
}

.dealer-v2-list::-webkit-scrollbar {
  width: 5px;
}

.dealer-v2-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
}

.dealer-v2-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.45);
  border-radius: 999px;
}

.dealer-v2-card {
  position: relative;
  flex: 0 0 auto;
  padding-right: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: stretch;
  min-height: 116px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 7px;
  background: rgba(3, 17, 29, 0.54);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  transition: border-color 0.22s ease, background-color 0.22s ease, transform 0.22s ease;
}

.dealer-v2-card:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(3, 17, 29, 0.72);
}

.dealer-v2-card.active {
  border-color: var(--dealer-v2-red);
  background: rgba(7, 27, 43, 0.9);
  box-shadow: inset 3px 0 0 var(--dealer-v2-red);
}

.dealer-v2-card[hidden] {
  display: none !important;
}

.dealer-v2-card-main {
  min-width: 0;
  width: 100%;
  padding: 15px 8px 15px 14px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.dealer-v2-card-main:focus-visible,
.dealer-v2-card-directions:focus-visible,
.dealer-v2-filter:focus-visible,
.dealer-v2-nearest:focus-visible,
.dealer-v2-search button:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: -3px;
}

.dealer-v2-card-pin {
  width: 23px;
  height: 23px;
  color: rgba(255, 255, 255, 0.88);
}

.dealer-v2-card-pin svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.dealer-v2-card.active .dealer-v2-card-pin {
  color: var(--dealer-v2-red);
}

.dealer-v2-card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dealer-v2-card-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.dealer-v2-card-topline strong {
  min-width: 0;
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
  line-height: 19px;
  color: var(--white);
}

.dealer-v2-card-distance {
  flex: 0 0 auto;
  margin-left: auto;
  font-family: var(--font);
  font-weight: 500;
  font-size: 11px;
  line-height: 18px;
  color: rgba(255, 255, 255, 0.78);
}

.dealer-v2-services {
  min-height: 20px;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dealer-v2-service {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dealer-v2-service img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.dealer-v2-card-address {
  display: block;
  margin-top: 5px;
  padding-right: 14px;
  font-family: var(--font);
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  color: rgba(255, 255, 255, 0.7);
}

/* Contactos independentes do botão que centra o concessionário no mapa. */
.dealer-v2-card-main {
  grid-column: 1;
  grid-row: 1;
}
.dealer-v2-card-directions {
  grid-column: 2;
  grid-row: 1;
}
.dealer-v2-card-contacts {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  gap: 4px;
  padding: 0 14px 14px 48px;
  min-width: 0;
}
.dealer-v2-card-contacts a {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-family: var(--font);
  font-size: 12px;
  line-height: 17px;
  color: var(--white);
  text-decoration: none;
  opacity: 0.88;
}
.dealer-v2-card-contacts a:hover,
.dealer-v2-card-contacts a:focus-visible {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dealer-v2-card-contacts a span {
  font-weight: 700;
  margin-right: 4px;
}

.dealer-v2-card-directions {
  width: 42px;
  height: 42px;
  align-self: center;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.11);
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.dealer-v2-card-directions:hover {
  background: var(--dealer-v2-red);
  transform: translateY(-1px);
}

.dealer-v2-card-directions img {
  width: 18px;
  height: 18px;
}

.dealer-v2-note {
  flex: 0 0 auto;
  margin-top: 12px;
  padding-right: 12px;
  font-family: var(--font);
  font-size: 10px;
  line-height: 14px;
  color: rgba(255, 255, 255, 0.58);
}

.dealer-v2-note p {
  margin: 0;
}

.dealer-v2-detail {
  position: absolute;
  z-index: 920;
  top: 120px;
  right: max(32px, calc((100vw - var(--limit)) / 2 + 32px));
  width: min(370px, calc(100vw - 64px));
  padding: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.18);
  color: var(--black);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.24s ease, visibility 0.24s ease, transform 0.24s ease;
}

.dealer-v2-detail.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dealer-v2-detail-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  font-family: Arial, sans-serif;
  font-size: 27px;
  line-height: 1;
  color: var(--black);
  cursor: pointer;
}

.dealer-v2-detail-head {
  padding-right: 34px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5e5e5;
}

.dealer-v2-detail-head h3 {
  margin: 0;
  font-family: var(--font);
  font-weight: 700;
  font-size: 21px;
  line-height: 27px;
  color: var(--black);
}

.dealer-v2-detail-services {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.dealer-v2-detail-service {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: #f0f1f2;
}

.dealer-v2-detail-service[hidden] {
  display: none;
}

.dealer-v2-detail-service img {
  width: 20px;
  height: 20px;
}

.dealer-v2-detail-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 0;
}

.dealer-v2-detail-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  color: var(--black);
  text-decoration: none;
}

.dealer-v2-detail-row[hidden] {
  display: none;
}

.dealer-v2-detail-row svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dealer-v2-detail-row[href]:hover span {
  text-decoration: underline;
}

.dealer-v2-detail-directions {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dealer-v2-detail-directions[hidden] {
  display: none;
}

.dealer-v2-detail-directions img {
  filter: none;
}

.dealer-v2-empty {
  position: absolute;
  z-index: 930;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 5px;
  background: rgba(6, 21, 34, 0.9);
  font-family: var(--font);
  font-size: 12px;
  color: var(--white);
}

.dealer-v2-setup-error {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px var(--side-margin);
  text-align: center;
}

.dealer-v2-setup-error h2 {
  margin: 0 0 12px;
  font-family: var(--font);
  font-size: 30px;
}

.dealer-v2-setup-error p {
  max-width: 620px;
  margin: 0 auto 8px;
  font-family: var(--font);
  line-height: 1.5;
}

@media (max-width: 1180px) {
  #dealer-locator-v2 {
    min-height: 720px;
  }

  .dealer-v2-sidebar {
    left: 24px;
    width: 410px;
  }

  .dealer-v2-map-gradient {
    width: 550px;
  }

  .dealer-v2-detail {
    right: 24px;
    width: 340px;
  }
}

@media (max-width: 900px) {
  #dealer-locator-v2 {
    min-height: 720px;
  }

  .dealer-v2-sidebar {
    width: 365px;
    padding-top: 24px;
  }

  .dealer-v2-sidebar h2 {
    font-size: 23px;
  }

  .dealer-v2-search-row {
    grid-template-columns: 1fr;
  }

  .dealer-v2-nearest {
    width: fit-content;
    min-width: 0;
  }

  .dealer-v2-map-gradient {
    width: 490px;
  }

  .dealer-v2-detail {
    width: 320px;
  }
}

@media (max-width: 767px) {
  #dealer-locator-v2 {
    min-height: 700px;
    height: 100svh;
    max-height: 900px;
  }

  #dealer-locator-v2 .leaflet-control-zoom {
    margin-bottom: 16px;
    margin-right: 12px;
  }

  .dealer-v2-map-gradient {
    display: none;
  }

  .dealer-v2-sidebar {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    height: 48%;
    min-height: 350px;
    padding: 18px 14px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(5, 18, 30, 0.92);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .dealer-v2-sidebar h2 {
    display: none;
  }

  .dealer-v2-search-row {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
  }

  .dealer-v2-nearest {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }

  .dealer-v2-nearest span {
    display: none;
  }

  .dealer-v2-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .dealer-v2-filter {
    flex: 0 0 auto;
  }

  .dealer-v2-list {
    margin-top: 12px;
  }

  .dealer-v2-card {
    min-height: 104px;
  }

  .dealer-v2-card-main {
    padding: 12px 7px 12px 11px;
  }

  .dealer-v2-note {
    display: none;
  }

  .dealer-v2-detail {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: calc(100% - 24px);
    overflow-y: auto;
    padding: 22px;
    border-radius: 12px;
  }

  #dealer-locator-v2.has-detail .dealer-v2-sidebar {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .dealer-v2-detail-head h3 {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  #dealer-locator-v2 {
    min-height: 700px;
  }

  .dealer-v2-sidebar {
    min-height: 330px;
    height: 50%;
  }

  .dealer-v2-filter {
    padding: 7px 11px;
  }

  .dealer-v2-card-topline strong {
    font-size: 14px;
  }

  .dealer-v2-card-address {
    font-size: 11px;
    line-height: 15px;
  }
}
