/* ═══════════════════════════════════════════════════════════
   LOTIZACIÓN CSS - Compatible iOS · Android · Desktop
   ═══════════════════════════════════════════════════════════ */

/* ─── Hotspot del plano en el suelo ─── */
/* Resolución 2× de la proporción exacta del plano (3178.59×2245.04):
   rasteriza con más píxeles → bordes suaves, sin dientes de sierra */
.lotizacion-hotspot-container {
  position: relative;
  width: 3600px;
  height: 2542.68px;
  transform-origin: center center;
  /* Permite que los hijos participen del espacio 3D real (movimiento XYZ) */
  transform-style: preserve-3d;
  /* Anti-aliasing suave */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Wrapper interno: rotación y desplazamiento (lotes-data.js → plano) */
.lotizacion-plano-transform {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

/* Fondo inline del plano (div que contiene el <svg> inyectado) */
.lotizacion-plano-img {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

.lotizacion-plano-img svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.lotizacion-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: all;
}

/* ─── Manzanas en el SVG overlay ─── */
.manzana-group {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lote-path {
  -webkit-tap-highlight-color: transparent;
  transition: fill 0.15s ease;
}

/* ─── Overlay oscuro (fondo panel) ─── */
#overlay-oscuro {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: 900;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#overlay-oscuro.visible {
  display: block;
}

/* ─── Panel de manzana ─── */
#panel-manzana {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100%;
  background: linear-gradient(160deg, #0d1b2a 0%, #112233 100%);
  color: #fff;
  z-index: 1000;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.6);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-direction: column;
  border-left: 1px solid rgba(0, 200, 100, 0.2);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#panel-manzana.visible {
  display: flex;
  transform: translateX(0);
}

/* Mobile: panel a pantalla completa */
@media (max-width: 500px) {
  #panel-manzana {
    width: 100%;
    top: auto;
    bottom: 0;
    height: 75%;
    border-left: none;
    border-top: 1px solid rgba(0, 200, 100, 0.3);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  #panel-manzana.visible {
    display: flex;
    transform: translateY(0);
  }
}

/* ─── Header del panel ─── */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 200, 100, 0.08);
  flex-shrink: 0;
}

.panel-header-info h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: #00ff88;
  letter-spacing: 0.5px;
}

#panel-manzana-total {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
  display: block;
}

.panel-cerrar {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.2s;
}

.panel-cerrar:hover {
  background: rgba(255, 60, 60, 0.3);
}

/* ─── Cuerpo del panel ─── */
.panel-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}

