/* === BASE === */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #ede7dc;
  --surface: #f7f4ed;
  --surface-alt: #f1ece1;
  --ink: #2b2926;
  --ink-soft: #57514b;
  --ink-muted: #6e665e;
  --line: #ddd6ca;
  --accent: #8a6a3b;
  --accent-soft: #efe6d2;
  --shadow: 0 10px 40px rgba(43, 41, 38, .07);
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -.5px;
  margin: 0 0 24px;
  line-height: 1.1;
}

h1 { font-size: clamp(40px, 6vw, 64px); }
h2 { font-size: clamp(28px, 4vw, 40px); }
h3 { font-size: clamp(18px, 2vw, 22px); margin-bottom: 12px; }

p { margin: 0 0 16px; color: var(--ink-soft); font-size: 16px; }

/* === TOPBAR === */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(237, 231, 220, .92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-mark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: .5px;
  color: var(--ink);
}

.lang-switcher {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}

.lang-switcher button {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-muted);
  transition: background .2s, color .2s;
}

.lang-switcher button:hover { color: var(--ink); }

.lang-switcher button.active {
  background: var(--ink);
  color: var(--surface);
}

/* === HERO === */
.hero {
  max-width: 1240px;
  margin: 32px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  box-shadow: var(--shadow);
}

.hero-image {
  padding: 24px;
  border-right: 1px solid var(--line);
}

.hero-image img {
  width: 100%;
  height: 100%;
  min-height: 480px;
  object-fit: cover;
  border-radius: 16px;
}

.hero-content {
  padding: 56px 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow,
.section-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 18px;
}

.section-eyebrow { margin-bottom: 12px; }

.lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 32px;
  max-width: 520px;
}

.lead-narrow {
  max-width: 720px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 32px;
}

/* Stats */
.stats {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
  max-width: 480px;
}

.stat {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface-alt);
  border-radius: 12px;
  border: 1px solid var(--line);
}

.stat.highlight {
  background: var(--accent-soft);
  border-color: #e2d4ad;
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}

.stat-note {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* Buttons */
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .3px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .2s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--surface);
}
.btn-primary:hover { background: #1e1c19; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--surface-alt); }

/* === BLOCKS === */
.block {
  max-width: 1240px;
  margin: 32px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 64px 56px;
  box-shadow: var(--shadow);
}

.block.alt { background: var(--surface-alt); }

.block-inner { max-width: 1080px; margin: 0 auto; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 8px;
}

/* Map */
.map-wrap {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 320px;
}

.map-wrap iframe {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
  display: block;
}

/* Opt grid */
.opt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.opt-card {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 26px;
  transition: transform .2s, box-shadow .2s;
}

.opt-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(43,41,38,.08);
}

.opt-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ink);
}

.opt-card p { margin: 0; font-size: 15px; }

.callout {
  background: var(--accent-soft);
  border: 1px solid #e2d4ad;
  border-radius: 16px;
  padding: 28px 32px;
}

.callout h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
}

.callout p { margin: 0; font-size: 16px; }

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.g-item {
  display: block;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  aspect-ratio: 4/3;
  background: var(--surface-alt);
}

.g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.g-item:hover img { transform: scale(1.04); }

/* Tour placeholder */
.tour-placeholder {
  background: var(--surface-alt);
  border: 2px dashed var(--line);
  border-radius: 20px;
  padding: 64px 32px;
  text-align: center;
  margin-top: 12px;
}

.tour-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.tour-placeholder p {
  max-width: 480px;
  margin: 0 auto 24px;
  font-size: 15px;
}

/* Contact */
.contact .block-inner { text-align: center; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 32px 0 24px;
}

.contact-card {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all .2s;
}

.contact-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.contact-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.contact-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
}

.legal-note {
  font-size: 12px;
  color: var(--ink-muted);
  max-width: 640px;
  margin: 24px auto 0;
  line-height: 1.5;
}

/* === FOOTER === */
footer {
  background: var(--ink);
  color: var(--surface);
  padding: 32px 0;
  margin-top: 32px;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  letter-spacing: .5px;
  opacity: .85;
}

