/**
 * Coverage Component - Estilos autocontenidos
 * Estos estilos funcionan independientemente de main.css
 */

/* ========================================
   MODAL CENTRADO DE COBERTURA
   ======================================== */

/* Overlay oscuro de fondo con blur */
.coverage-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.coverage-modal-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

/* Contenedor del modal - más grande y mejor centrado */
.coverage-modal-container {
  background: white;
  border-radius: 16px;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  margin: auto;
}

.coverage-modal-overlay[aria-hidden="false"] .coverage-modal-container {
  transform: scale(1);
}

/* Header del modal - más compacto */
.coverage-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  border-bottom: 1px solid #e5e5e5;
}

.coverage-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.2;
}

.coverage-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  line-height: 1;
}

.coverage-modal-close:hover {
  background: #f5f5f5;
  color: #1a1a1a;
}

/* Body del modal - más compacto */
.coverage-modal-body {
  padding: 8px 20px 10px 20px;
}

/* Aviso de ubicación - más compacto */
.coverage-location-notice {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 5px 8px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  margin-bottom: 4px;
}

.coverage-location-notice[hidden] {
  display: none;
}

.coverage-location-notice svg {
  flex-shrink: 0;
  color: #856404;
  margin-top: 1px;
  width: 16px;
  height: 16px;
}

.coverage-location-notice p {
  margin: 0;
  color: #856404;
  font-size: 0.8rem;
  line-height: 1.3;
}

/* Input de búsqueda - más compacto */
.coverage-search-wrapper {
  margin-bottom: 2px;
}

.coverage-input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  transition: all 0.3s ease;
  margin-bottom: 0;
}

.coverage-input-group:focus-within {
  border-color: rgb(151, 230, 144);
  box-shadow: 0 4px 12px rgba(151, 230, 144, 0.2);
}