/* ─── Preview SVG de la manzana ─── */
.panel-preview {
  width: 100%;
  aspect-ratio: 1.4 / 1;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-preview svg {
  max-width: 100%;
  max-height: 100%;
}

/* ─── Info del lote seleccionado ─── */
.panel-lote-info {
  margin: 10px 14px 0;
  padding: 10px 14px;
  background: rgba(0, 200, 100, 0.1);
  border: 1px solid rgba(0, 200, 100, 0.3);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.badge-disponible   { color: rgba(255,255,255,0.8); font-weight: 700; }
.badge-reservado    { color: #FFB400; font-weight: 700; }
.badge-vendido      { color: #FF5555; font-weight: 700; }
.badge-nodisponible { color: #6FB7FF; font-weight: 700; }

/* ─── Leyenda ─── */
.panel-leyenda {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  flex-wrap: wrap;
}

.ley-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(255,255,255,0.75);
}

.ley-item::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.ley-disponible::before  { background: transparent;             border: 1px solid #9aa5b1; }
.ley-reservado::before   { background: rgba(255, 180, 0, 0.6);   border: 1px solid #FFB400; }
.ley-vendido::before     { background: rgba(255, 60, 60, 0.6);   border: 1px solid #FF3C3C; }
.ley-nodisponible::before{ background: rgba(41, 128, 185, 0.55); border: 1px solid #2980B9; }

/* ─── Lista de lotes ─── */
.panel-lista-lotes {
  padding: 0 14px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lote-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.15s, border-color 0.15s;
  font-size: 12px;
}

.lote-item:hover,
.lote-item:active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.lote-num {
  color: rgba(255,255,255,0.9);
  font-weight: 500;
}

.lote-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 5px;
  border-radius: 3px;
}

.estado-disponible .lote-badge {
  background: transparent;
  color: rgba(255,255,255,0.85);
}

.estado-reservado .lote-badge {
  background: rgba(255, 180, 0, 0.25);
  color: #FFD700;
}

.estado-vendido .lote-badge {
  background: rgba(255, 60, 60, 0.25);
  color: #FF5555;
}

.estado-nodisponible .lote-badge {
  background: rgba(41, 128, 185, 0.3);
  color: #6FB7FF;
}

/* ─── Botón del plano ─── */
#plano-toggle-btn {
  position: fixed;
  bottom: 70px;
  right: 14px;
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(0, 200, 100, 0.5);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00ff88;
  cursor: pointer;
  z-index: 500;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

#plano-toggle-btn:hover {
  background: rgba(0, 200, 100, 0.2);
  border-color: #00ff88;
  transform: scale(1.05);
}

#plano-toggle-btn:active {
  transform: scale(0.95);
}

#plano-toggle-btn svg {
  pointer-events: none;
}

/* Mobile adjustments */
@media (max-width: 500px) {
  #plano-toggle-btn {
    bottom: 80px;
    right: 10px;
    width: 44px;
    height: 44px;
  }
}

/* ─── Safe area para iOS (notch/home indicator) ─── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #panel-manzana,
  #panel-lote {
    padding-bottom: env(safe-area-inset-bottom);
  }
  #plano-toggle-btn {
    bottom: calc(70px + env(safe-area-inset-bottom));
  }
}

/* ═══════════════════════════════════════════════════════════
   MODO AJUSTE DEL PLANO (mover XYZ + esquinas)
   ═══════════════════════════════════════════════════════════ */

/* Capa de arrastre sobre el plano (solo en modo ajuste) */
.plano-drag-layer {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  cursor: move;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

body.plano-editando .lotizacion-overlay {
  pointer-events: none;
}

body.plano-editando .plano-drag-layer {
  display: block;
}

body.plano-editando .lotizacion-plano-img {
  opacity: 0.92;
}

/* Handles de las 4 esquinas */
.plano-corner {
  display: none;
  position: absolute;
  width: 60px;
  height: 60px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.18);
  border: 3px solid #FFD700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.55), inset 0 0 8px rgba(255, 215, 0, 0.35);
  z-index: 30;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  cursor: nwse-resize;
}

.plano-corner::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22%;
  height: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #FFD700;
}

body.plano-editando .plano-corner {
  display: block;
}

/* ─── Botón ⚙ modo ajuste ─── */
#plano-editar-btn {
  position: fixed;
  bottom: 128px;
  right: 14px;
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFD700;
  cursor: pointer;
  z-index: 500;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

#plano-editar-btn:hover {
  background: rgba(255, 215, 0, 0.18);
  border-color: #FFD700;
  transform: scale(1.05);
}

#plano-editar-btn:active {
  transform: scale(0.95);
}

#plano-editar-btn.activo {
  background: rgba(255, 215, 0, 0.28);
  border-color: #FFD700;
}

#plano-editar-btn svg {
  pointer-events: none;
}

/* ─── Panel del editor ─── */
#plano-editor {
  display: none;
  position: fixed;
  bottom: 10px;
  left: 10px;
  width: min(92vw, 360px);
  max-height: min(70vh, 520px);
  background: linear-gradient(160deg, rgba(13, 27, 42, 0.96), rgba(17, 34, 51, 0.96));
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 14px;
  color: #fff;
  z-index: 1300;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#plano-editor.visible {
  display: block;
}

.pe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #FFD700;
  background: rgba(255, 215, 0, 0.08);
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  position: sticky;
  top: 0;
}

.pe-cerrar {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.pe-cerrar:hover {
  background: rgba(255, 60, 60, 0.35);
}

.pe-cuerpo {
  padding: 10px 14px 14px;
}

.pe-hint {
  margin: 4px 0 10px;
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
}

.pe-fila {
  display: grid;
  grid-template-columns: 108px 1fr 52px;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
}

.pe-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pe-rango {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.pe-rango::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}

.pe-rango::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  background: #FFD700;
  border: 2px solid rgba(0, 0, 0, 0.4);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.pe-rango::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}

