/* =====================================================================
   Condado Santa Lucía · Ajustes propios del paquete PHP
   Se carga después de base.css (diseño original compilado) y sólo añade
   lo necesario para el plano interactivo, el panel de administración y
   la protección contra textos desbordados.
   ===================================================================== */

:root {
  --csl-ink: #173b34;
  --csl-ink-soft: #55776f;
  --csl-cream: #f8f3e7;
  --csl-gold: #e8c46d;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  min-width: 320px;
  font-variant-numeric: lining-nums;
}

img,
video,
svg {
  max-width: 100%;
}

/* Ningún texto largo debe romper el diseño */
h1, h2, h3, h4, p, li, td, th, dd, dt, span, a, label, strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.prose-csl p,
.prose-csl li {
  margin-bottom: 0.9rem;
  line-height: 1.8;
}

/* Accesibilidad: foco visible y salto de contenido */
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--csl-gold);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: #173b34;
  color: #fff8e8;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 0.75rem 0;
}
.skip-link:focus {
  left: 0;
}

/* ---------------------------------------------------------------------
   Portada
   --------------------------------------------------------------------- */
.cover-video-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 26, 23, 0.45) 0%, rgba(4, 26, 23, 0.28) 42%, rgba(4, 26, 23, 0.72) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .cover-video {
    display: none;
  }
  #inicio {
    background-image: url("../img/timelapse-poster.jpg");
    background-size: cover;
    background-position: center;
  }
}

/* ---------------------------------------------------------------------
   Plano interactivo de terrenos
   --------------------------------------------------------------------- */
.plan-shell {
  position: relative;
  border-radius: 1.5rem;
  border: 1px solid rgba(26, 73, 63, 0.16);
  background: #e9e2d2;
  box-shadow: 0 24px 60px -32px rgba(12, 42, 36, 0.55);
  overflow: hidden;
}

.plan-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  touch-action: pan-x pan-y;
  background: #e9e2d2;
}

.plan-stage {
  position: relative;
  transform-origin: 0 0;
  transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform;
}

.plan-stage img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

#plan-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#plan-markers .plan-plot {
  pointer-events: auto;
}

.plan-plot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: clamp(12px, 1.6%, 16px);
  height: clamp(12px, 1.6%, 16px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.plan-plot-dot {
  display: block;
  width: clamp(5px, 0.58%, 7px);
  height: clamp(5px, 0.58%, 7px);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 2px rgba(6, 30, 25, 0.75);
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 160ms;
}

.plan-plot:hover .plan-plot-dot,
.plan-plot:focus-visible .plan-plot-dot {
  transform: scale(2.1);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 0 14px 4px rgba(232, 196, 109, 0.65);
}

.plan-plot.is-active .plan-plot-dot {
  transform: scale(2.3);
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(232, 196, 109, 0.9);
}

.plan-plot.is-dimmed {
  opacity: 0.22;
}

.plan-plot.is-match .plan-plot-dot {
  box-shadow: 0 0 0 3px #fff, 0 0 0 7px rgba(232, 196, 109, 0.85), 0 0 17px 6px rgba(232, 196, 109, 0.55);
}

.plan-plot[data-state="disponible"] .plan-plot-dot { background: #1d6b47; }
.plan-plot[data-state="reserva"] .plan-plot-dot { background: #b98a00; }
.plan-plot[data-state="vendido"] .plan-plot-dot { background: #a3302c; }

.plan-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(6, 30, 25, 0.4);
}

.plan-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(26, 73, 63, 0.18);
  background: rgba(252, 247, 235, 0.94);
  padding: 0.3rem;
  box-shadow: 0 8px 20px -12px rgba(6, 30, 25, 0.6);
  backdrop-filter: blur(6px);
}

.plan-tool {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.6rem;
  color: var(--csl-ink);
  transition: background 150ms, color 150ms;
}

.plan-tool:hover {
  background: rgba(23, 59, 52, 0.1);
  color: #0f302c;
}

.plan-hint {
  position: absolute;
  left: 50%;
  bottom: 0.75rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(8, 34, 31, 0.72);
  color: #f7f3e7;
  padding: 0.35rem 0.9rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

@media (max-width: 640px) {
  .plan-hint {
    font-size: 0.55rem;
    letter-spacing: 0.06em;
  }
}

.plan-tooltip {
  position: absolute;
  z-index: 40;
  transform: translate(-50%, -130%);
  border-radius: 0.6rem;
  background: #08221f;
  color: #fdf8ec;
  padding: 0.3rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.7);
}

/* Fichas de lote en la lista */
.lot-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(26, 73, 63, 0.16);
  background: #fff;
  padding: 0.85rem 0.95rem;
  text-align: left;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
  min-width: 0;
}

.lot-card:hover {
  border-color: rgba(232, 196, 109, 0.9);
  box-shadow: 0 12px 24px -18px rgba(12, 42, 36, 0.8);
  transform: translateY(-1px);
}

.lot-card.is-active {
  border-color: #173b34;
  box-shadow: 0 0 0 2px rgba(23, 59, 52, 0.15);
}

/* ---------------------------------------------------------------------
   Formularios
   --------------------------------------------------------------------- */
.field {
  display: block;
}

.field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--csl-ink-soft);
}

