/* ============================================================
   GEWA Germany -- DEALERS PAGE
   dealers.css (dealers.html.twig, dealer modal, search, list)
   ============================================================ */

/* ═══════════════════════════════════
   DEALERS — country grid (replaces Bootstrap-driven default/handler.html.twig)
   Multi-dealer countries link straight to /dealers/{code}; single-distributor
   countries (customerArray|length == 1, same rule as Hannes's original
   template) open a custom modal instead of a Bootstrap modal.
═══════════════════════════════════ */
.dealers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0;
  border-top: 0.5px solid var(--w06);
  border-left: 0.5px solid var(--w06);
}
.dealer-tile {
  position: relative;
  display: block;
  padding: 28px 24px 24px;
  border-right: 0.5px solid var(--w06);
  border-bottom: 0.5px solid var(--w06);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border-top: none; border-left: none;
  width: 100%; text-align: left;
  font-family: inherit; color: inherit;
  transition: background 0.2s;
}
.dealer-tile:hover { background: rgba(201,168,76,0.04); }
.dealer-tile-shape {
  width: 100%; height: 110px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.dealer-tile-shape img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  filter: grayscale(1) brightness(1.6) opacity(0.5);
  transition: filter 0.25s ease;
}
.dealer-tile:hover .dealer-tile-shape img { filter: grayscale(0) brightness(1) opacity(1); }
.dealer-tile-name {
  font-size: 18px; color: var(--cream); margin-bottom: 6px;
}
.dealer-tile-hint {
  font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--w45); display: flex; align-items: center; gap: 6px;
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s, color 0.2s;
}
.dealer-tile:hover .dealer-tile-hint { opacity: 1; transform: translateY(0); color: var(--gold); }
.dealer-tile-hint svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s; }
.dealer-tile:hover .dealer-tile-hint svg { transform: translateX(3px); }

/* ═══════════════════════════════════
   DEALER MODAL — custom, replaces Bootstrap's .modal/.modal-dialog
═══════════════════════════════════ */
.dealer-modal-backdrop {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  pointer-events: none;
  transition: background 0.25s ease;
}
.dealer-modal-backdrop.open { background: rgba(0,0,0,0.7); pointer-events: all; }
.dealer-modal {
  width: 100%; max-width: 480px;
  background: var(--ink-mid);
  border: 0.5px solid var(--w10);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  padding: 40px;
  transform: translateY(16px) scale(0.98); opacity: 0;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), opacity 0.25s;
}
.dealer-modal-backdrop.open .dealer-modal { transform: translateY(0) scale(1); opacity: 1; }
.dealer-modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--w45); transition: color 0.2s;
}
.dealer-modal-close:hover { color: var(--gold); }
.dealer-modal-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.dealer-modal { position: relative; }
.dealer-modal-eyebrow {
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 10px;
}
.dealer-modal-title {
  font-family: var(--font-serif); font-size: 28px; font-weight: 300;
  color: var(--cream); margin-bottom: 6px; line-height: 1.2;
}
.dealer-modal-subtext { font-size: 16px; color: var(--w65); margin-bottom: 28px; line-height: 1.6; }
.dealer-modal-row {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 14px 0; border-top: 0.5px solid var(--w06);
}
.dealer-modal-row:first-of-type { border-top: none; }
.dealer-modal-row svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dealer-modal-row-label { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--w45); margin-bottom: 4px; }
.dealer-modal-row-value { font-size: 16px; color: var(--w55); line-height: 1.5; }
.dealer-modal-row-value a { color: var(--w55); text-decoration: none; border-bottom: 0.5px solid var(--w20); transition: color 0.2s, border-color 0.2s; }
.dealer-modal-row-value a:hover { color: var(--gold-light); border-color: var(--gold-dim); }

/* ═══════════════════════════════════
   DEALER SEARCH (zip/city + radius, "near me")
═══════════════════════════════════ */
.dealer-search-bar {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 24px 0;
  border-bottom: 0.5px solid var(--w06);
}
.dealer-search-input {
  flex: 1; min-width: 220px;
  background: none; border: 0.5px solid var(--w10);
  padding: 13px 16px; font-size: 14px; color: var(--cream);
  font-family: inherit; outline: none;
  transition: border-color 0.2s;
}
.dealer-search-input::placeholder { color: var(--w40); }
.dealer-search-input:focus { border-color: var(--gold-dim); }
.dealer-search-radius {
  background: none; border: 0.5px solid var(--w10);
  padding: 13px 16px; font-size: 13px; color: var(--w55);
  font-family: inherit; cursor: pointer;
}
.dealer-search-submit {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink); background: var(--gold); border: none;
  padding: 0 28px; cursor: pointer; font-weight: 600;
  transition: background 0.2s;
}
.dealer-search-submit:hover { background: var(--gold-light); }
.dealer-search-error {
  font-size: 13px; color: var(--gold-light); margin-top: 10px;
  display: none;
}
.dealer-search-error.visible { display: block; }

/* ═══════════════════════════════════
   DEALER LIST (per-country results, replaces dealersSection/_dealerCol)
═══════════════════════════════════ */
.dealer-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin-top: 0; }
.dealer-card {
  padding: 32px; border-right: 0.5px solid var(--w06); border-bottom: 0.5px solid var(--w06);
}
.dealer-card-name { font-size: 20px; color: var(--cream); margin-bottom: 14px; }
.dealer-card-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.dealer-card-text { font-size: 16px; color: var(--w65); line-height: 1.7; }
.dealer-card-text a { color: var(--w55); text-decoration: none; border-bottom: 0.5px solid var(--w20); transition: color 0.2s, border-color 0.2s; }
.dealer-card-text a:hover { color: var(--gold-light); border-color: var(--gold-dim); }

/* loading skeleton while the AJAX search request is in flight */
.dealer-list.loading { opacity: 0.4; pointer-events: none; transition: opacity 0.2s; }

@media (max-width: 760px) {
  .dealer-list { grid-template-columns: 1fr; }
  .dealer-card-cols { grid-template-columns: 1fr; gap: 10px; }
  .dealer-search-bar { flex-direction: column; }
  .dealer-search-submit { padding: 13px 16px; }
}