/* ============================================================
   Mareas del Sur — Site layout & component styles
   Requires: styles/styles.css (design tokens)
   ============================================================ */

html { scroll-behavior: smooth; }

/* ---- Layout ---- */

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}

/* ---- SVG icons ---- */

/* Ensure all icon SVGs render with the correct stroke style.
   CSS overrides presentation attributes, so this works even through <use> shadow DOM. */
.icon,
.feature-card__icon svg,
.req-item__check svg,
.success-state__icon svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn--sm { padding: 8px 16px; font-size: 13px; }
.btn--lg { padding: 15px 28px; font-size: 15px; }
.btn--full { width: 100%; justify-content: center; }

.btn--primary {
  background: var(--mds-blue-700);
  color: #fff;
  border-color: var(--mds-blue-700);
}
.btn--primary:hover {
  background: var(--mds-blue-800);
  border-color: var(--mds-blue-800);
  box-shadow: var(--shadow-md);
  color: #fff;
  text-decoration: none;
}

.btn--accent {
  background: var(--mds-gold-500);
  color: var(--mds-blue-900);
  border-color: var(--mds-gold-500);
}
.btn--accent:hover {
  background: var(--mds-gold-600);
  border-color: var(--mds-gold-600);
  box-shadow: var(--shadow-accent);
  color: var(--mds-blue-900);
  text-decoration: none;
}

.btn--inverse {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}
.btn--inverse:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.9);
  color: #fff;
  text-decoration: none;
}

/* ---- Section head ---- */

.section-head { margin-bottom: 48px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.eyebrow--center { justify-content: center; }

.eyebrow__tick {
  display: block;
  width: 28px;
  height: 1.5px;
  background: var(--mds-gold-600);
  flex-shrink: 0;
}

.eyebrow__label {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mds-gold-800);
}

.eyebrow--dark .eyebrow__label { color: var(--mds-gold-300); }

.section-head h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3.5vw, 2.7rem);
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.015em;
  color: var(--mds-blue-800);
}

.section-head--dark h2 { color: #fff; }

.section-head p {
  margin: 16px 0 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-muted);
}
.section-head--dark p { color: rgba(255, 255, 255, 0.78); }

/* ---- Site Header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom-color: var(--border-subtle);
}

.site-header__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px clamp(20px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Logo swap: white over hero, color when scrolled */
.header-logo { height: 38px; display: block; }
.logo--white { display: block; }
.logo--color { display: none; }
.site-header.scrolled .logo--white { display: none; }
.site-header.scrolled .logo--color { display: block; }

/* Nav */
.site-nav { display: flex; gap: 30px; }

.site-nav a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  transition: color 0.3s, opacity 0.2s;
}
.site-nav a:hover { opacity: 0.75; text-decoration: none; }
.site-header.scrolled .site-nav a { color: var(--mds-blue-800); }

/* Phone link */
.site-phone {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: #fff;
  text-decoration: none;
  transition: color 0.3s, opacity 0.2s;
}
.site-phone:hover { opacity: 0.75; text-decoration: none; }
.site-header.scrolled .site-phone { color: var(--mds-blue-700); }

.header-actions { display: flex; align-items: center; gap: 12px; }

/* Header CTA: inverse over hero, primary when scrolled */
.btn--header-cta {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}
.btn--header-cta:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.9);
  color: #fff;
  text-decoration: none;
}
.site-header.scrolled .btn--header-cta {
  background: var(--mds-blue-700);
  color: #fff;
  border-color: var(--mds-blue-700);
}
.site-header.scrolled .btn--header-cta:hover {
  background: var(--mds-blue-800);
  border-color: var(--mds-blue-800);
  box-shadow: var(--shadow-md);
}

/* ---- Hero ---- */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  margin-top: -72px; /* pulled up so the transparent header overlaps */
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 44, 59, 0.55) 0%,
    rgba(10, 44, 59, 0.15) 38%,
    rgba(10, 44, 59, 0.85) 100%
  );
}

.hero__content {
  position: relative;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px) clamp(48px, 7vw, 96px);
}

