/**
 * Turing Dealers - dealer locator module for PrestaShop
 *
 * @author    Agence Turing <contact@turing-software.com>
 * @copyright 2026 Turing Software
 * @license   Commercial license, see LICENSE.md
 *
 * Loaded on the dealer locator page only. Colours follow the theme: --turingdealers-accent is set by dealers.js
 * from the primary button of the theme; a theme can also set it in its own CSS.
 */
.turingdealers {
  --turingdealers-accent: #333;
  --turingdealers-border: #e3e6ea;
  --turingdealers-muted: #6c757d;
  --turingdealers-surface: #f6f7f9;
}

.turingdealers-intro {
  margin-bottom: 1.25rem;
  max-width: 60rem;
}

.turingdealers-search {
  background: var(--turingdealers-surface);
  border-radius: 10px;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
}

.turingdealers-search__label {
  display: block;
  font-weight: 700;
  margin-bottom: .5rem;
}

.turingdealers-search__row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.turingdealers-search__row .form-control {
  flex: 1 1 12rem;
  max-width: 22rem;
  min-height: 2.75rem;
}

.turingdealers-search__row .btn {
  align-items: center;
  display: inline-flex;
  gap: .4rem;
  min-height: 2.75rem;
}

.turingdealers-search__help {
  color: var(--turingdealers-muted);
  font-size: .875em;
  margin: .5rem 0 0;
}

.turingdealers-status__text {
  color: var(--turingdealers-muted);
}

.turingdealers-layout--map {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 992px) {
  .turingdealers-layout--map {
    align-items: start;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }

  .turingdealers-layout--map .turingdealers-map {
    order: 2;
    position: sticky;
    top: 1rem;
  }

  .turingdealers-layout--map .turingdealers-list {
    order: 1;
  }
}

.turingdealers-map {
  background: var(--turingdealers-surface);
  border: 1px solid var(--turingdealers-border);
  border-radius: 10px;
  overflow: hidden;
}

.turingdealers-map__consent {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  justify-content: center;
  min-height: 12rem;
  padding: 1.5rem;
  text-align: center;
}

.turingdealers-map__consent p {
  color: var(--turingdealers-muted);
  font-size: .875em;
  margin: 0;
  max-width: 28rem;
}

.turingdealers-map__canvas {
  height: 320px;
  width: 100%;
}

@media (min-width: 992px) {
  .turingdealers-map__canvas {
    height: 560px;
  }
}

.turingdealers-map__forget {
  font-size: .8125em;
  padding: .25rem .75rem;
}

.turingdealers-list {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .turingdealers-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.turingdealers-layout:not(.turingdealers-layout--map) .turingdealers-list {
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}

.turingdealers-dealer {
  background: #fff;
  border: 1px solid var(--turingdealers-border);
  border-radius: 8px;
  padding: 1rem 1.125rem;
  scroll-margin-top: 1rem;
  transition: border-color .2s, box-shadow .2s;
}

.turingdealers-dealer.is-active {
  border-color: var(--turingdealers-accent);
  box-shadow: 0 0 0 1px var(--turingdealers-accent);
}

.turingdealers-dealer__header {
  align-items: baseline;
  display: flex;
  gap: .75rem;
  justify-content: space-between;
}

.turingdealers-dealer__name {
  font-size: 1.125rem;
  margin: 0 0 .375rem;
}

.turingdealers-dealer__distance {
  color: var(--turingdealers-accent);
  flex: none;
  font-weight: 700;
  white-space: nowrap;
}

.turingdealers-dealer__note {
  color: var(--turingdealers-muted);
  font-size: .875em;
  margin-bottom: .5rem;
}

.turingdealers-dealer__address {
  font-style: normal;
  margin-bottom: .5rem;
}

.turingdealers-dealer__contact {
  list-style: none;
  margin: 0 0 .5rem;
  padding: 0;
}

.turingdealers-dealer__contact a,
.turingdealers-dealer__directions {
  overflow-wrap: anywhere;
}

.turingdealers-dealer__hours summary {
  cursor: pointer;
}

.turingdealers-dealer__hours p {
  margin: .375rem 0 0;
}

.turingdealers-dealer__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
}

.turingdealers-dealer__locate {
  padding: 0;
}

/* Markers: an SVG pin in the accent colour (no image file) */
.turingdealers-pin {
  background: none;
  border: 0;
}

.turingdealers-pin svg {
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35));
}

.turingdealers-pin--origin svg {
  filter: none;
}

/* Text for screen readers only (independent of the Bootstrap version of the theme) */
.turingdealers-sr {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