.coverage-address-input {
  flex: 1;
  width: 100%;
  padding: 8px 50px 8px 44px;
  font-size: 0.875rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.coverage-address-input:focus {
  outline: none;
}

.coverage-address-input::placeholder {
  color: #999;
}

/* Contenedor del mapa - más grande */
.coverage-map-wrapper {
  margin: 2px 0 8px 0;
  padding: 0 !important;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  animation: slideDown 0.4s ease-out;
  line-height: 0;
  font-size: 0;
}

.coverage-map-wrapper[hidden] {
  display: none;
}

.coverage-map-container {
  width: 100%;
  height: 480px;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
}

.coverage-map {
  width: 100%;
  height: 100%;
  padding: 0 !important;
  margin: 0 !important;
  display: block;
  flex-shrink: 0;
}

/* Eliminar cualquier espacio de los hijos de Google Maps */
.coverage-map > * {
  padding: 0 !important;
  margin: 0 !important;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Botón verificar cobertura */
.coverage-verify-btn {
  width: auto;
  padding: 8px 24px;
  font-size: 0.875rem;
  font-weight: 600;
  background: rgb(151, 230, 144);
  color: #1a1a1a;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: block;
  margin: 0 auto;
}

.coverage-verify-btn:hover:not(:disabled) {
  background: rgb(135, 210, 128);
}

.coverage-verify-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 767px) {
  .coverage-modal-header {
    padding: 20px 24px;
  }

  .coverage-modal-title {
    font-size: 1.5rem;
  }

  .coverage-modal-body {
    padding: 24px;
  }

  .coverage-modal-subtitle {
    font-size: 1rem;
  }

  .coverage-address-input {
    padding: 14px 68px 14px 48px;
    font-size: 0.95rem;
  }

  .coverage-map-container {
    height: 400px;
  }

  .coverage-verify-btn {
    padding: 8px 20px;
    font-size: 0.875rem;
  }

  .coverage-location-notice {
    font-size: 0.9rem;
    padding: 12px;
  }
}

/* ========================================
   SECCIÓN DE COBERTURA (CTA HERO)
   ======================================== */

/* Sección de cobertura */
.coverage-section {
  background: linear-gradient(135deg, #f5f5f5 0%, #fafafa 100%);
  padding: 80px 0;
}

.coverage-header {
  text-align: center;
  margin-bottom: 48px;
}

.coverage-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 16px;
  line-height: 1.2;
}

.coverage-subtitle {
  font-size: 1.25rem;
  color: #666;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
}

/* CTA Box */
.coverage-cta-box {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.coverage-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 20px 48px;
  font-size: 1.25rem;
  font-weight: 600;
  background: rgb(151, 230, 144);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(151, 230, 144, 0.3);
}

.coverage-cta-btn:hover {
  background: rgb(135, 210, 128);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(151, 230, 144, 0.4);
}

.coverage-cta-btn:active {
  transform: translateY(-1px);
}

.coverage-cta-btn svg {
  flex-shrink: 0;
}

/* Caja de búsqueda */
.coverage-search-box {
  max-width: 800px;
  margin: 0 auto 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Wrapper del input y botón de ubicación */
.coverage-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.coverage-search-input-wrapper:focus-within {
  box-shadow: 0 6px 30px rgba(151, 230, 144, 0.3);
}

/* Icono de búsqueda - contenedor */
.coverage-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #999;
  pointer-events: none;
  z-index: 1;
}

.coverage-search-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

/* Input principal */
.coverage-search-input {
  flex: 1;
  width: 100%;
  padding: 20px 80px 20px 56px; /* Espacio para icono búsqueda (izq) y botón ubicación (der) */
  font-size: 1.125rem;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #1a1a1a;
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

.coverage-search-input:focus {
  outline: none;
  border-color: rgb(151, 230, 144);
}

/* Botón de geolocalización - CRÍTICO - CIRCULAR */
.coverage-location-btn {
  /* Posicionamiento */
  position: absolute !important;
  right: 6px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;

  /* Tamaño */
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;

  /* Display */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  /* Estilo - CIRCULAR */
  background: rgb(151, 230, 144) !important;
  border: none !important;
  border-radius: 50% !important; /* Círculo perfecto */
  color: white !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(151, 230, 144, 0.3) !important;

  /* Comportamiento */
  transition: all 0.3s ease !important;
  z-index: 10 !important;
  flex-shrink: 0 !important;

  /* Asegurar visibilidad */
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.coverage-location-btn:hover {
  background: rgb(151, 230, 144) !important;
  transform: translateY(-50%) scale(1.05) !important;
  box-shadow: 0 4px 16px rgba(151, 230, 144, 0.6) !important;
}

.coverage-location-btn:active {
  transform: translateY(-50%) scale(0.95) !important;
}

.coverage-location-btn:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.coverage-location-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Botón de verificar - duplicado para sección de cobertura */
.coverage-verify-btn {
  width: auto;
  padding: 8px 24px;
  font-size: 0.875rem;
  font-weight: 600;
  background: rgb(151, 230, 144);
  color: #1a1a1a;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: block;
  margin: 0 auto;
}

.coverage-verify-btn:hover:not(:disabled) {
  background: rgb(135, 210, 128);
}

.coverage-verify-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Contenedor del mapa */
.coverage-map-container {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  margin-top: 32px;
  animation: slideDown 0.4s ease-out;
}

.coverage-map-container[hidden] {
  display: none;
}

.coverage-map-main {
  width: 100%;
  height: 600px;
  min-height: 500px;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 767px) {
  .coverage-title {
    font-size: 2rem;
  }

  .coverage-subtitle {
    font-size: 1rem;
  }

  .coverage-search-input {
    padding: 16px 68px 16px 48px;
    font-size: 1rem;
  }

  .coverage-location-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    right: 8px !important;
  }

  .coverage-location-btn svg {
    width: 20px;
    height: 20px;
  }

  .coverage-search-icon {
    left: 12px;
  }

  .coverage-verify-btn {
    padding: 8px 20px;
    font-size: 0.875rem;
  }

  .coverage-map-main {
    height: 400px;
  }
}

/* Container genérico si no existe */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 40px;
  }
}