.hero__body { max-width: 760px; }

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.hero__tick {
  display: block;
  width: 34px;
  height: 1.5px;
  background: var(--mds-gold-400);
  flex-shrink: 0;
}

.hero__location {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mds-gold-300);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: #fff;
}

.hero__lead {
  margin-top: 22px;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.9);
  max-width: 580px;
}

.hero__ctas {
  display: flex;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* ---- Stat strip ---- */

.stat-strip { background: var(--mds-blue-700); }

.stat-strip__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px clamp(20px, 4vw, 48px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 28px;
}

.stat-item { display: flex; flex-direction: column; gap: 4px; }

.stat-item__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 32px;
  color: #fff;
  line-height: 1;
}

.stat-item__label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--mds-gold-300);
}

.stat-item__sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

/* ---- Benefits ---- */

.benefits {
  padding: clamp(64px, 9vw, 120px) clamp(20px, 4vw, 48px);
  background: var(--surface-page);
}

.benefits__inner { max-width: 1240px; margin: 0 auto; }

.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  transition:
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}
.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.feature-card__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--mds-gold-100);
  color: var(--mds-blue-700);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--mds-blue-800);
}

.feature-card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---- Lots ---- */

.lots {
  padding: clamp(64px, 9vw, 120px) clamp(20px, 4vw, 48px);
  background: #fff;
}

.lots__inner { max-width: 1240px; margin: 0 auto; }

.lots__header {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
}
.lots__header .section-head { margin-bottom: 0; }

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: 1px solid var(--border-default);
  background: #fff;
  color: var(--mds-blue-700);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-chip:hover,
.filter-chip.is-active {
  background: var(--mds-blue-700);
  border-color: var(--mds-blue-700);
  color: #fff;
}

.lot-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
}

/* Lot card */
.lot-card {
  background: #fff;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}
.lot-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.lot-card__img-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.lot-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
  display: block;
}
.lot-card:hover .lot-card__img-wrap img { transform: scale(1.05); }

/* Status badge */
.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.badge--accent  { background: var(--mds-gold-500);    color: var(--mds-blue-900); }
.badge--gold    { background: var(--mds-gold-300);    color: var(--mds-gold-800); }
.badge--success { background: var(--mds-success-soft); color: var(--mds-success); }

.lot-card__body { padding: 24px; }

.lot-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.lot-card__id {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  color: var(--mds-blue-800);
  text-transform: uppercase;
}

.lot-card__size {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--mds-gold-800);
}

.lot-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.lot-card__chip {
  background: var(--mds-sand-100);
  color: var(--text-body);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.lot-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.lot-card__pricing { display: flex; flex-direction: column; gap: 2px; }

.lot-card__price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  color: var(--mds-blue-700);
  line-height: 1;
}

.lot-card__monthly { font-size: 12px; color: var(--text-muted); }

/* ---- Location ---- */

.location { background: var(--mds-blue-800); color: #fff; }

.location__grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

.location__panel {
  padding: clamp(56px, 7vw, 104px) clamp(20px, 4vw, 72px);
}

.location__distances {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  max-width: 460px;
  margin-bottom: 40px;
}

.dist-item { display: flex; gap: 14px; align-items: flex-start; }

.dist-item__icon { margin-top: 2px; color: var(--mds-gold-400); flex-shrink: 0; }

.dist-item__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  color: #fff;
  line-height: 1;
}

.dist-item__label {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 5px;
}

.location__photo { position: relative; min-height: 420px; }

.location__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Financing ---- */

.financing {
  padding: clamp(64px, 9vw, 120px) clamp(20px, 4vw, 48px);
  background: var(--surface-page);
}

.financing__inner {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.requirements {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.req-item { display: flex; align-items: center; gap: 12px; }

.req-item__check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--mds-gold-300);
  color: var(--mds-blue-800);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.req-item__label { font-size: 15.5px; color: var(--text-body); }

/* Plan card */
.plan-card {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.plan-card__header {
  background: var(--mds-blue-700);
  padding: 26px 30px;
  color: #fff;
}

.plan-card__eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mds-gold-300);
}