.pe-rango::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFD700;
  border: 2px solid rgba(0, 0, 0, 0.4);
}

.pe-val {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: #FFD700;
  font-weight: 600;
}

.pe-botones {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.pe-btn {
  flex: 1;
  padding: 9px 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.15s;
}

.pe-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.pe-btn-primary {
  background: rgba(255, 215, 0, 0.16);
  border-color: rgba(255, 215, 0, 0.55);
  color: #FFD700;
}

.pe-btn-primary:hover {
  background: rgba(255, 215, 0, 0.28);
}

.pe-nota {
  margin: 10px 0 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.45);
}

/* ─── Toast ─── */
#plano-toast {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  max-width: min(88vw, 480px);
  padding: 10px 18px;
  background: rgba(13, 27, 42, 0.95);
  border: 1px solid rgba(255, 215, 0, 0.45);
  border-radius: 24px;
  color: #fff;
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  z-index: 1400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

#plano-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mobile adjustments */
@media (max-width: 500px) {
  #plano-editar-btn {
    bottom: 138px;
    right: 10px;
    width: 44px;
    height: 44px;
  }

  .pe-fila {
    grid-template-columns: 96px 1fr 46px;
  }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #plano-editar-btn {
    bottom: calc(128px + env(safe-area-inset-bottom) * 0.4);
  }
}

/* ═══════════════════════════════════════════════════════════
   PANEL DE DETALLE DE UN SOLO LOTE · diseño claro
   (croquis y medidas se mantienen intactos)
   ═══════════════════════════════════════════════════════════ */

#panel-lote {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100%;
  background: #ffffff;
  color: #2c3e50;
  z-index: 1000;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.28);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-direction: column;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#panel-lote.visible {
  display: flex;
  transform: translateX(0);
}

/* ─── Encabezado (lp-header) ─── */
#panel-lote .lp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #1a2e6e 0%, #233d8f 100%);
  border-bottom: 3px solid #f5c518;
}

#panel-lote .lp-header h3 {
  font-size: 21px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.2px;
}

#panel-lote .lp-close {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.15s;
}

#panel-lote .lp-close:hover { background: rgba(255, 255, 255, 0.25); }
#panel-lote .lp-close:active { transform: scale(0.92); }

/* ─── Cuerpo ─── */
#panel-lote .lp-body {
  flex: 1;
  padding-bottom: 20px;
}

.lp-subtitle {
  margin: 2px 16px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #8a94a6;
}

/* Fila: badge de estado + consulta rápida */
.lp-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px 14px;
}

.lp-status-badge {
  padding: 6px 16px;
  border-radius: 999px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lp-badge-disponible { background: #eef1f4; color: #495057;
                        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.lp-badge-reservado  { background: #f39c12; }
.lp-badge-vendido    { background: #e74c3c; }
.lp-badge-nodisponible { background: #2980b9; }

.ll-btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgb(73 231 68 / 34%);
  color: #128c1e;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.15s;
}

.ll-btn-wa:hover { background: rgb(73 231 68 / 55%); }
.ll-btn-wa:active { transform: scale(0.96); }

.ll-btn-wa svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: #128c1e;
}

/* ─── Divisor y filas etiqueta/valor ─── */
.lp-divider {
  height: 1px;
  background: #e8ecf1;
  margin: 2px 16px 14px;
}

.lp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 16px 14px;
  font-size: 14.5px;
}

.lp-label {
  color: #7b8794;
  font-weight: 600;
}

.lp-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 999px;
  background: #bcddff;
  color: #1f2d3d;
  font-weight: 800;
  line-height: 1;
}

/* Mobile: hoja inferior a pantalla completa */
@media (max-width: 500px) {
  #panel-lote {
    width: 100%;
    top: auto;
    bottom: 0;
    height: 75%;
    border-left: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  #panel-lote.visible {
    display: flex;
    transform: translateY(0);
  }
}