/* === RESPONSIVE === */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    margin: 16px;
  }
  .hero-image { border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-image img { min-height: 340px; }
  .hero-content { padding: 36px 28px; }
  .block { padding: 44px 28px; margin: 16px; border-radius: 20px; }
  .two-col { grid-template-columns: 1fr; gap: 24px; }
  .opt-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .topbar-inner { padding: 14px 20px; }
  .footer-inner { padding: 0 20px; flex-direction: column; gap: 6px; text-align: center; }
}

@media (max-width: 540px) {
  .gallery { grid-template-columns: 1fr; }
  .lang-switcher button { padding: 6px 10px; font-size: 11px; }
  .hero-content { padding: 28px 22px; }
}

/* === ADDRESSES SUBHEAD === */
.addresses {
  font-size: 14px;
  color: var(--ink-soft);
  margin: -8px 0 22px;
  letter-spacing: .2px;
}
.addresses strong { color: var(--ink); font-weight: 600; }

/* === PLANS placeholder (reuses tour-placeholder pattern) === */
.plans-placeholder {
  background: var(--surface-alt);
  border: 2px dashed var(--line);
  border-radius: 20px;
  padding: 64px 32px;
  text-align: center;
  margin-top: 12px;
}
.plans-icon {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--surface);
  font-size: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.plans-placeholder p {
  max-width: 480px;
  margin: 0 auto 24px;
  font-size: 15px;
}

/* === GALLERY override for large galleries (4 cols on desktop) === */
.gallery {
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.g-item {
  cursor: zoom-in;
}
@media (max-width: 960px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

/* === LIGHTBOX === */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, .94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.lightbox.open { display: flex; }

.lb-stage {
  max-width: 95vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-stage img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  background: rgba(247, 244, 237, .12);
  color: #f7f4ed;
  border: 1px solid rgba(247, 244, 237, .2);
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  transition: background .2s, transform .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
  background: rgba(247, 244, 237, .25);
}

.lb-close {
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  font-size: 30px;
  line-height: 1;
}

.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  font-size: 40px;
  line-height: 1;
}
.lb-prev { left: 24px; }
.lb-next { right: 24px; }

.lb-prev:hover { transform: translateY(-50%) translateX(-2px); }
.lb-next:hover { transform: translateY(-50%) translateX(2px); }

.lb-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #f7f4ed;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.5px;
  background: rgba(20, 18, 14, .5);
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(247, 244, 237, .15);
}

body.lb-open { overflow: hidden; }

@media (max-width: 540px) {
  .lb-close { top: 16px; right: 16px; width: 40px; height: 40px; font-size: 24px; }
  .lb-prev, .lb-next { width: 44px; height: 44px; font-size: 30px; }
  .lb-prev { left: 12px; }
  .lb-next { right: 12px; }
}


/* === HERO MEDIA: clic → galería + accesos rápidos (estilo Idealista) === */
.hero-media {
  position: relative;
  display: block;
  cursor: pointer;
  border-radius: 16px;
  overflow: hidden;
}
.hero-media img { border-radius: 16px; }
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.28) 0%, rgba(0,0,0,0) 26%, rgba(0,0,0,0) 58%, rgba(0,0,0,.42) 100%);
  pointer-events: none;
}
.hero-quick {
  position: absolute;
  top: 14px; left: 14px; right: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 2;
}
.hq-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(247,244,237,.92);
  color: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .2px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: background .2s, transform .2s;
}
.hq-chip:hover { background: #fff; transform: translateY(-1px); }
.hq-ico { font-size: 13px; line-height: 1; }
.hero-expand {
  position: absolute;
  bottom: 14px; right: 14px;
  z-index: 2;
  background: rgba(43,41,38,.78);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .3px;
  padding: 8px 14px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* === PLANO imagen === */
.plan-image {
  display: block;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  padding: 16px;
  cursor: zoom-in;
  transition: border-color .2s;
}
.plan-image:hover { border-color: var(--accent); }
.plan-image img { width: 100%; border-radius: 8px; }

/* === TOUR Matterport iframe === */
.tour-frame {
  margin-top: 12px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 10;
  background: var(--surface-alt);
}
.tour-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.video-frame {
  margin-top: 12px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  aspect-ratio: 16 / 9;
}
.video-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 540px) {
  .hq-chip { padding: 7px 11px; font-size: 11.5px; }
  .hero-expand { font-size: 11px; padding: 7px 11px; }
}