.plan-card__price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
}

.plan-card__amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 44px;
  line-height: 1;
}

.plan-card__amount-sub { font-size: 15px; color: rgba(255, 255, 255, 0.75); }

.plan-card__body { padding: 20px 30px 28px; }

.plan-row {
  display: flex;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.plan-row:last-of-type { border-bottom: none; }

.plan-row__label { font-size: 14.5px; color: var(--text-muted); }

.plan-row__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--mds-blue-800);
}

.plan-card__cta { margin-top: 22px; }

/* ---- Contact ---- */

.contact {
  position: relative;
  padding: clamp(64px, 9vw, 120px) clamp(20px, 4vw, 48px);
  background: var(--mds-blue-900);
  overflow: hidden;
}

.contact__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.18;
  pointer-events: none;
}

.contact__inner {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.contact__info { color: #fff; }

.contact__isotype { height: 64px; margin-bottom: 22px; display: block; }

.contact__info h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #fff;
}

.contact__info > p {
  margin: 16px 0 0;
  font-size: 17px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
  max-width: 420px;
}

.contact__links {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 28px;
}

.contact__link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  font-size: 15.5px;
  transition: opacity 0.2s;
}
.contact__link:hover { opacity: 0.8; text-decoration: none; }

.contact__link-icon { color: var(--mds-gold-400); flex-shrink: 0; }

/* Contact form card */
.form-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

/* ---- Form controls ---- */

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-strong);
}

.field input,
.field select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-body);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.field input::placeholder { color: var(--text-subtle); }

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--mds-blue-500);
  box-shadow: var(--focus-ring);
}

/* Custom select arrow */
.select-wrap { position: relative; }

.select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-muted);
  pointer-events: none;
}

.select-wrap select { padding-right: 36px; }

/* Checkbox */
.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.check-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--mds-blue-700);
  cursor: pointer;
}

.check-field span {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.5;
}

/* Form layout (flex column with gap) */
.form-card form,
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---- Success state ---- */

.success-state { text-align: center; padding: 30px 10px; }

.success-state__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--mds-success-soft);
  color: var(--mds-success);
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-state h3 {
  margin: 0 0 8px;
  color: var(--mds-blue-800);
}

.success-state p { margin: 0; color: var(--text-muted); }

/* ---- Footer ---- */

.site-footer {
  background: var(--mds-blue-900);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
}

.site-footer__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px clamp(20px, 4vw, 48px);
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.footer-logo { height: 34px; display: block; }
.site-footer span { font-size: 13px; }

/* ---- Reserve modal ---- */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 44, 59, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  place-items: center;
  padding: 20px;
}
.modal-overlay.is-open { display: grid; }

.modal-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  background: var(--mds-blue-700);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mds-gold-300);
}

.modal-header__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  margin-top: 2px;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }

.modal-body { padding: 26px; }

.modal-note {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-muted);
}

.modal-body form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---- Responsive ---- */

@media (max-width: 860px) {
  .site-nav,
  .site-phone { display: none; }

  .location__grid { grid-template-columns: 1fr; }
  .location__photo { min-height: 280px; }

  .financing__inner { grid-template-columns: 1fr; gap: 40px; }

  .contact__inner { grid-template-columns: 1fr; }
}

/* ================================================================
   Lot Map — #mapa
   ================================================================ */

.lot-map {
  padding: 96px 0;
  background: var(--mds-sand-100);
}

.lot-map__inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---- Legend + filter row ---- */

.map-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1.5px solid transparent;
}