/* ─── Croquis del lote (fondo blanco, marco azul) ─── */
.panel-lote-croquis {
  margin: 0 14px;
  background: #ffffff;
  border: 5px solid rgb(0 15 133);
  border-radius: 10px;
  padding: 6px;
}

.croquis-vacio {
  padding: 30px 10px;
  text-align: center;
  color: #8a94a6;
  font-size: 13px;
}

/* ─── Sin datos ─── */
.lote-sin-datos {
  margin: 16px 14px;
  padding: 18px 16px;
  background: rgba(243, 156, 18, 0.09);
  border: 1px dashed rgba(243, 156, 18, 0.55);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  color: #5a6672;
}

.lote-sin-datos strong { color: #1f2d3d; }

.lote-sin-datos .hint {
  font-size: 11px;
  color: #98a2ae;
}

/* ═══════════════════════════════════════════════════════════
   BOTÓN DE WHATSAPP (visible para compradores)
   ═══════════════════════════════════════════════════════════ */

#whatsapp-btn {
  position: fixed;
  bottom: 70px;
  left: 14px;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(37, 211, 102, 0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

#whatsapp-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 0 5px rgba(37, 211, 102, 0.3);
}

#whatsapp-btn:active {
  transform: scale(0.94);
}

#whatsapp-btn svg {
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

@media (max-width: 500px) {
  #whatsapp-btn {
    bottom: 80px;
    left: 10px;
    width: 52px;
    height: 52px;
  }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #whatsapp-btn {
    bottom: calc(70px + env(safe-area-inset-bottom));
  }
}

/* ═══════════════════════════════════════════════════════════
   DETALLES DEL LOTE · precio establecido (visible compradores)
   ═══════════════════════════════════════════════════════════ */

.cotizador-title {
  margin: 0 16px 12px;
  font-size: 15.5px;
  font-weight: 800;
  color: #1f2d3d;
}

.cot-contado-box {
  margin: 0 16px 14px;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  overflow: hidden;
  background: #fafbfd;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.cot-contado-header {
  padding: 10px 14px;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.cot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px dashed #e3e8ef;
  font-size: 13.5px;
}

.cot-row-label {
  color: #7b8794;
  font-weight: 600;
}

.cot-row-value--blue {
  color: #2980b9;
  font-weight: 800;
}

.cot-contado-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
}

.cot-contado-label {
  color: #7b8794;
  font-size: 13.5px;
  font-weight: 600;
}

.cot-contado-value {
  font-size: 22px;
  font-weight: 800;
  color: #27ae60;
  line-height: 1;
}

/* Botón grande de WhatsApp */
.cot-wa-btn {
  margin: 0 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 3px 14px rgba(37, 211, 102, 0.35);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.15s, transform 0.15s;
}

.cot-wa-btn:hover { filter: brightness(1.08); }
.cot-wa-btn:active { transform: scale(0.98); }

.cot-wa-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ─── Pie del panel (mensaje final) ─── */
.lp-footer {
  margin: 0 16px 6px;
}

.lp-footer-titulo {
  color: #f39c12;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.lp-footer-sub {
  font-size: 0.75rem;
  color: #666;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════
   MODO ADMINISTRADOR · botón 🔑 · login · edición de lotes
   ═══════════════════════════════════════════════════════════ */

#admin-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(140, 140, 150, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  z-index: 520;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s;
}

#admin-btn:hover {
  opacity: 1;
  background: rgba(140, 140, 150, 0.4);
}

#admin-btn.activo {
  opacity: 1;
  background: rgba(80, 170, 255, 0.35);
  border-color: rgba(120, 190, 255, 0.55);
  color: #d6ecff;
}

#admin-btn svg {
  pointer-events: none;
  width: 15px;
  height: 15px;
}

@media (max-width: 500px) {
  #admin-btn {
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
  }
}

@supports (top: env(safe-area-inset-top)) {
  #admin-btn {
    top: calc(10px + env(safe-area-inset-top));
  }
}

/* ─── Modal de acceso ─── */
#admin-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1500;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

#admin-modal.visible {
  display: flex;
}

