/* Layout base */
:root{
  --vx-brand: #E30613;
  --vx-brand-dark: #bb050f;
  --vx-brand-outline: rgba(227,6,19,0.35);
  --vx-brand-shadow: rgba(227,6,19,0.18);
  --vx-brand-shadow-strong: rgba(227,6,19,0.22);
}
/* Defensive Reset: Protect plugin from theme styles */
.catastro-container, .valoretxe-wizard, .catastro-map-wrapper {
  box-sizing: border-box !important;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.catastro-container *, .valoretxe-wizard *, .catastro-map-wrapper * {
  box-sizing: border-box !important;
}
.catastro-container { gap: 12px; font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif; color: #1d1d1f; width: 100%; max-width: 100%; }
.catastro-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.catastro-toolbar { margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.catastro-toolbar .button, .catastro-toolbar button { background:var(--vx-brand); color:#fff; border:none; padding:8px 12px; border-radius:8px; cursor:pointer; font-weight:600; transition: background .15s ease, box-shadow .15s ease, transform .02s ease; box-shadow: 0 2px 10px var(--vx-brand-shadow); }
.catastro-toolbar .button:hover, .catastro-toolbar button:hover { background:var(--vx-brand-dark); box-shadow: 0 4px 16px var(--vx-brand-shadow-strong); }
.catastro-toolbar .button:active, .catastro-toolbar button:active { transform: translateY(1px); }
.catastro-toolbar .button.is-secondary, .catastro-toolbar button.is-secondary { background:#f2f2f7; color:#111; box-shadow: none; }
.catastro-toolbar .button.is-ghost, .catastro-toolbar button.is-ghost { background:transparent; color:var(--vx-brand); border:1px solid #f5b6bc; box-shadow: none; }
.catastro-toolbar input[type="search"]{ padding:6px 8px; border-radius:6px; border:1px solid #e5e5ea }
.catastro-toolbar span{ display:inline-flex; align-items:center }
/* Map Wrapper (Premium) */
.catastro-map-wrapper {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1);
    border: 1px solid #f1f5f9;
    background: #f8fafc;
    z-index: 0;
}

.catastro-form { background: #fff; border: 1px solid #e5e5ea; padding: 14px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.03); }
.catastro-form { position: relative; z-index: 1200; }
.catastro-toolbar { position: relative; z-index: 1200; }
.catastro-form h3 { margin: 0 0 10px; font-size: 16px; }
.catastro-form label { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 8px; margin: 8px 0; font-size: 14px; }
@media (max-width: 600px) {
  .catastro-form label { grid-template-columns: 1fr; gap: 4px; }
}
.catastro-form input[type="text"], .catastro-form textarea { width: 100% !important; border: 1px solid #e5e5ea !important; border-radius: 6px !important; padding: 8px !important; font-size: 14px !important; box-shadow: none !important; margin: 0 !important; }
.catastro-form textarea { min-height: 70px; }

/* Info Panel (Premium) */
.catastro-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(920px, 92%);
    max-width: 920px;
    max-height: 85vh;
    padding: 24px 28px;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(2,6,23,0.35);
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 3000;
    font-size: 13px;
    transition: transform .18s ease, opacity .18s ease, max-height .18s ease, padding .18s ease;
}
.catastro-info h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px;
}
.catastro-info h4 { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.catastro-info p { color: #475569; line-height: 1.6; }
.catastro-info .muted { color: #666; }
.catastro-info .rc-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }


/* Override: hide any remaining copy buttons for referencia catastral to avoid user confusion */

.catastro-info table { width: 100%; border-collapse: collapse; }
.catastro-info td, .catastro-info th { border-bottom: 1px solid #eee; padding: 6px 8px; }
.catastro-info details { margin-top: 6px; }
.catastro-facade-preview { display:flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.catastro-facade-preview img { border: 1px solid #eee; box-shadow: 0 4px 16px rgba(0,0,0,.08); }

/* Croquis box: reserve space to avoid modal reflow while image loads */
.catastro-facade-preview .croquis-box {
  width: 160px;
  height: 120px;
  min-width: 160px;
  min-height: 120px;
  display: inline-block;
  position: relative;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eee;
}
.catastro-facade-preview .croquis-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg,#fbfdff,#f1f7ff);
  color: #6b7280;
  font-size: 13px;
}
.catastro-facade-preview img.catastro-croquis-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  transform: scale(0.99);
  transition: opacity .22s ease, transform .22s ease;
}
.catastro-facade-preview img.catastro-croquis-img.loaded {
  opacity: 1;
  transform: scale(1);
}

/* Anti-tema: normalizar caja y aislar el mapa de estilos globales del theme */
.catastro-container, .catastro-container * { box-sizing: border-box; }
.catastro-map-wrapper { isolation: isolate; background: #f8fafc; }
.catastro-map-wrapper .leaflet-container { line-height: 1.2 !important; }

/* Anti-tema: forzar estilos estables de los controles Leaflet (zoom, capas, etc.) */
/* Leaflet Controls (Premium) */
.catastro-map-wrapper .leaflet-bar {
    border: none !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
}
.catastro-map-wrapper .leaflet-bar a {
    background: #fff !important;
    color: #1e293b !important;
    border-bottom: 1px solid #f1f5f9 !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
}
.catastro-map-wrapper .leaflet-bar a:hover {
    background: #f8fafc !important;
    color: var(--vx-brand) !important;
}
.catastro-map-wrapper .leaflet-bar a:last-child {
    border-bottom: none !important;
}
.catastro-map-wrapper .leaflet-control-attribution {
  background: rgba(255,255,255,.85) !important;
  margin: 0 4px 4px 0 !important;
  padding: 0 4px !important;
  border-radius: 4px !important;
}


/* Force icons inside leaflet-bar buttons to be perfectly centered and stable */
.catastro-map-wrapper .leaflet-bar a,
.catastro-map-wrapper .leaflet-bar a:hover,
.catastro-map-wrapper .leaflet-bar a:focus {
  display: flex !important; /* keep block-level stacking but enable centering */
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  line-height: 1 !important; /* avoid vertical jump on hover/focus */
}
.catastro-map-wrapper .leaflet-bar a svg {
  display: block !important; /* prevent baseline alignment issues */
  width: 18px !important;
  height: 18px !important;
}

/* Asegurar controles Leaflet por debajo del panel */
.leaflet-top.leaflet-left { z-index: 500; }
.leaflet-bottom.leaflet-right { z-index: 500; }

/* Evitar solapamiento entre la caja de información y controles de búsqueda/lupa */
.catastro-info {
  /* espacio extra para no chocar con la lupa/search */
  margin-left: 6px;
  margin-bottom: 6px;
}

/* Si hay sugerencias de búsqueda que se muestran junto a un input en la esquina inferior derecha,
   aseguramos que la caja de info no las cubra en pantallas pequeñas */
@media (max-width: 900px) {
  .catastro-info { position: static; max-width: 100%; max-height: none; margin: 8px; }
}

/* Responsive adjustments for narrow screens */
@media (max-width: 900px) {
  .catastro-grid { flex-direction: column; }
  .catastro-info { position: static; max-width: 100%; max-height: none; margin: 8px; }
}

/* Mejoras responsive: en pantallas pequeñas forzamos que la columna izquierda sea fluida
   y que el mapa ocupe un alto razonable (override no intrusivo). */
@media (max-width: 900px) {
  .catastro-two-col .vx-left { flex: 1 1 auto !important; min-width: 0 !important; max-width: none !important; }
  .catastro-two-col .vx-right { flex: 1 1 auto !important; min-width: 0 !important; max-width: none !important; }
  /* Si el autor dejó un height fijo en el shortcode, el JS intenta adaptarlo; en caso contrario, ofrecemos un fallback */
  .catastro-map-wrapper { height: 60vh !important; min-height: 280px !important; }
  .catastro-map-wrapper #catastro-map { height: 100% !important; }
}

/* Evitar overflow horizontal en móviles: forzamos anchos máximos y que el mapa use todo el ancho disponible. */
@media (max-width: 600px) {
  .catastro-container { max-width: 100% !important; width: 100% !important; padding-left: 8px !important; padding-right: 8px !important; box-sizing: border-box !important; overflow-x: hidden !important; }
  .valoretxe-wizard { max-width: 100% !important; padding-left: 0 !important; padding-right: 0 !important; }
  .catastro-two-col, .catastro-two-col .vx-left, .catastro-two-col .vx-right { width: 100% !important; max-width: 100% !important; margin: 0 !important; box-sizing: border-box !important; }
  .catastro-map-wrapper { width: 100% !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; box-sizing: border-box !important; left: 0 !important; right: 0 !important; }
  /* Asegurar que el contenedor interno del mapa ocupa todo el ancho (Leaflet usa .leaflet-container) */
  .catastro-map-wrapper .leaflet-container, #catastro-map { width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; }
  /* Algunas reglas de controles y sugerencias pueden posicionarse fuera del viewport; limitar su anchura */
  .catastro-search-suggestions, .catastro-map-wrapper .leaflet-control-geocoder, .catastro-map-wrapper .leaflet-control-geocoder .leaflet-control-geocoder-alternatives { max-width: calc(100% - 16px) !important; left: 8px !important; right: 8px !important; }
}

/* Flex children sizing rules */
.catastro-form { flex: 1 1 300px; min-width: 280px; }
.catastro-map-wrapper { flex: 2 1 400px; min-width: 300px; }

/* Predictive search suggestions */
.catastro-search-wrap{ position: relative; }
/* Search Suggestions (Premium) */
.catastro-search-wrap{ position: relative; }
.catastro-search-suggestions {
    position: absolute;
    left: 0;
    top: 38px;
    background: #ffffff;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.15);
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 8px;
    z-index: 10000;
    overflow: hidden;
    min-width: 260px;
    max-width: 420px;
}
.catastro-suggestion {
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
}
.catastro-suggestion:hover, .catastro-suggestion.focused {
    background: #f8fafc;
    color: var(--vx-brand);
}
.catastro-suggestion .icon {
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.7;
}
.catastro-suggestion + .catastro-suggestion { border-top: none; }
.catastro-search-input{ border-radius: 8px; border: 1px solid #e6e6ea; }
.catastro-search-go{ background:#0a84ff; color:#fff; border:none; padding:6px 10px; border-radius:8px; cursor:pointer; margin-left:6px }


/* Force the search box to be visible by default and avoid theme interference */
.catastro-search-wrap{ display: inline-flex !important; align-items: center; }
.catastro-search-input{ display: inline-block !important; min-width: 180px; max-width: 60vw; }
.catastro-search-suggestions{ z-index: 2147483647; /* ensure above most theme elements */ }

/* --- Añadido: reglas de protección para evitar interferencias del tema --- */
.catastro-container { width: 100% !important; box-sizing: border-box; }
.catastro-form input[type="text"],
.catastro-form textarea { box-sizing: border-box; width: 100%; }
.leaflet-container img { max-width: none !important; }

/* Geocoder (lupa) — asegurar icono aunque el CSS externo no cargue sus imágenes */
.catastro-map-wrapper .leaflet-control-geocoder .leaflet-control-geocoder-icon {
  width: 32px !important;
  height: 32px !important;
  margin: 0 !important;
  display: inline-block !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: 18px 18px !important;
  /* Forzar fondo claro y borde para evitar que temas apliquen un color sólido */
  background-color: #ffffff !important;
  border: 1px solid rgba(0,0,0,0.06) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(2,6,23,0.08) !important;
  /* Bonita lupa en SVG inline para evitar rutas rotas de CDN */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23E30613' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") !important;
  color: inherit !important;
}
/* Asegurar que el enlace padre no pinte el fondo del icono */
.catastro-map-wrapper .leaflet-control-geocoder a,
.catastro-map-wrapper .leaflet-control-geocoder a:focus,
.catastro-map-wrapper .leaflet-control-geocoder a:hover {
  background-color: transparent !important;
  padding: 4px !important;
}
.catastro-map-wrapper .leaflet-control-geocoder .leaflet-control-geocoder-form input {
  height: 32px !important;
  line-height: 32px !important;
  font-size: 13px !important;
  border: 1px solid #e6e6ea !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}
.catastro-map-wrapper .leaflet-control-geocoder {
  border-radius: 8px !important;
  overflow: visible !important; /* permitir que el desplegable no se recorte */
  box-shadow: 0 6px 18px rgba(0,0,0,.12) !important;
}

/* Force a consistent horizontal layout and vertical centering so the icon is never 'higher' */
.catastro-map-wrapper .leaflet-control-geocoder {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 4px !important;
  background: rgba(255,255,255,0.95) !important;
  position: relative !important; /* ancla para el dropdown */
  max-width: 420px !important;
}

.catastro-map-wrapper .leaflet-control-geocoder a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important; /* avoid vertical offset from padding */
  margin: 0 !important;
  background: transparent !important;
}

.catastro-map-wrapper .leaflet-control-geocoder .leaflet-control-geocoder-form {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 !important;
}

.catastro-map-wrapper .leaflet-control-geocoder .leaflet-control-geocoder-form input {
  margin: 0 !important;
  padding: 4px 8px !important;
  height: 32px !important;
  line-height: 1 !important;
  vertical-align: middle !important;
  background: #fff !important;
  color: #111 !important;
  min-width: 220px !important;
  max-width: 60vw !important;
}

/* Estado expandido del geocoder: reforzar caja blanca y bordes */
.catastro-map-wrapper .leaflet-control-geocoder.leaflet-control-geocoder-expanded {
  background: #ffffff !important;
  border: 1px solid #e6e6ea !important;
  padding: 6px !important;
  border-radius: 10px !important;
}

/* Dropdown de alternativas del geocoder (resultados) */
.catastro-map-wrapper .leaflet-control-geocoder .leaflet-control-geocoder-alternatives {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  right: 0 !important;
  background: #fff !important;
  border: 1px solid #e6e6ea !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 30px rgba(0,0,0,.16) !important;
  max-height: 280px !important;
  overflow: auto !important;
  padding: 6px 0 !important;
  z-index: 3000 !important;
  min-width: 260px !important;
  max-width: 420px !important;
}
.catastro-map-wrapper .leaflet-control-geocoder .leaflet-control-geocoder-alternatives li {
  list-style: none !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  color: #222 !important;
  cursor: pointer !important;
}
.catastro-map-wrapper .leaflet-control-geocoder .leaflet-control-geocoder-alternatives li + li {
  border-top: 1px solid #f3f3f3 !important;
}
.catastro-map-wrapper .leaflet-control-geocoder .leaflet-control-geocoder-alternatives li:hover,
.catastro-map-wrapper .leaflet-control-geocoder .leaflet-control-geocoder-alternatives .leaflet-control-geocoder-selected {
  background: #f1f7ff !important;
}

@media (max-width: 900px){
  .catastro-map-wrapper .leaflet-control-geocoder { max-width: 90vw !important; }
  .catastro-map-wrapper .leaflet-control-geocoder .leaflet-control-geocoder-form input { max-width: 70vw !important; }
  .catastro-map-wrapper .leaflet-control-geocoder .leaflet-control-geocoder-alternatives { max-width: 90vw !important; }
}

/* Cambia el cursor cuando está sobre la capa del catastro para indicar que es interactiva */
.leaflet-container .leaflet-tile-pane img {
  cursor: pointer;
}

/* Custom overlay search (used when no external input is available) */
/* Search Box (Map Overlay - Premium) */
/* IMPORTANT: Use !important to prevent cache/theme style conflicts */
.catastro-map-search {
    position: absolute !important;
    top: 20px !important;
    left: 20px !important;
    z-index: 1000 !important;
    width: auto !important;
    min-width: 220px !important;
    max-width: calc(100% - 90px) !important; /* Leave space for fullscreen button */
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
    display: inline-flex !important; /* inline-flex allows container to shrink to content */
    align-items: center !important;
    padding: 8px 16px !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    transition: width 0.15s ease, box-shadow 0.2s ease, background 0.2s ease !important;
    /* Prevent duplicates from appearing */
    isolation: isolate !important;
}
/* Ensure only one search box is visible */
.catastro-map-search + .catastro-map-search {
    display: none !important;
}
.catastro-map-search:focus-within {
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.15) !important;
    background: #ffffff !important;
    border-color: var(--vx-brand) !important;
}
.catastro-map-search input,
.catastro-map-search input[type="search"],
.catastro-map-search input[type="text"] {
    border: none !important;
    background: transparent !important;
    padding: 10px 0 !important;
    font-size: 15px !important;
    /* Allow width to be set by JS */
    width: auto !important;
    min-width: 180px !important;
    max-width: 450px !important;
    outline: none !important;
    color: #1e293b !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
    /* Let JavaScript handle dynamic width */
    flex: 0 1 auto !important;
}
/* For actual textarea fallback if used */
.catastro-map-search textarea {
    border: none !important;
    background: transparent !important;
    padding: 10px 0 !important;
    font-size: 15px !important;
    width: auto !important;
    min-width: 180px !important;
    max-width: 450px !important;
    outline: none !important;
    color: #1e293b !important;
    font-weight: 500 !important;
    min-height: 24px !important;
    max-height: 72px !important;
    height: auto !important;
    line-height: 1.4 !important;
    resize: none !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
}
.catastro-map-search-icon {
    opacity: 0.6 !important;
    margin-right: 10px !important;
    transform: scale(0.95) !important;
    flex-shrink: 0 !important; /* Prevent icon from shrinking */
    align-self: center !important; /* Keep icon vertically centered */
}


/* Modal-style info panel: centered, larger and more touch-friendly */
.catastro-map-wrapper .catastro-info.modal {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(920px, 92%) !important;
  max-width: 920px !important;
  max-height: 85vh !important;
  padding: 24px 28px !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 60px rgba(2,6,23,0.35) !important;
  background: #fff !important;
  border: 1px solid rgba(0,0,0,0.06) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 3000 !important;
  
  /* Smooth scrolling */
  scroll-behavior: smooth !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain; /* Prevent scrolling the body when modal ends */
}

/* Scrollbar styling for better UX */
.catastro-map-wrapper .catastro-info.modal::-webkit-scrollbar {
  width: 8px;
}

.catastro-map-wrapper .catastro-info.modal::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.catastro-map-wrapper .catastro-info.modal::-webkit-scrollbar-thumb {
  background: #E30613;
  border-radius: 10px;
}

.catastro-map-wrapper .catastro-info.modal::-webkit-scrollbar-thumb:hover {
  background: #bb050f;
}

.catastro-map-wrapper .catastro-info.modal.no-croquis {
  /* Modal Bizkaia sin croquis: mayor ancho y altura optimizada */
  width: min(900px, 94%) !important;
  max-width: 900px !important;
  height: auto !important;
  max-height: 92vh !important;
  padding: 20px 24px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
}

/* Hide croquis elements completely */
.catastro-map-wrapper .catastro-info.modal.no-croquis .catastro-facade-preview,
.catastro-map-wrapper .catastro-info.modal.no-croquis .croquis-box,
.catastro-map-wrapper .catastro-info.modal.no-croquis .croquis-placeholder,
.catastro-map-wrapper .catastro-info.modal.no-croquis img.catastro-croquis-img {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Improved table styling for units list */
.catastro-map-wrapper .catastro-info.modal table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 12px 0;
}

.catastro-map-wrapper .catastro-info.modal table th {
  background: linear-gradient(180deg, #f8f9fa 0%, #f1f3f5 100%);
  color: #1f2937;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 2px solid #E30613;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 10;
}

.catastro-map-wrapper .catastro-info.modal table td {
  padding: 14px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
  color: #374151;
  transition: background-color 0.15s ease;
}

.catastro-map-wrapper .catastro-info.modal table tr:hover td {
  background-color: #fef2f2;
}

.catastro-map-wrapper .catastro-info.modal table tr:nth-child(even) {
  background-color: #f9fafb;
}

.catastro-map-wrapper .catastro-info.modal table tr:nth-child(even):hover td {
  background-color: #fee2e2;
}

/* Better button spacing in modal */
.catastro-map-wrapper .catastro-confirm-wrap {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: none; /* Removed horizontal line as requested */
}

.catastro-map-wrapper .catastro-confirm-wrap button {
  padding: 14px 24px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 160px;
  letter-spacing: 0.3px;
}

.catastro-map-wrapper .catastro-confirm-wrap button[type="button"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}


/* Responsive adjustments */
@media (max-width: 700px){
  .catastro-map-wrapper .catastro-info.modal {
    width: calc(100% - 24px) !important;
    max-height: 90vh !important;
    padding: 18px 20px !important;
    border-radius: 12px !important;
  }
  
  .catastro-map-wrapper .catastro-info.modal.no-croquis {
    max-height: 92vh !important;
    min-height: 0 !important;
    padding: 16px 18px !important;
  }
  
  .catastro-map-wrapper .catastro-confirm-wrap {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
  }
  
  .catastro-map-wrapper .catastro-confirm-wrap button {
    width: 100% !important;
    min-width: 0;
  }
  
  .catastro-map-wrapper .catastro-info.modal table th,
  .catastro-map-wrapper .catastro-info.modal table td {
    padding: 10px;
    font-size: 13px;
  }
}

/* Fade in animation for modal */
@keyframes fadeInModal {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.catastro-map-wrapper .catastro-info.modal {
  animation: fadeInModal 0.2s ease-out;
}

/* Align modal content at the top */
.catastro-map-wrapper .catastro-info.modal.no-croquis {
  align-items: flex-start !important;
}

/* Push the confirm controls to the bottom when the modal has extra vertical space */
.catastro-map-wrapper .catastro-info.modal.no-croquis .catastro-confirm-wrap {
  margin-top: auto !important;
}
.catastro-map-wrapper .catastro-info.modal .rc-row { font-size: 15px; }
.catastro-map-wrapper .catastro-info.modal table td, .catastro-map-wrapper .catastro-info.modal table th { padding: 8px 10px; }

/* Backdrop overlay to block map interaction when modal is open */
.catastro-map-wrapper .catastro-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.38); /* slate-900/60 */
  z-index: 2990; /* Just below the modal (3000) */
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none; /* off until shown */
}
.catastro-map-wrapper .catastro-modal-backdrop.show {
  opacity: 1;
  pointer-events: auto; /* block clicks to the map while modal is visible */
}

/* Optional: while busy, prevent map interactions but keep panel interactive */
.catastro-map-wrapper.busy .leaflet-container { pointer-events: none; }
.catastro-map-wrapper.busy .catastro-info { pointer-events: auto; }

/* Larger confirmation controls inside the modal */
.catastro-map-wrapper .catastro-confirm-wrap{ display:flex; gap:12px; align-items:center; margin-top:14px; }
.catastro-map-wrapper .catastro-confirm-wrap button{ padding:12px 16px; border-radius:10px; font-size:15px; font-weight:700; cursor:pointer; }
.catastro-map-wrapper .catastro-confirm-wrap button[type="button"]{ min-width:160px; }
.catastro-map-wrapper .catastro-confirm-wrap button[style*="background: #0a84ff"],
.catastro-map-wrapper .catastro-confirm-wrap button[style*="background:#0a84ff"],
.catastro-map-wrapper .catastro-confirm-wrap button[style*="background: var(--vx-brand)"]{ background:var(--vx-brand) !important; color:#fff !important; border:none !important; box-shadow:0 8px 30px var(--vx-brand-shadow) !important; }
.catastro-map-wrapper .catastro-confirm-wrap button[style*="background: #f2f2f7"]{ background:#f2f2f7 !important; color:#111 !important; border:1px solid #e5e5ea !important; }

@media (max-width: 700px){
  .catastro-map-wrapper .catastro-info.modal{ width: calc(100% - 28px) !important; left: 50%; transform: translate(-50%, -50%) !important; }
  .catastro-map-wrapper .catastro-confirm-wrap{ flex-direction:column-reverse; align-items:stretch; }
  .catastro-map-wrapper .catastro-confirm-wrap button{ width:100% !important; }
  /* Give the no-croquis modal more vertical room on small devices too
     but keep it able to shrink to content when empty */
  .catastro-map-wrapper .catastro-info.modal.no-croquis { max-height: 90vh !important; min-height: 0 !important; }
}

/* Push the confirm controls to the bottom when the modal has extra vertical space.
   When modal height equals content height, margin-top:auto acts like normal spacing */
.catastro-map-wrapper .catastro-info.modal.no-croquis .catastro-confirm-wrap {
  margin-top: auto !important;
}
.catastro-map-wrapper .catastro-map-search .catastro-map-search-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23E30613' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
}
.catastro-map-search .catastro-map-search-icon {
  /* Fallback rule: ensure the icon shows even if the expected .catastro-map-wrapper
     ancestor or theme classes are missing or altered. This prevents the search input
     appearing without the magnifier in some embedded contexts. */
  width: 18px;
  height: 18px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23E30613' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
}
.catastro-map-search .catastro-search-input {
  /* Ensure the input styling is preserved even outside the expected wrapper */
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  font-size: 15px !important;
  color: #1e293b !important;
  min-height: 24px !important;
  max-height: 72px !important; /* ~3 lines max */
  height: auto !important;
  line-height: 1.4 !important;
  min-width: 200px !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.catastro-map-wrapper .catastro-map-search .catastro-search-input {
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  font-size: 15px !important;
  color: #1e293b !important;
  min-height: 24px !important;
  max-height: 72px !important;
  height: auto !important;
  line-height: 1.4 !important;
  min-width: 200px !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
@media (max-width: 900px){
  /* Mobile: Shorten search box to avoid overlapping the FAB buttons (top-right) */
  .catastro-map-wrapper .catastro-map-search,
  .catastro-map-search { 
      left: 10px !important; 
      right: auto !important; 
      width: auto !important;
      min-width: 180px !important;
      max-width: calc(100% - 70px) !important; /* Leave space for FABs (fullscreen btn + margins) */
  }
  .catastro-map-wrapper .catastro-map-search .catastro-search-input,
  .catastro-map-search .catastro-search-input,
  .catastro-map-search input { 
      max-width: 100% !important; 
      min-width: 0 !important;
      width: 100% !important;
  }
}

/* Indicator shown while WMS layer is hidden during navigation */
/* WMS Indicator (Premium) */
.catastro-wms-indicator {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1400;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 99px;
    padding: 8px 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    gap: 8px;
    align-items: center;
}
.catastro-wms-indicator.hidden{ display: none !important; }
.catastro-wms-indicator .dot{
    width:10px; height:10px; border-radius:50%;
    background: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}


/* Loading overlay for identify and heavy operations */
/* Loading Overlay (Premium) */
.catastro-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}
.catastro-loading.visible {
    opacity: 1;
    pointer-events: auto;
}
.catastro-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(227, 6, 19, 0.1);
    border-top: 3px solid var(--vx-brand);
    animation: catastro-spin 0.8s linear infinite;
}
@keyframes catastro-spin { to { transform: rotate(360deg); } }


/* Toast messages */
/* Toast messages (Premium) */
.catastro-toast {
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    top: auto;
    height: auto;
    width: auto;
    max-width: 90vw;
    background: #1e293b;
    color: #fff;
    border-radius: 99px;
    padding: 12px 24px;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 10px 30px -5px rgba(0,0,0,0.3);
    z-index: 2147483647;
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.catastro-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* Zoom hint: invita a acercar antes de seleccionar */


/* Marcador de pulso para indicar foco de selección */
.catastro-pulse {
  width: 20px; height: 20px; position: relative; border-radius: 50%;
}
.catastro-pulse::before, .catastro-pulse::after{
  content: ""; position: absolute; inset: 0; border-radius: 50%;
}
.catastro-pulse::before{ background: rgba(227,6,19,0.15); animation: catastro-pulse-ring 1.8s ease-out infinite; }
.catastro-pulse::after{ background: var(--vx-brand); width: 8px; height: 8px; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); border-radius: 50%; box-shadow: 0 0 0 2px #ffffff; }
@keyframes catastro-pulse-ring { 0% { transform: scale(0.5); opacity: 0.9; } 70% { transform: scale(2.2); opacity: 0; } 100% { transform: scale(2.2); opacity: 0; } }

/* Botones flotantes (FAB) para localizar y pantalla completa */
/* FAB wrapper - Moved to top-right as requested */
.catastro-fab-wrap{ position:absolute; top: 12px; right: 12px; display:flex; flex-direction: column; gap:8px; z-index: 1450; }
/* FAB Buttons (Premium) */
.catastro-fab-wrap { position:absolute; top: 12px; right: 12px; display:flex; flex-direction: column; gap:8px; z-index: 1450; }
.catastro-fab {
    background: #fff;
    color: #475569;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 12px;
    width: 40px;
    height: 40px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    padding: 0;
}
.catastro-fab:hover {
    transform: translateY(-2px);
    color: var(--vx-brand);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.catastro-fab-locate { background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2v2'/><path d='M12 20v2'/><path d='M20 12h2'/><path d='M2 12H4'/><circle cx='12' cy='12' r='4'/></svg>"); background-repeat:no-repeat; background-position:center; background-size:20px 20px; }
.catastro-fab-fullscreen { background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M15 3h6v6'/><path d='M21 3l-7 7'/><path d='M9 21H3v-6'/><path d='M3 21l7-7'/></svg>"); background-repeat:no-repeat; background-position:center; background-size:20px 20px; }

/* Force specific styles for fullscreen FAB to prevent theme interference (red square issue) */
.catastro-fab.catastro-fab-fullscreen {
    background-color: #ffffff !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M15 3h6v6'/><path d='M21 3l-7 7'/><path d='M9 21H3v-6'/><path d='M3 21l7-7'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: 20px 20px !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
}
.catastro-fab.catastro-fab-fullscreen:hover {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23E30613' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M15 3h6v6'/><path d='M21 3l-7 7'/><path d='M9 21H3v-6'/><path d='M3 21l7-7'/></svg>") !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.catastro-fab:hover .catastro-fab-locate { background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23E30613' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2v2'/><path d='M12 20v2'/><path d='M20 12h2'/><path d='M2 12H4'/><circle cx='12' cy='12' r='4'/></svg>"); }



/* Removed mobile override to keep FAB at top-right */
/* @media (max-width: 900px){ .catastro-fab-wrap{ bottom: 66px; left: 10px; } } */

/* Leaflet legend polish */
.leaflet-control .info.legend { border-radius: 8px; border: 1px solid rgba(0,0,0,.06); box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.leaflet-control .info.legend i { border-radius: 3px; margin-right: 6px; vertical-align: -2px; }

/* Geocoder control spacing tweaks */
.leaflet-control-geocoder { border-radius: 8px; overflow: hidden; }
.leaflet-control-geocoder .leaflet-control-geocoder-form input { border-radius: 8px; }

/* Base transitions for the info panel */
.catastro-info { transition: transform .18s ease, opacity .18s ease, max-height .18s ease, padding .18s ease; visibility: visible; }
/* Intermediate collapsing state: animate opacity/transform but keep element visible so the animation is visible */
.catastro-info.collapsing { opacity: 0 !important; transform: translateY(8px) !important; pointer-events: none !important; }
/* Fully collapsed: keep hidden after transition completes */
.catastro-info.collapsed { max-height: 40px; overflow: visible; width: auto; min-width: 160px; opacity: 0.95; padding: 6px 8px; margin-bottom: 2px; border-radius: 10px; }
/* When collapsed keep minimal footprint but do not remove background/padding immediately
   so the opacity/transform animation remains visible on close as well as open. */
.catastro-info.collapsed .catastro-info-toggle { position: relative; z-index: 1110; }

/* Position the toggle button inside the map wrapper (top-right of the map) so when the
  panel is collapsed only the button is visible over the map. */
.catastro-map-wrapper .catastro-info-toggle { position: absolute; top: 8px; right: 8px; z-index: 1400; }

/* Slightly tuck the collapsed box downwards so less white space remains visible on large screens */
@media (min-width: 900px){
  .catastro-info.collapsed { transform: translateY(10px); }
}
.catastro-info-toggle { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,0.95); border: 1px solid #e6e6ea; padding: 6px 8px; border-radius: 999px; cursor: pointer; font-size: 13px; color: #111; box-shadow: 0 6px 18px rgba(0,0,0,.08); line-height: 1; min-width: 38px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.catastro-info-toggle[aria-pressed="true"] { background:var(--vx-brand); color:#fff; border-color: rgba(227,6,19,0.2); }

/* Reserve space inside the info box so the toggle does not overlap text/content */
.catastro-info { padding-right: 56px; }
.catastro-info.collapsed { padding-right: 46px; }

/* Close button (inside the info panel) - Hidden as not needed */


/* When loading (overlay visible) ensure content has extra right padding so spinner/toast don't overlap toggle */
.catastro-loading + .catastro-info, .catastro-info.loading { padding-right: 56px; }

/* When collapsed keep a small visible handle for accessibility on small screens */
@media (max-width: 900px){
  /* On small screens avoid pushing site content down when collapsed: keep absolute
     positioning and a very compact footprint so only the toggle/handle is visible. */
  .catastro-info.collapsed {
    position: absolute !important;
    bottom: 8px !important;
    left: 8px !important;
    right: 8px !important;
    max-width: calc(100% - 16px) !important;
    max-height: 36px !important;
    padding: 6px 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    overflow: visible !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  }
  /* Keep toggle in the top-right corner even on small screens */
  .catastro-info-toggle { position: absolute !important; top: 8px !important; right: 12px !important; margin-left: 0 !important; }
  /* Provide slightly more right padding so the toggle doesn't overlap content */
  .catastro-info { padding-right: 64px; }
}

/* Final safety rule: hide collapsed panel visually while preserving transitions.
  Use opacity/transform/visibility so the close/open animation remains smooth, and
  ensure the panel does not block pointer events when collapsed. */
.catastro-info.collapsed {
  /* After the collapsing animation, fully hide and make non-interactive */
  opacity: 0 !important;
  transform: translateY(8px) !important;
  visibility: hidden !important;
  transition: visibility 0s linear .18s !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none !important;
}

/* When expanding, make sure visibility/opacity transition back -- the base rule
  `.catastro-info` already defines transition on transform/opacity/padding. */

/* ================= Valoretxe Wizard ================= */
.valoretxe-wizard { max-width: 780px; margin: 0 auto; }
.valoretxe-wizard .vx-step { 
  display: none; 
  background: #ffffff; 
  border: 1px solid #f1f5f9; 
  border-radius: 24px; 
  padding: 32px; 
  box-shadow: 0 10px 40px -10px rgba(0,0,0,0.08); 
  transition: all 0.3s ease;
}
.catastro-two-col{ display:flex; gap:24px; align-items:flex-start; }
.catastro-two-col .vx-left{ flex:0 0 340px; min-width:260px; max-width:380px; }
.catastro-two-col .vx-right{ flex:1 1 520px; min-width:320px; }
@media (max-width: 900px){ .catastro-two-col{ flex-direction: column; } }

/* Cuando el mapa se oculta tras seleccionar la parcela, convertir en una sola columna centrada */
.catastro-two-col.map-hidden{ display:block; }
.catastro-two-col.map-hidden .vx-left{ flex:1 1 auto; max-width: 780px; width:100%; margin: 0 auto; }
.catastro-two-col.map-hidden .vx-right{ display:none !important; }

/* Modo intro (paso 4): dar más protagonismo al mapa */
.catastro-two-col.map-intro .vx-left{ flex:0 0 280px; min-width:240px; max-width:320px; }
.catastro-two-col.map-intro .vx-right{ flex:3 1 800px; min-width:480px; }

/* En map-intro queremos una experiencia amplia: ampliar el contenedor, ambos paneles y la altura del mapa */
.catastro-two-col.map-intro { max-width: 1200px; margin: 0 auto; }
.catastro-two-col.map-intro .vx-left{ flex:0 0 420px; min-width:360px; max-width:460px; }
.catastro-two-col.map-intro .vx-right{ flex:4 1 900px; min-width:560px; }
.catastro-two-col.map-intro .catastro-map-wrapper{ min-height: 680px; height: auto; border-radius: 20px; box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1); }
.valoretxe-wizard .vx-step + .vx-step { margin-top: 20px; }
.valoretxe-wizard .vx-step.active { display: block; animation: vxFadeIn 0.4s ease-out; }
@keyframes vxFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.valoretxe-wizard h2, .valoretxe-wizard h3 { margin-top: 0; color:#0f172a; letter-spacing: -0.02em; }
.valoretxe-wizard h2 { font-size: 26px; font-weight: 800; margin-bottom: 12px; }
.valoretxe-wizard h3 { font-size: 18px; font-weight: 600; margin-bottom: 20px; color: #334155; }
.valoretxe-wizard p { color:#475569; line-height: 1.6; font-size: 15px; }
.valoretxe-wizard .vx-actions { margin-top: 24px; display: flex; gap: 12px; }
.valoretxe-wizard button { 
  background:var(--vx-brand); 
  color:#fff; 
  border:none; 
  padding:14px 24px; 
  border-radius:14px; 
  cursor:pointer; 
  font-weight:600; 
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px var(--vx-brand-shadow); 
  transition: all 0.2s ease; 
  text-transform: none !important; /* Prevent themes forcing uppercase */
  text-decoration: none !important;
  line-height: normal !important;
}
.valoretxe-wizard button:hover { 
  background:var(--vx-brand-dark); 
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--vx-brand-shadow-strong); 
}
.valoretxe-wizard button:focus-visible { outline: 3px solid var(--vx-brand-outline); outline-offset: 2px; }
.valoretxe-wizard button:active { transform: translateY(1px); }
.valoretxe-wizard button.vx-prev { 
  background:#ffffff; 
  color:#64748b; 
  box-shadow:none; 
  border:2px solid #e2e8f0; 
}
.valoretxe-wizard button.vx-prev:hover {
  border-color: #cbd5e1;
  color: #0f172a;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.valoretxe-wizard button:disabled,
.valoretxe-wizard button.vx-next:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  transform: none !important;
}
.valoretxe-wizard button:disabled:hover,
.valoretxe-wizard button.vx-next:disabled:hover {
  background: #e2e8f0;
  color: #94a3b8;
  transform: none !important;
  box-shadow: none;
}
.valoretxe-wizard .vx-options { display:grid; grid-template-columns: 1fr; gap: 12px; }
.valoretxe-wizard .vx-options.grid { display:grid; grid-template-columns: 1fr; gap:12px; }
.valoretxe-wizard .vx-options.grid.compact { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.valoretxe-wizard .vx-options.grid.compact .vx-opt { padding: 12px 8px; font-size: 14px; min-height: 48px; justify-content: center; text-align: center; }
.valoretxe-wizard .vx-options.column { display:grid; grid-template-columns: 1fr; gap: 10px; }
.valoretxe-wizard .vx-opt { 
  background:#ffffff; 
  color:#1e293b; 
  border:2px solid #f1f5f9; 
  padding:18px 20px; 
  text-align:left; 
  border-radius:16px; 
  cursor:pointer; 
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.valoretxe-wizard .vx-opt:hover { 
  background:#ffffff; 
  border-color:#cbd5e1; 
  transform: translateY(-2px);
  box-shadow: 0 12px 20px -8px rgba(0,0,0,0.08);
}
.valoretxe-wizard .vx-opt:focus-visible { outline: 3px solid var(--vx-brand-outline); outline-offset: 2px; }
.valoretxe-wizard .vx-opt.active { 
  background:#fff1f2 !important; 
  color:var(--vx-brand) !important; 
  border-color:var(--vx-brand) !important; 
  box-shadow: 0 4px 12px rgba(227,6,19,0.15) !important; 
  font-weight: 700;
}
.valoretxe-wizard label { display:block; margin:8px 0; color:#334155; font-weight: 500; }
.valoretxe-wizard input[type="text"], .valoretxe-wizard input[type="tel"]{ 
  background: #f8fafc;
  border:2px solid #e2e8f0; 
  padding:14px 16px; 
  border-radius:12px; 
  width:100%; 
  max-width: 360px; 
  font-size:15px; 
  transition: all 0.2s ease; 
  color: #0f172a;
  margin: 0 !important; /* Prevent theme margins */
  box-shadow: none; /* Reset theme shadows */
}
@media (max-width: 600px) {
  .valoretxe-wizard input[type="text"], .valoretxe-wizard input[type="tel"] {
    max-width: 100%;
    padding: 12px;
    font-size: 16px; /* Prevent zoom on focus in iOS */
  }
}
.valoretxe-wizard input[type="text"]:focus, .valoretxe-wizard input[type="tel"]:focus{ 
  background: #ffffff;
  border-color:var(--vx-brand); 
  box-shadow: 0 0 0 4px var(--vx-brand-shadow); 
  outline: none; 
}
.valoretxe-wizard .vx-subflow.hidden, .valoretxe-wizard .vx-contact.hidden, .valoretxe-wizard .hidden{ display:none !important; }
.valoretxe-wizard .vx-yn-widget, .valoretxe-wizard .vx-yn3 {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 14px;
  gap: 0;
}

.valoretxe-wizard .vx-yn-widget button, .valoretxe-wizard .vx-yn3 button{ 
  background:transparent; 
  color:#64748b; 
  border:none; 
  padding:8px 16px; 
  border-radius:10px; 
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
  transition: all 0.2s ease;
}
.valoretxe-wizard .vx-yn-widget button:hover, .valoretxe-wizard .vx-yn3 button:hover {
  color: #334155;
  background: rgba(255,255,255,0.5);
}
.valoretxe-wizard .vx-yn-widget button.active, .valoretxe-wizard .vx-yn3 button.active{ 
  background:#ffffff; 
  color:var(--vx-brand); 
  box-shadow: 0 2px 8px rgba(0,0,0,0.08); 
  font-weight: 700;
}
.valoretxe-wizard .vx-result{ background:#fff; border:1px solid #f1f5f9; padding:24px; border-radius:20px; box-shadow:0 10px 40px -10px rgba(0,0,0,0.08); }
.valoretxe-wizard .vx-lead-form{ display:grid; gap:16px; max-width: 420px; margin-top: 16px; }
.valoretxe-wizard .vx-lead-form label{
  font-weight: 600;
  color: #1e293b;
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

/* Ensure inputs inside lead-form labels have space from the label text */
.valoretxe-wizard .vx-lead-form label input,
.valoretxe-wizard .vx-lead-form label textarea {
  display: block;
  margin-top: 8px;
}
.valoretxe-wizard .vx-lead-form input[type="email"]{ 
  background: #f8fafc;
  border:2px solid #e2e8f0; 
  padding:14px 16px; 
  border-radius:12px; 
  width:100%; 
  font-size:15px; 
  transition: all 0.2s ease;
}
.valoretxe-wizard .vx-lead-form input[type="email"]:focus {
  background: #ffffff;
  border-color:var(--vx-brand); 
  box-shadow: 0 0 0 4px var(--vx-brand-shadow); 
  outline: none;
}
.valoretxe-wizard .vx-lead-form button{ justify-self: start; }
.valoretxe-wizard .vx-lead-status{ font-size: 14px; color:#374151; font-weight: 500; margin-top: 8px; }
.valoretxe-wizard .vx-lead-status.ok{ color:#059669; }
.valoretxe-wizard .vx-lead-status.err{ color:#dc2626; }

/* Bigger primary button and vertical actions on mobile */
.valoretxe-wizard .vx-actions .vx-next{ font-size:16px; padding:14px 18px; border-radius:12px; min-width:240px; }
@media (max-width: 900px){
  .valoretxe-wizard .vx-actions{ flex-direction: column; align-items: stretch; }
  .valoretxe-wizard .vx-actions .vx-next{ width:100%; }
}

/* --- Top progress/stepper --- */
.valoretxe-wizard .vx-progress{ 
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #f1f5f9; 
  border-radius: 0; /* Full width feel */
  padding: 16px 24px; 
  margin: -20px -20px 24px -20px; /* Negative margin to touch edges if inside a padded container */
  box-shadow: 0 4px 20px -10px rgba(0,0,0,0.03); 
  position: sticky; 
  top: 0; 
  z-index: 100; 
}
@media (max-width: 700px) {
  .valoretxe-wizard .vx-progress {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 0 0 16px 16px;
  }
}

.valoretxe-wizard .vx-steps { 
  list-style: none; 
  margin: 0; 
  padding: 0; 
  display: flex; 
  justify-content: space-between; 
  position: relative; 
  z-index: 1;
}

/* Connecting line background */
.valoretxe-wizard .vx-steps::after {
  content: "";
  position: absolute;
  top: 14px; /* Center with circles (30px height / 2) */
  left: 15px;
  right: 15px;
  height: 2px;
  background: #e2e8f0;
  z-index: -1;
}

.valoretxe-wizard .vx-steps li { 
  flex: 1; 
  text-align: center; 
  position: relative; 
  color: #94a3b8; 
  font-size: 11px; 
  font-weight: 600; 
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease; 
}

/* Step Circle */
.valoretxe-wizard .vx-steps li::before { 
  content: ""; 
  display: block; 
  width: 28px; 
  height: 28px; 
  margin: 0 auto 8px; 
  border-radius: 50%; 
  background: #ffffff; 
  border: 2px solid #e2e8f0; 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  z-index: 2;
  position: relative;
}

/* Completed State */
.valoretxe-wizard .vx-steps li.completed { color: var(--vx-brand); }
.valoretxe-wizard .vx-steps li.completed::before { 
  background: var(--vx-brand); 
  border-color: var(--vx-brand); 
  box-shadow: 0 0 0 3px var(--vx-brand-shadow);
  /* Optional: Add checkmark icon via background-image if desired */
}

/* Current State */
.valoretxe-wizard .vx-steps li.current { color: #0f172a; }
.valoretxe-wizard .vx-steps li.current::before { 
  background: #ffffff; 
  border-color: var(--vx-brand); 
  box-shadow: 0 0 0 4px rgba(227,6,19,0.15); 
  transform: scale(1.15);
}

/* Hide text on very small screens, keep dots */
@media (max-width: 500px) {
  .valoretxe-wizard .vx-steps li span { display: none; }
  .valoretxe-wizard .vx-steps li::before { margin-bottom: 0; }
}

/* Progress fill bar (optional, if JS updates width) */
.valoretxe-wizard .vx-progress-bar {
  position: absolute;
  top: 30px; /* Match ::after top + padding */
  left: 40px; /* Adjust based on padding */
  height: 2px;
  background: var(--vx-brand);
  width: 0%;
  transition: width 0.4s ease;
  z-index: 0;
  display: none; /* Hidden by default, enable if JS drives it */
}

/* ===== Características: UI mejorada ===== */
.valoretxe-wizard .vx-sub{ color:#64748b; margin-top:-4px; margin-bottom:16px; font-size:14px; }
.valoretxe-wizard .vx-section{ margin: 16px 0 8px; }
.valoretxe-wizard .vx-section.two-cols{ display:grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px){ .valoretxe-wizard .vx-section.two-cols{ grid-template-columns: 1fr; } }
.valoretxe-wizard .vx-sec-title{ font-size: 15px; color:#0f172a; margin: 0 0 10px; font-weight: 700; }
.valoretxe-wizard .vx-feature-grid{ display:grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px){ .valoretxe-wizard .vx-feature-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 900px){ .valoretxe-wizard .vx-feature-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); } }
.valoretxe-wizard .vx-feature{ 
  background:#ffffff; 
  border:2px solid #f1f5f9; 
  border-radius: 16px; 
  padding: 12px 14px; 
  display:flex; 
  align-items:center; 
  justify-content: space-between; 
  gap: 10px; 
  transition: all 0.2s ease; 
  flex-wrap: nowrap; /* Prevent wrapping to keep toggle aligned */
}
.valoretxe-wizard .vx-feature-title { 
  color:#0f172a; 
  font-weight:600; 
  font-size:14px; 
  flex: 1; /* Take available space */
  min-width: 0; /* Allow text truncation if needed */
}
.valoretxe-wizard .vx-feature-actions {
  flex-shrink: 0; /* Prevent toggle from shrinking */
}
.valoretxe-wizard .vx-feature-actions .vx-yn-widget button,
.valoretxe-wizard .vx-feature-actions .vx-yn3 button{ padding:6px 12px; border-radius: 8px; font-size: 13px; }
.valoretxe-wizard .vx-collapsible{ background:#f8fafc; border:1px dashed #cbd5e1; border-radius: 16px; padding: 12px 16px; margin-top: 12px; }
.valoretxe-wizard .vx-collapsible > summary{ cursor: pointer; list-style: none; user-select: none; display:flex; align-items:center; gap: 8px; padding: 4px; font-weight: 700; color:#0f172a; font-size: 14px; }
.valoretxe-wizard .vx-collapsible > summary::-webkit-details-marker{ display: none; }
.valoretxe-wizard .vx-collapsible[open]{ border-style: solid; border-color: #e2e8f0; background: #ffffff; }
.valoretxe-wizard .vx-card{ background:#fff; border:1px solid #f1f5f9; border-radius: 16px; padding: 16px; box-shadow: 0 4px 18px rgba(0,0,0,.03); }
.valoretxe-wizard .vx-card-head{ display:flex; align-items:center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.valoretxe-wizard .vx-card-title{ font-weight:700; color:#0f172a; font-size: 15px; }

/* ===== PÁGINA DE BÚSQUEDA (shortcode [catastro_search]) ===== */
.catastro-search-page { max-width: 860px; margin: 0 auto; }
.catastro-search-page .vx-hero { background:#fff; border:1px solid #e5e5ea; border-radius:12px; padding:16px; box-shadow:0 4px 18px rgba(0,0,0,.04); margin-bottom: 12px; }
.catastro-searchbar { background:#fff; border:1px solid #e5e5ea; border-radius:12px; padding:16px; box-shadow:0 4px 18px rgba(0,0,0,.04); }
.catastro-searchbox { display:flex; align-items:center; gap:8px; border:1px solid #e6e6ea; border-radius:999px; padding:10px 12px; }
.catastro-searchbox input[type="search"]{ border:0; outline:none; flex:1 1 auto; font-size:16px; }
.catastro-search-hint{ color:#6b7280; font-size:13px; margin-top:8px; }
.catastro-searchbox .catastro-map-search-icon{ width:18px; height:18px; display:inline-block; background-repeat:no-repeat; background-position:center; background-size:18px 18px; background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23E30613' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>"); }

/* Step 8: Result Layout */
.vx-result-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.vx-result-left {
    flex: 1;
    min-width: 300px;
}

.vx-result-right {
    flex: 0 0 350px;
    max-width: 100%;
}

.vx-valuation-price {
    font-size: 48px;
    font-weight: 800;
    color: var(--vx-brand);
    line-height: 1.1;
    margin: 10px 0 20px;
}

#vx-res-calc-details h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #111;
}

.vx-calculation-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    font-size: 14px;
    color: #333;
}

.vx-calculation-list li {
    margin-bottom: 6px;
}

.vx-btn-red {
    background-color: var(--vx-brand);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    max-width: 300px;
}

.vx-btn-red:hover {
    background-color: var(--vx-brand-dark);
}

.vx-btn-green {
    background-color: #10b981;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
}

.vx-btn-green:hover {
    background-color: #059669;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

/* Lead Card */
/* Lead Card */
.vx-lead-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.08);
    border: 1px solid #f1f5f9;
}

.vx-lead-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.vx-lead-header h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
    color: #111;
}

.vx-help-icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    border: none !important;
    background-color: #fff1f2 !important; /* Soft red bg */
    background-image: none !important;
    color: var(--vx-brand, #e30613) !important; /* Brand red */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* Ensure SVG inside is visible and inherits color */
.vx-help-icon svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    fill: currentColor !important;
}

.vx-help-icon:hover {
    background-color: var(--vx-brand, #e30613) !important; /* Solid brand red on hover */
    color: #ffffff !important; /* White icon on hover */
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(227, 6, 19, 0.25) !important;
}

/* Fix for map tiles showing borders/grid lines */
.leaflet-pane img, .leaflet-tile {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.vx-lead-form label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #111;
    margin-bottom: 12px;
}

.vx-lead-form input {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    background: #f9f9f9;
}

.vx-lead-form input:focus {
    background: white;
    border-color: var(--vx-brand);
    outline: none;
}

/* Cadastral Info Section */
/* Cadastral Info Section */
.vx-cadastral-info-section {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.08);
    border: 1px solid #f1f5f9;
    position: relative;
    margin-top: 24px;
}

.vx-cadastral-header h3 {
    text-align: center;
    font-size: 22px;
    margin: 0 0 24px;
    color: #111;
}

.vx-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.vx-info-card {
    background: #ffffff;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    transition: all 0.2s ease;
}
.vx-info-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(0,0,0,0.06);
}

.vx-info-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.vx-info-value {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #111;
}

.vx-info-toggle-arrow {
    display: flex;
    justify-content: center;
    margin-top: 16px;
    color: #ccc;
    cursor: pointer;
}

@media (max-width: 768px) {
    .vx-result-container {
        flex-direction: column;
    }
    
    .vx-result-right {
        flex: auto;
        width: 100%;
    }
    
    .vx-valuation-price {
        font-size: 36px;
    }
}

/* Locked State */
.vx-result-left {
    position: relative;
}

.vx-res-blur {
    filter: blur(5px);
    opacity: 0.6;
    pointer-events: none;
    user-select: none;
    transition: filter 0.3s, opacity 0.3s;
}

.vx-locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.4);
}

.vx-locked-message {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    text-align: center;
    border: 1px solid #eee;
    max-width: 80%;
}

.vx-lock-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.vx-locked-message p {
    margin: 0;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

/* Unlocked State */
.vx-result-left.unlocked .vx-res-blur {
    filter: none;
    opacity: 1;
    pointer-events: auto;
    user-select: auto;
}

.vx-result-left.unlocked .vx-locked-overlay {
    display: none;
}

/* Modern Select Styling */
.catastro-unit-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 12px 16px;
  padding-right: 40px; /* Space for arrow */
  font-size: 15px;
  font-weight: 500;
  color: #1f2937;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.catastro-unit-select:hover {
  border-color: #9ca3af;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.catastro-unit-select:focus {
  outline: none;
  border-color: #E30613;
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
}

/* Close button styles */
.catastro-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f3f4f6;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 3010;
}
.catastro-close:hover {
    background: #e5e7eb;
    color: #111;
}

/* Confirm actions wrapper */
.catastro-confirm-wrap {
    margin-top: 24px !important;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    width: 100%;
}

.catastro-confirm-wrap button {
    font-weight: 600;
    font-size: 15px;
    padding: 12px 20px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.catastro-confirm-wrap button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(0,0,0,0.1);
}

/* Map Preview in Confirmation Step */
#vx-confirm-map-preview {
    border-radius: 16px;
    box-shadow: 0 10px 30px -5px rgba(0,0,0,0.1);
    border: 1px solid #f1f5f9;
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 16px;
}

/* --- Premium Map UI Overrides (Remaining Unique Styles) --- */


/* Confirmation Step Search */
#vx-confirm-location-search {
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02) !important;
    transition: all 0.2s ease !important;
    color: #0f172a !important;
}
#vx-confirm-location-search:focus {
    border-color: var(--vx-brand) !important;
    box-shadow: 0 0 0 4px var(--vx-brand-shadow) !important;
    outline: none !important;
}

/* Secondary Button (Select on Map) */
#vx-confirm-goto-map {
    background: #ffffff !important;
    color: #334155 !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 12px 20px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02) !important;
}
#vx-confirm-goto-map:hover {
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
}







/* Locked Overlay in Results */
#vx-res-locked-overlay {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 20px;
}
.vx-locked-message {
    background: #fff;
    padding: 24px 32px;
    border-radius: 20px;
    box-shadow: 0 20px 50px -10px rgba(0,0,0,0.15);
    border: 1px solid #f1f5f9;
    text-align: center;
}
.vx-lock-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}
.vx-locked-message p {
    margin: 0;
    font-weight: 600;
    color: #1e293b;
    font-size: 16px;
}

/* Loading State for Confirmation Details */
#vx-confirm-location-details {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 16px !important;
    color: #475569 !important;
    font-size: 14px !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Welcome Modal */
#vx-welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
#vx-welcome-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.vx-welcome-card {
    background: #ffffff;
    width: 90%;
    max-width: 480px;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255,255,255,0.1);
}
#vx-welcome-overlay.visible .vx-welcome-card {
    transform: scale(1);
}

.vx-welcome-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: #fff1f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vx-brand);
}
.vx-welcome-icon svg {
    width: 32px;
    height: 32px;
    stroke-width: 2;
}

.vx-welcome-title {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.vx-welcome-text {
    font-size: 16px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 24px;
}

.vx-welcome-btn {
    background: var(--vx-brand);
    color: #ffffff;
    border: none;
    padding: 14px 32px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px var(--vx-brand-shadow);
    width: 100%;
}
.vx-welcome-btn:hover {
    background: var(--vx-brand-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--vx-brand-shadow-strong);
}

/* Fullscreen Map Fixes */
.catastro-map-wrapper:fullscreen,
.catastro-map-wrapper:-webkit-full-screen,
.catastro-map-wrapper:-moz-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    z-index: 2147483647 !important;
    background: #fff;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

.catastro-map-wrapper:fullscreen #catastro-map,
.catastro-map-wrapper:-webkit-full-screen #catastro-map,
.catastro-map-wrapper:-moz-full-screen #catastro-map {
    height: 100% !important;
    width: 100% !important;
}

/* --- Anti-Theme Protection (Defensive CSS) --- */
/* Ensure map container is isolated from theme layout shifts */
.catastro-map-wrapper {
    all: initial; /* Reset inherited properties */
    display: block;
    position: relative;
    font-family: system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
    /* Re-apply critical styles after reset */
    background: #f8fafc;
    border-radius: 24px;
    overflow: hidden;
    isolation: isolate;
}

/* Protect FAB buttons from theme button styles */
.catastro-fab {
    box-sizing: border-box !important;
    margin: 0 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1 !important;
    text-indent: 0 !important;
    text-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Protect inputs from theme overrides */
.catastro-map-search input {
    box-shadow: none !important;
    text-shadow: none !important;
    margin: 0 !important;
    line-height: normal !important;
}

/* Ensure Leaflet controls stay on top */
.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
    z-index: 1000 !important;
}
.catastro-fab-wrap {
    z-index: 1450 !important; /* Above Leaflet controls */
}
.catastro-map-search {
    z-index: 1450 !important; /* Same level as FAB */
}
/* ===== ESTILOS DEL MODAL DE TRANSPARENCIA ===== */
.catastro-transparency-modal {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(0.95);
width: min(800px, 94%);
max-height: 90vh;
background: #fff;
border-radius: 12px;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
z-index: 10000;
display: flex;
flex-direction: column;
opacity: 0;
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
border: 1px solid rgba(0,0,0,0.1);
overflow: hidden;
}

.catastro-transparency-modal.show {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
}

.catastro-transparency-modal.closing {
opacity: 0;
transform: translate(-50%, -48%) scale(0.95);
}

.catastro-transparency-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 20px;
border-bottom: 1px solid #e5e7eb;
background: #f8fafc;
}

.catastro-transparency-header h3 {
margin: 0;
font-size: 18px;
font-weight: 700;
color: #0f172a;
}

.catastro-transparency-close {
background: none;
border: none;
font-size: 24px;
color: #64748b;
cursor: pointer;
padding: 4px;
line-height: 1;
border-radius: 4px;
}

.catastro-transparency-close:hover {
background: #e2e8f0;
color: #0f172a;
}

.catastro-transparency-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.catastro-api-notice {
background: #eff6ff;
border: 1px solid #bfdbfe;
border-radius: 8px;
padding: 16px;
margin-bottom: 20px;
color: #1e40af;
font-size: 14px;
line-height: 1.5;
}

.catastro-api-notice code {
background: rgba(255,255,255,0.7);
padding: 2px 5px;
border-radius: 4px;
font-family: monospace;
font-size: 13px;
}

.catastro-transparency-section {
margin-bottom: 12px;
border: 1px solid #e5e7eb;
border-radius: 8px;
overflow: hidden;
}

.catastro-transparency-section summary {
padding: 12px 16px;
background: #f8fafc;
cursor: pointer;
font-weight: 600;
color: #334155;
user-select: none;
list-style: none; /* Hide default marker */
display: flex;
justify-content: space-between;
align-items: center;
}

.catastro-transparency-section summary::after {
content: '+';
font-size: 18px;
color: #94a3b8;
}

.catastro-transparency-section[open] summary {
border-bottom: 1px solid #e5e7eb;
}

.catastro-transparency-section[open] summary::after {
content: '−';
}

/* Fix for Webkit marker */
.catastro-transparency-section summary::-webkit-details-marker {
display: none;
}

.catastro-transparency-content .catastro-field-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
margin: 0;
}

.catastro-transparency-content .catastro-field-table tr:not(:last-child) {
border-bottom: 1px solid #f1f5f9;
}

.catastro-transparency-content .catastro-field-table td {
padding: 8px 12px;
vertical-align: top;
}

.catastro-transparency-content .catastro-field-table .field-name {
font-weight: 600;
color: #64748b;
width: 40%;
background: #fcfcfc;
}

.catastro-transparency-content .catastro-field-table .field-value {
color: #0f172a;
font-family: monospace;
}

.catastro-unit-block {
border: 1px solid #f1f5f9;
border-radius: 6px;
margin: 10px;
padding: 12px;
background: #fff;
}

.catastro-unit-block > strong {
display: block;
margin-bottom: 8px;
color: #E30613;
border-bottom: 2px solid #fef2f2;
padding-bottom: 4px;
}

.catastro-transparency-footer {
background: #f8fafc;
padding: 12px 20px;
border-top: 1px solid #e5e7eb;
text-align: center;
color: #64748b;
font-size: 12px;
margin-top: auto;
}

.no-data {
color: #94a3b8;
font-style: italic;
text-align: center;
padding: 10px;
}

/* --- Custom Searchable Dropdown for Units --- */
.catastro-unit-selector-wrapper {
  position: relative;
  width: 100%;
}

.catastro-unit-search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #fff;
  font-size: 14px;
  color: #374151;
  cursor: text;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

.catastro-unit-search-input:focus {
  border-color: var(--vx-brand);
  outline: none;
  box-shadow: 0 0 0 3px var(--vx-brand-outline);
}

.catastro-unit-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 5000;
  max-height: 250px;
  overflow-y: auto;
  display: none;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.catastro-unit-dropdown.open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.catastro-unit-option {
  padding: 10px 12px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.1s ease;
}

.catastro-unit-option:last-child {
  border-bottom: none;
}

.catastro-unit-option:hover, .catastro-unit-option.focused {
  background-color: #f9fafb;
  color: var(--vx-brand);
}

.catastro-unit-option.selected {
  background-color: #eff6ff;
  color: #1e40af;
  font-weight: 500;
}

.catastro-unit-option .unit-meta {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}

.catastro-unit-no-results {
  padding: 12px;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
  font-style: italic;
}

/* Scrollbar for dropdown */
.catastro-unit-dropdown::-webkit-scrollbar {
  width: 6px;
}
.catastro-unit-dropdown::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.catastro-unit-dropdown::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}
.catastro-unit-dropdown::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Enhanced Dropdown: Fixed positioning to overflow modal */
.catastro-unit-dropdown.fixed-mode {
  position: fixed; /* Relative to viewport */
  width: auto; /* Calculate via JS or min-width */
  z-index: 99999; /* Higher than modal (3000) */
  max-height: 50vh; /* Allow large vertical space */
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  border: 1px solid #d1d5db;
}
.catastro-unit-dropdown.fixed-mode .catastro-unit-option {
  padding: 12px 14px; /* More relaxed spacing */
  font-size: 14px;
}

/* --- Dropdown Refinements --- */
.catastro-unit-search-input {
  background-image: none !important; /* Remove background icon in favor of flex icon */
  padding-left: 12px; /* Reset padding if it was high for icon */
}

/* Ensure wrapper visibility on mobile */
.catastro-unit-selector-wrapper {
  z-index: 10001; /* High z-index just in case */
}

/* Mobile optimizations for fixed dropdown */
@media (max-width: 600px) {
  .catastro-unit-dropdown.fixed-mode {
    width: 90vw !important; /* Wider on mobile */
    left: 5vw !important; /* Centered */
    max-height: 40vh; /* Shorter to avoid keyboard */
  }
}

/* FORCE VISIBILITY ON MOBILE */
@media (max-width: 700px) {
  .catastro-unit-selector-wrapper {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    min-height: 44px; /* Ensure touch target height */
    margin-bottom: 20px; /* Space for dropdown */
    background: #fff; /* Ensure contrast */
    border-radius: 8px;
  }
  
  .catastro-unit-search-input {
    display: block !important;
    height: 44px !important; /* Taller on mobile for touch */
    font-size: 16px !important; /* Prevent zoom on iOS */
    opacity: 1 !important;
    visibility: visible !important;
    border: 1px solid #d1d5db !important;
    background: #ffffff !important;
    color: #333 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }
}

/* Global Premium Styles for Unit Selector Input */
.catastro-unit-search-input {
  border: 1px solid #cbd5e1 !important;
  background-color: #f8fafc !important;
  color: #1e293b !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  font-size: 14px !important;
  outline: none !important;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.catastro-unit-search-input:focus {
  border-color: #3b82f6 !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}
/* Ensure the icon is visible and aligned */
.catastro-unit-selector-wrapper svg {
  stroke: #64748b;
  transition: stroke 0.2s;
}
.catastro-unit-selector-wrapper:focus-within svg {
  stroke: #3b82f6;
}

/* CRITICAL: Force unit selector visibility in modal on ALL screen sizes */
#catastro-units {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 50px !important;
  overflow: visible !important;
}

#catastro-units .catastro-unit-selector-wrapper {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  min-height: 44px !important;
}

#catastro-units .catastro-unit-search-input {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  min-height: 40px !important;
  flex: 1 !important;
}

/* Native select fallback (shown on mobile to guarantee visibility) */
.catastro-unit-select-native {
  display: none;
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .catastro-unit-select-native {
    display: block !important;
  }

  #catastro-units .catastro-unit-selector-wrapper {
    margin-bottom: 10px;
  }
}

/* Mobile: Ensure modal doesn't clip unit selector */
@media (max-width: 900px) {
  .catastro-info.modal {
    overflow: visible !important;
  }
  .catastro-info.modal #catastro-units {
    overflow: visible !important;
  }
}

/* MOBILE: Force dropdown visibility when open */
@media (max-width: 900px) {
  .catastro-unit-dropdown.fixed-mode.open {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    z-index: 999999 !important;
    background: #ffffff !important;
    border: 2px solid var(--vx-brand, #E30613) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3) !important;
  }
}

/* Constrain dropdown width on mobile to match modal */
@media (max-width: 900px) {
  .catastro-unit-dropdown.fixed-mode {
    max-width: calc(100vw - 40px) !important; /* Leave margin on sides */
    left: 20px !important;
    right: 20px !important;
    width: auto !important;
  }
}