.map-legend__item::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.map-legend__item--disponible  { background: #fff; border-color: #3f7d5b; color: #2d5e42; }
.map-legend__item--disponible::before  { background: #fff; border: 1.5px solid #3f7d5b; }
.map-legend__item--reservado   { background: rgba(192, 138, 46, 0.10); border-color: #c08a2e; color: #8a6120; }
.map-legend__item--reservado::before   { background: rgba(192, 138, 46, 0.70); }
.map-legend__item--vendido     { background: rgba(90, 90, 110, 0.08);  border-color: #5a5a6e; color: #444458; }
.map-legend__item--vendido::before     { background: rgba(90, 90, 110, 0.60); }
.map-legend__item--vendido_ms  { background: rgba(104, 33, 122, 0.08); border-color: #6b217a; color: #55196a; }
.map-legend__item--vendido_ms::before  { background: rgba(104, 33, 122, 0.55); }

/* ---- Phase filter chips ---- */

.map-filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.map-filter-chip {
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  border: 1.5px solid var(--border-default);
  border-radius: 100px;
  background: var(--surface-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color var(--dur-base), background var(--dur-base), color var(--dur-base);
}

.map-filter-chip:hover {
  border-color: var(--mds-blue-700);
  color: var(--mds-blue-700);
}

.map-filter-chip.is-active {
  background: var(--mds-blue-700);
  border-color: var(--mds-blue-700);
  color: #fff;
}

/* ---- Map layout: viewport + sidebar ---- */

.map-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* ---- Scrollable viewport ---- */

.map-viewport {
  overflow: auto;
  max-height: 72vh;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: #dedad3;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
}

.map-viewport:active { cursor: grabbing; }

/* ---- Stage (sized by JS zoom) ---- */

.map-stage {
  position: relative;
  display: inline-block;
  transition: width 0.2s var(--ease-out);
  line-height: 0;
}

.map-base-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
}

/* ---- SVG overlay ---- */

.map-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ---- Hotspot circles ---- */

.map-hs {
  fill:         var(--hs-fill,   rgba(63, 125, 91, 0.40));
  stroke:       var(--hs-stroke, #3f7d5b);
  stroke-width: 0;
  opacity:      0.65;
  cursor:       pointer;
  transition:   opacity 0.15s, stroke-width 0.12s;
}

.map-hs:hover {
  opacity:      0.90;
  stroke-width: 4;
}

.map-hs--selected {
  opacity:      0.95;
  stroke-width: 6;
}

.map-hs.is-dimmed {
  opacity:        0.06;
  pointer-events: none;
}

/* ---- Zoom buttons ---- */

.map-zoom-controls {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.map-zoom-btn {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-body);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-base), border-color var(--dur-base), color var(--dur-base);
}

.map-zoom-btn:hover {
  background: var(--mds-blue-700);
  border-color: var(--mds-blue-700);
  color: #fff;
}

.map-zoom-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.map-zoom-btn:disabled:hover {
  background: var(--surface-card);
  border-color: var(--border-default);
  color: var(--text-body);
}

/* ---- Lot detail panel ---- */

.lot-detail {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.lot-detail__close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-base);
}

.lot-detail__close:hover { background: var(--mds-sand-200); }

.lot-detail__phase {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lot-detail__label {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--mds-blue-700);
  line-height: 1.1;
}

.lot-detail__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 14px;
}

.lot-detail__row-label { color: var(--text-muted); }

.lot-detail__area {
  font-weight: 600;
  color: var(--text-strong);
}

.lot-detail__hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Badge variants for map statuses not covered by global badges */
.badge--muted  { background: #eeeef2; color: #5a5a6e; }
.badge--purple { background: rgba(104, 33, 122, 0.10); color: #55196a; }

/* ---- Responsive: sidebar on large screens ---- */

@media (min-width: 900px) {
  .map-layout {
    grid-template-columns: 1fr 264px;
    grid-template-rows: 1fr auto;
    align-items: start;
  }

  .map-viewport {
    grid-column: 1;
    grid-row: 1;
  }

  .map-zoom-controls {
    grid-column: 1;
    grid-row: 2;
    padding-top: 4px;
  }

  .lot-detail {
    grid-column: 2;
    grid-row: 1 / 3;
    position: sticky;
    top: 90px;
  }
}

/* Keep the panel in the grid but invisible when no lot is selected */
.lot-detail[hidden] {
  display: flex !important;
  visibility: hidden;
}

@media (max-width: 599px) {
  .map-controls { flex-direction: column; align-items: flex-start; }
  .lot-map { padding: 64px 0; }
}