.admin-card {
  position: relative;
  width: min(88vw, 320px);
  background: linear-gradient(160deg, #0d1b2a 0%, #112233 100%);
  border: 1px solid rgba(80, 170, 255, 0.4);
  border-radius: 14px;
  padding: 22px 20px 20px;
  color: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
}

.admin-card h3 {
  margin: 0 0 14px;
  font-size: 15px;
  letter-spacing: 1px;
  color: #6fb7ff;
  text-align: center;
}

.admin-cerrar {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.admin-cerrar:hover {
  background: rgba(255, 60, 60, 0.35);
}

#admin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#admin-form input {
  width: 100%;
  padding: 11px 13px;
  font-size: 14px;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

#admin-form input:focus {
  border-color: #6fb7ff;
  box-shadow: 0 0 0 2px rgba(80, 170, 255, 0.25);
}

.admin-enviar,
.admin-logout {
  width: 100%;
  padding: 11px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(135deg, #2f7fd6, #22558f);
  border: 1px solid rgba(120, 190, 255, 0.5);
  border-radius: 9px;
  cursor: pointer;
  touch-action: manipulation;
  transition: filter 0.15s;
}

.admin-enviar:hover { filter: brightness(1.15); }
.admin-enviar:disabled { opacity: 0.6; }

.admin-vista-sesion p {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
}

.admin-logout {
  background: rgba(255, 60, 60, 0.16);
  border-color: rgba(255, 100, 100, 0.5);
}

/* Vista según sesión */
body.modo-admin #admin-modal .admin-vista-login { display: none; }
body:not(.modo-admin) #admin-modal .admin-vista-sesion { display: none; }

/* Defensa extra: sin sesión admin nunca se ven controles de edición */
body:not(.modo-admin) .admin-box,
body:not(.modo-admin) .admin-select-estado { display: none !important; }

/* ─── Editor dentro del panel del lote ─── */
.admin-box {
  margin: 14px 14px 18px;
  padding: 12px 14px 14px;
  background: linear-gradient(160deg, rgba(47, 127, 214, 0.12), rgba(34, 85, 143, 0.08));
  border: 1px dashed rgba(80, 170, 255, 0.5);
  border-radius: 10px;
}

.admin-box-titulo {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #6fb7ff;
  margin-bottom: 10px;
}

.admin-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.admin-fila label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.admin-box select,
.admin-box input[type="number"] {
  flex: 1;
  max-width: 170px;
  padding: 8px 10px;
  font-size: 13px;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  outline: none;
}

.admin-box select:focus,
.admin-box input[type="number"]:focus {
  border-color: #6fb7ff;
}

.admin-guardar-btn {
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(135deg, #2f7fd6, #22558f);
  border: 1px solid rgba(120, 190, 255, 0.5);
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
  transition: filter 0.15s;
}

.admin-guardar-btn:hover { filter: brightness(1.15); }
.admin-guardar-btn:disabled { opacity: 0.6; }

/* Selector rápido por lote en la lista de la manzana */
.lote-item .admin-select-estado {
  padding: 3px 4px;
  font-size: 9.5px;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(80, 170, 255, 0.45);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

/* ─── Editor de WhatsApp general (solo admin, dentro del modal) ─── */
.admin-wa {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(80, 170, 255, 0.25);
  text-align: left;
}

.admin-wa-titulo {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #6fb7ff;
  margin-bottom: 9px;
}

.admin-wa input,
.admin-wa textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  resize: vertical;
  -webkit-appearance: none;
  appearance: none;
}

.admin-wa input:focus,
.admin-wa textarea:focus {
  border-color: #6fb7ff;
}

.admin-enviar-wa {
  background: linear-gradient(135deg, #25D366, #128C7E);
  border-color: rgba(37, 211, 102, 0.5);
}

/* ═══════════════════════════════════════════════════════════
   ADMIN DENTRO DEL PANEL CLARO DEL LOTE (solo sesión admin)
   ═══════════════════════════════════════════════════════════ */

#panel-lote .admin-box {
  background: linear-gradient(160deg, #0d1b2a 0%, #112233 100%);
  border: 1px dashed rgba(80, 170, 255, 0.5);
}
