/* ═══════════════════════════════════════════════════════════
   GestoriaTransfer — ITP Home Widget
   ═══════════════════════════════════════════════════════════ */

:root {
  --gt-rojo:      #c0392b;
  --gt-rojo-dark: #a93226;
  --gt-azul:      #3a9fd6;
  --gt-azul-hover:#1a6fa0;
  --gt-texto:     #333;
  --gt-borde:     #e0e0e0;
  --gt-bg-panel:  rgba(255,255,255,0.97);
  --gt-shadow:    0 8px 32px rgba(0,0,0,0.15);
}

/* ── Contenedor principal ────────────────────────────── */
.gt-itp-widget {
  position: relative;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--gt-texto);
}

/* Cuando el panel está activo, el widget pasa a mostrar solo el panel */
.gt-itp-widget.gt-panel-activo .gt-mapa-wrap {
  display: none !important;
}
.gt-itp-widget.gt-panel-activo .gt-panel {
  width: 100%;
  flex: 1 1 auto;
}

/* ── Mapa ────────────────────────────────────────────── */
.gt-mapa-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.gt-svg-container {
  width: 100%;
  position: relative;
}

.gt-svg-container svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Regiones del mapa ───────────────────────────────── */
.gt-fondo path {
  fill: #b8ddf0;
  stroke: #ffffff;
  stroke-width: 0.8;
}

.gt-region {
  fill: #3a9fd6;
  stroke: #ffffff;
  stroke-width: 0.8;
  cursor: pointer;
  transition: fill 0.18s ease, filter 0.18s ease;
}

.gt-region:hover {
  fill: #1a6fa0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.gt-region.gt-selected {
  fill: #c0392b;
}

/* ── Botones tipo vehículo ───────────────────────────── */
.gt-tipo-btns {
  position: absolute;
  top: -62px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  padding: 8px 14px;
  border-radius: 30px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.gt-tipo-btn {
  background: #e0e0e0;
  color: #555;
  border: none;
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
}

.gt-tipo-btn:hover {
  background: #c0392b;
  color: #fff;
  transform: scale(1.04);
}

.gt-tipo-btn.active {
  background: #c0392b;
  color: #fff;
}

/* ── Tooltip ─────────────────────────────────────────── */
.gt-tooltip {
  position: fixed;
  background: #1a3a52;
  color: #fff;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.gt-tooltip.visible {
  opacity: 1;
}
.gt-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom: none;
  border-top-color: #1a3a52;
}

/* ── Panel lateral ───────────────────────────────────── */
.gt-panel {
  width: 280px;
  flex-shrink: 0;
  background: var(--gt-bg-panel);
  border-radius: 16px;
  box-shadow: var(--gt-shadow);
  overflow: hidden;
  animation: gt-slide-in 0.3s ease;
  padding-bottom: 10px;
  box-sizing: border-box;
}

@keyframes gt-slide-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.gt-panel-header {
  background: var(--gt-rojo);
  color: #fff;
  padding: 16px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gt-ccaa-nombre {
  font-size: 18px;
  font-weight: 700;
}

.gt-panel-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.gt-panel-close:hover { opacity: 1; }

/* ── Formulario ──────────────────────────────────────── */
.gt-form {
  padding: 0 20px;
}

.gt-field-group {
  padding: 14px 0 0;
}

.gt-field-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gt-field-group small {
  display: block;
  color: #999;
  font-size: 11px;
  margin-top: 3px;
}

.gt-field-group select,
.gt-field-group input[type="date"],
.gt-field-group input[type="number"],
.gt-field-group input[type="tel"] {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--gt-borde);
  border-radius: 8px;
  font-size: 14px;
  color: var(--gt-texto);
  background: #fafafa;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.gt-field-group select:focus,
.gt-field-group input:focus {
  outline: none;
  border-color: var(--gt-azul);
  background: #fff;
}

.gt-radio-group {
  display: flex;
  gap: 16px;
}

.gt-radio-group label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--gt-texto);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

/* ── Resultado ITP ───────────────────────────────────── */
.gt-resultado {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--gt-borde);
  margin-top: 14px;
  animation: gt-fade-in 0.4s ease;
}

@keyframes gt-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

#gt-resultado-texto {
  background: linear-gradient(135deg, #f0f8ff, #e8f4fb);
  border-left: 4px solid var(--gt-azul);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 12px;
  color: #1a3a52;
}

#gt-resultado-texto strong {
  color: var(--gt-rojo);
}

.gt-aviso-transferencia {
  font-size: 13px;
  color: #555;
  margin: 0 0 16px;
  text-align: center;
}

.gt-aviso-transferencia strong {
  color: var(--gt-rojo);
}

/* ── Botones ─────────────────────────────────────────── */
.gt-btn-rojo {
  display: block;
  width: 100%;
  background: var(--gt-rojo);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-align: center;
}

.gt-btn-rojo:hover {
  background: var(--gt-rojo-dark);
  transform: scale(1.02);
}

#gt-contacto-form {
  margin-top: 14px;
  animation: gt-fade-in 0.3s ease;
}

#gt-contacto-msg {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}
#gt-contacto-msg.success {
  background: #d4edda;
  color: #155724;
}
#gt-contacto-msg.error {
  background: #f8d7da;
  color: #721c24;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .gt-itp-widget {
    flex-direction: column;
  }
  .gt-panel {
    width: 100%;
  }
  .gt-tipo-btns {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    justify-content: center;
    margin-bottom: 10px;
  }
}
