:root {
  --brand-blue: #004a8f;
  --brand-red: #e70033;
  --brand-white: #ffffff;
  --text-default: #272833;
  --surface-light: #f8faff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--surface-light, #f8faff);
  color: var(--text-default, #272833);
  font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Contenedores principales */
.dealer-locator-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.dealer-locator-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.dealer-locator-title {
  font-size: clamp(1.875rem, 2.5vw + 1.5rem, 2.75rem);
  font-weight: 900;
  color: var(--brand-blue, #004a8f);
  margin: 0 0 1rem 0;
  line-height: 1.2;
}

.dealer-locator-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2.5rem;
  padding: 0 1rem;
}

/* Controles */
.state-selector-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 400px;
}

.state-select-label {
  font-weight: 600;
  color: var(--text-default, #272833);
  font-size: 1rem;
  text-align: left;
}

.state-select {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 2px solid rgba(0, 74, 143, 0.25);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #ffffff;
  color: var(--text-default, #272833);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23004a8f' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px;
  padding-right: 3rem;
}

.state-select:focus {
  outline: none;
  border-color: var(--brand-blue, #004a8f);
  box-shadow: 0 0 0 3px rgba(0, 74, 143, 0.15);
}

.use-location-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background-color: var(--brand-blue, #004a8f);
  color: var(--brand-white, #ffffff);
  padding: 1rem 2.25rem;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  text-transform: none;
  letter-spacing: 0.02em;
  min-width: 220px;
  font-family: inherit;
}

.use-location-btn:hover:not(:disabled) {
  background-color: #00386a;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 74, 143, 0.3);
}

.use-location-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(0, 74, 143, 0.25);
}

.use-location-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Indicadores */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: clamp(2.5rem, 3vw + 2rem, 4rem);
  min-height: 200px;
}

.loading-spinner {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.loading-spinner::before,
.loading-spinner::after {
  content: '';
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--brand-blue, #004a8f);
  animation: loaderDots 0.8s infinite alternate;
}

.loading-spinner::after {
  animation-delay: 0.2s;
}

.loading-text {
  color: rgba(17, 32, 62, 0.75);
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
}

.error-message {
  padding: clamp(2rem, 3vw + 1.5rem, 3rem);
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  border: 1px dashed rgba(231, 0, 51, 0.3);
  color: rgba(168, 24, 52, 0.9);
  max-width: 640px;
  margin: 0 auto;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1.6;
}

/* Tarjetas de dealers */
.dealers-container {
  margin-top: 2.5rem;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.dealer-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 74, 143, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dealer-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 74, 143, 0.15);
}

.dealer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.dealer-card-body {
  flex: 1;
  margin-bottom: 1.5rem;
}

.dealer-name {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--brand-blue, #004a8f);
  margin: 0;
  line-height: 1.3;
  flex: 1;
  min-width: 200px;
}

.dealer-distance {
  background: rgba(0, 74, 143, 0.1);
  color: var(--brand-blue, #004a8f);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.dealer-info {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.dealer-address,
.dealer-city,
.dealer-state {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(17, 32, 62, 0.85);
}

.info-label {
  color: var(--text-default, #272833);
  font-weight: 600;
  display: inline-block;
  min-width: 80px;
}

.dealer-map-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background-color: var(--brand-blue, #004a8f);
  color: var(--brand-white, #ffffff);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  margin-top: 1.25rem;
  border-top: 1px solid rgba(0, 74, 143, 0.1);
  padding-top: 1.5rem;
}

.dealer-map-link:hover {
  background-color: #00386a;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 74, 143, 0.25);
  text-decoration: none;
}

.dealer-map-link:active {
  transform: translateY(0);
}

.no-dealers-message {
  padding: clamp(2.5rem, 3vw + 2rem, 3.5rem);
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  border: 1px dashed rgba(0, 74, 143, 0.2);
  color: rgba(17, 32, 62, 0.7);
  max-width: 640px;
  margin: 2rem auto 0;
  font-size: clamp(0.95rem, 0.8vw + 0.85rem, 1.05rem);
  line-height: 1.6;
}

/* Animaciones */
@keyframes loaderDots {
  from {
    transform: translateY(0px);
    opacity: 0.5;
  }
  to {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .dealer-locator-container {
    padding: 1.5rem 1rem;
  }

  .dealers-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .dealer-card {
    padding: 1.5rem;
  }

  .dealer-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dealer-name {
    min-width: auto;
    width: 100%;
  }

  .dealer-distance {
    align-self: flex-start;
  }

  .state-selector-wrapper {
    max-width: 100%;
  }

  .dealer-locator-controls {
    padding: 0 0.5rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .dealers-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