.field-input {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(26, 73, 63, 0.24);
  background: #fff;
  padding: 0.7rem 0.85rem;
  font-size: 0.9rem;
  color: var(--csl-ink);
  transition: border-color 150ms, box-shadow 150ms;
}

.field-input::placeholder {
  color: rgba(85, 119, 111, 0.7);
}

.field-input:focus {
  outline: none;
  border-color: #173b34;
  box-shadow: 0 0 0 3px rgba(232, 196, 109, 0.35);
}

textarea.field-input {
  min-height: 7rem;
  resize: vertical;
}

.form-error {
  border-radius: 0.7rem;
  background: #f8e3e2;
  color: #8c231f;
  padding: 0.7rem 0.9rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.form-ok {
  border-radius: 0.7rem;
  background: #e6f4ec;
  color: #1d6b47;
  padding: 0.7rem 0.9rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

/* ---------------------------------------------------------------------
   Panel de administración
   --------------------------------------------------------------------- */
.admin-body {
  background: #f1ece0;
  color: var(--csl-ink);
  min-height: 100vh;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  background: #0f302c;
  color: #f4efe2;
  padding: 1.5rem 1rem;
}

.admin-main {
  min-width: 0;
  padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 3rem;
}

/* Las tablas anchas deben desplazarse dentro de su tarjeta, nunca estirar la rejilla */
.admin-main .grid > *,
.admin-main > section,
.admin-main .admin-card {
  min-width: 0;
}

.admin-card {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid rgba(26, 73, 63, 0.12);
  box-shadow: 0 18px 40px -34px rgba(12, 42, 36, 0.7);
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 1rem;
}

.admin-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.admin-table thead th {
  background: #f6f2e6;
  text-align: left;
  padding: 0.75rem 0.9rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #55776f;
  white-space: nowrap;
}

.admin-table tbody td {
  padding: 0.7rem 0.9rem;
  border-top: 1px solid rgba(26, 73, 63, 0.1);
  vertical-align: top;
}

.admin-table tbody tr:hover {
  background: rgba(232, 196, 109, 0.08);
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-radius: 0.7rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(244, 239, 226, 0.75);
  transition: background 150ms, color 150ms;
}

.admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f4d073;
}

.admin-nav-link.is-current {
  background: rgba(244, 208, 115, 0.16);
  color: #f4d073;
}

.stat-card {
  border-radius: 1rem;
  background: #fff;
  border: 1px solid rgba(26, 73, 63, 0.12);
  padding: 1rem 1.15rem;
  min-width: 0;
}

.stat-value {
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  line-height: 1.1;
  color: var(--csl-ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 0.7rem;
  padding: 0.6rem 1rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 140ms, background 140ms, color 140ms, border-color 140ms;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #173b34;
  color: #fff8e8;
}
.btn-primary:hover { background: #28594e; }

.btn-gold {
  background: #f4d073;
  color: #173c35;
}
.btn-gold:hover { background: #ffe49a; }

.btn-outline {
  border: 1px solid rgba(23, 59, 52, 0.3);
  color: #173b34;
}
.btn-outline:hover { background: rgba(23, 59, 52, 0.06); }

.btn-danger {
  border: 1px solid rgba(163, 48, 44, 0.35);
  color: #8c231f;
}
.btn-danger:hover { background: #f8e3e2; }

/* ---------------------------------------------------------------------
   Responsive del panel
   --------------------------------------------------------------------- */
.admin-toggle {
  display: none;
}
@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-sidebar {
    position: static;
    height: auto;
    padding: 1rem;
  }
  .admin-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
  }
  .admin-brand > p {
    margin-top: 0;
    flex: 1;
    min-width: 0;
  }
  .admin-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.65rem;
    padding: 0.5rem 0.8rem;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #f4efe2;
  }
  .admin-sidebar nav,
  .admin-user,
  .admin-links {
    display: none;
    flex-basis: 100%;
    margin-top: 0.75rem;
  }
  body.admin-nav-open .admin-sidebar nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.25rem;
  }
  body.admin-nav-open .admin-user,
  body.admin-nav-open .admin-links {
    display: block;
  }
  .admin-main {
    padding: 1rem 0.9rem 2.5rem;
  }
}


/* Impresión de fichas */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}

/* Mostrar / ocultar contraseña en el acceso */
.password-wrap {
  position: relative;
}
.password-wrap .password-input {
  padding-right: 3.1rem;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #55776f;
  cursor: pointer;
  transition: color 160ms, background-color 160ms;
}
.password-toggle:hover,
.password-toggle:focus-visible {
  color: #173b34;
  background: rgba(23, 59, 52, 0.08);
}
.password-toggle svg {
  width: 1.2rem;
  height: 1.2rem;
}
.password-toggle .icon-eye-off {
  display: none;
}
.password-toggle[aria-pressed="true"] .icon-eye {
  display: none;
}
.password-toggle[aria-pressed="true"] .icon-eye-off {
  display: block;
}
