/* ============================================================
   DEALER LOCATOR STYLES
   ============================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f9f9f9;
  color: #333333;
  padding: 30px 15px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#dealer-locator {
  max-width: 1200px;
  margin: 0 auto;
  padding: 35px 30px 45px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.dealer-header {
  text-align: center;
  margin-bottom: 35px;
}

.dealer-header h2 {
  color: #222222;
  margin-bottom: 24px;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Search Bar */
.search-container {
  max-width: 520px;
  margin: 0 auto 28px auto;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon-left {
  position: absolute;
  left: 18px;
  width: 20px;
  height: 20px;
  fill: #888888;
  pointer-events: none;
  transition: fill 0.2s ease;
}

.search-input {
  width: 100%;
  padding: 15px 46px 15px 48px;
  font-size: 16px;
  font-family: inherit;
  border: 2px solid #ddd;
  border-radius: 30px;
  outline: none;
  background-color: #ffffff;
  transition: all 0.3s ease;
  box-sizing: border-box;
  color: #333;
}

.search-input::placeholder {
  color: #999;
}

.search-input:focus {
  border-color: #ed1b24;
  box-shadow: 0 4px 14px rgba(237, 27, 36, 0.12);
}

.search-input:focus ~ .search-icon-left {
  fill: #ed1b24;
}

.clear-search-btn {
  display: none;
  position: absolute;
  right: 16px;
  background: #eee;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 13px;
  font-weight: bold;
  transition: all 0.2s ease;
}

.clear-search-btn:hover {
  background-color: #ddd;
  color: #111;
}

/* Tabs Styling */
.tabs-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 35px;
}

.tab-btn {
  background-color: #ffffff;
  color: #555555;
  border: 2px solid #ddd;
  padding: 9px 20px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.tab-btn:hover {
  border-color: #ed1b24;
  color: #ed1b24;
  transform: translateY(-1px);
}

.tab-btn.active {
  background-color: #ed1b24;
  color: #ffffff;
  border-color: #ed1b24;
  box-shadow: 0 4px 12px rgba(237, 27, 36, 0.22);
}

/* City Group Styling */
.city-section {
  margin-bottom: 50px;
  animation: fadeIn 0.4s ease forwards;
}

.city-title {
  font-size: 1.55rem;
  color: #222222;
  margin-bottom: 22px;
  padding-bottom: 8px;
  border-bottom: 3px solid #ed1b24;
  display: inline-block;
  font-weight: 700;
}

.dealer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
}

/* Dealer Card */
.dealer-card {
  background: #ffffff;
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #f0f0f0;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border-top: 4px solid #ed1b24;
  display: flex;
  flex-direction: column;
}

.dealer-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 30px rgba(237, 27, 36, 0.15);
  z-index: 2;
}

.dealer-name {
  font-size: 1.25rem;
  font-weight: bold;
  color: #222222;
  margin: 0 0 12px 0;
  line-height: 1.35;
}

.dealer-details {
  margin-bottom: 18px;
  flex-grow: 1;
}

.dealer-details p {
  margin: 8px 0;
  color: #555555;
  font-size: 0.95rem;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
}

.dealer-details strong {
  color: #333333;
  margin-right: 6px;
  min-width: 70px;
}

.contact-link {
  color: #555555;
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-link:hover {
  color: #ed1b24;
  text-decoration: underline;
}

/* Map Button */
.map-btn {
  margin-top: auto;
  padding-top: 14px;
}

.map-link {
  display: inline-flex;
  align-items: center;
  background-color: #fde8e9;
  color: #ed1b24;
  padding: 10px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  word-break: break-word;
}

.map-link:hover {
  background-color: #fad1d3;
  color: #ba141b;
}

.map-icon {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  fill: currentColor;
  flex-shrink: 0;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 50px 20px;
  font-size: 1.1rem;
  color: #777777;
  background: #fdfdfd;
  border-radius: 8px;
  border: 1px dashed #ddd;
}

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

/* Mobile Responsive */
@media (max-width: 600px) {
  body {
    padding: 12px 8px;
  }

  #dealer-locator {
    padding: 20px 15px;
    border-radius: 8px;
  }

  .dealer-header h2 {
    font-size: 1.6rem;
    margin-bottom: 18px;
  }

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

  .tabs-container {
    gap: 8px;
    margin-bottom: 25px;
  }

  .tab-btn {
    padding: 7px 15px;
    font-size: 0.85rem;
  }

  .dealer-card {
    padding: 20px;
  }
}
