/* =========================================================
   Bienes Raíces Asociados — estilos
   1. Tokens   2. Base   3. Utilidades   4. Header
   5. Vitrina (filtros + tarjetas)   6. Ventanas flotantes
   7. Secciones: ubicación, nosotros, contacto   8. Footer
   9. Animaciones   10. Responsive
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --navy: #0A2E50;
  --navy-deep: #061E36;
  --sun: #E7C11A;
  --sun-hover: #F2CF2E;
  --ok: #0F7A4D;            /* beneficios: financiación */
  --bg: #EEF2F6;            /* fondo tipo tienda */
  --surface: #FFFFFF;
  --fg: #0E2236;
  --muted: #55677A;
  --line: #DCE3EA;
  --chip: #EAF0F6;
  --on-navy: #F3F6F9;

  --font-display: "Lexend", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;

  --wrap: 1240px;
  --gutter: clamp(16px, 3.5vw, 32px);
  --radius: 12px;
  --section-y: clamp(64px, 8vw, 104px);
  --header-h: 68px;
  --shadow-card: 0 1px 2px rgba(6, 30, 54, .08), 0 2px 8px -4px rgba(6, 30, 54, .12);
  --shadow-hover: 0 18px 38px -18px rgba(6, 30, 54, .45);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- 2. Base ---------- */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
html.modal-open { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.6 var(--font-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -.015em; }
p, figure, dl, dd, fieldset { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }

/* ---------- 3. Utilidades ---------- */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow { font: 600 12px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.eyebrow--sun { color: var(--sun); }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--sun); color: var(--navy-deep); padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: 600 15px/1 var(--font-display); text-decoration: none; white-space: nowrap;
  padding: 14px 22px; border-radius: 999px; border: 0; cursor: pointer;
  transition: transform .25s var(--ease-out), background-color .2s ease, box-shadow .25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--sun { background: var(--sun); color: var(--navy-deep); }
.btn--sun:hover { background: var(--sun-hover); box-shadow: 0 10px 22px -12px rgba(231, 193, 26, .9); }
.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { box-shadow: 0 10px 22px -12px rgba(10, 46, 80, .8); }
.btn--block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--navy); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; justify-self: start; }

/* ---------- 4. Header (secciones + agenda) ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--navy); color: var(--on-navy);
  transition: box-shadow .3s ease;
}
.top.is-scrolled { box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .7); }
.top__inner { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; margin-right: auto; }
.brand__badge { width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.brand__badge img { width: 35px; }
.brand__text { min-width: 0; }
.brand__text b { font: 700 16px/1.15 var(--font-display); display: block; white-space: nowrap; }
.brand__text small { font-size: 12px; opacity: .72; white-space: nowrap; }

.nav { display: flex; gap: 6px; align-items: center; }
.nav a {
  position: relative; text-decoration: none; font-weight: 500; font-size: 15px;
  padding: 8px 14px; border-radius: 999px; opacity: .85;
  transition: opacity .2s ease, background-color .2s ease;
}
.nav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 2px;
  background: var(--sun); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease-out);
}
.nav a:hover { opacity: 1; background: rgba(255, 255, 255, .07); }
.nav a.is-active { opacity: 1; }
.nav a.is-active::after { transform: scaleX(1); }

.top__actions { display: flex; align-items: center; gap: 10px; }
.btn--agenda { padding: 12px 18px; }

.menu-btn { display: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .1); cursor: pointer; position: relative; flex: none; }
.menu-btn span { position: absolute; left: 12px; right: 12px; height: 2px; background: #fff; border-radius: 2px; transition: transform .4s var(--ease-out), top .4s var(--ease-out); }
.menu-btn span:first-child { top: 17px; }
.menu-btn span:last-child { top: 25px; }
.menu-open .menu-btn span:first-child { top: 21px; transform: rotate(45deg); }
.menu-open .menu-btn span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- 5. Vitrina ---------- */
.shop { padding-block: 28px 64px; }
.shop__intro { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 20px; }
.crumbs { width: 100%; font-size: 13px; color: var(--muted); }
.crumbs span { margin-inline: 4px; }
.shop__intro h1 { font-size: clamp(26px, 3vw, 34px); }
.shop__count { color: var(--muted); font-size: 15px; }

.shop__layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }

/* Filtros */
.filters { position: sticky; top: calc(var(--header-h) + 16px); }
.filters__box summary {
  display: none; list-style: none; cursor: pointer;
  align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; font: 600 15px/1 var(--font-display);
}
.filters__box summary::-webkit-details-marker { display: none; }
.filters__badge[hidden] { display: none; }
.filters__badge { background: var(--sun); color: var(--navy-deep); border-radius: 999px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; font-size: 12px; margin-left: 8px; }
.filters__body { display: grid; gap: 22px; }
.filters fieldset { border: 0; padding: 0; min-width: 0; }
.filters legend { font: 600 15px/1.2 var(--font-display); margin-bottom: 10px; padding: 0; }
.opts { display: grid; gap: 2px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; font-size: 15px; }
.opt input { width: 18px; height: 18px; accent-color: var(--navy); margin: 0; flex: none; }
.opt em { margin-left: auto; font-style: normal; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.opt:hover span { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }

.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; transition: border-color .2s ease, box-shadow .2s ease; }
.search:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(10, 46, 80, .12); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { border: 0; outline: 0; background: transparent; padding: 12px 0; width: 100%; min-width: 0; font-size: 15px; }

/* Barra de resultados */
.results { min-width: 0; }
.results__bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-bottom: 16px; }
.chips-scroll { display: none; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding-block: 2px; }
.chips-scroll::-webkit-scrollbar { display: none; }
.zchip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.zchip.is-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); flex: none; }
.sort select { border: 0; background: transparent; font-weight: 600; color: var(--navy); cursor: pointer; padding: 6px 2px; }

/* Tarjetas (estilo tienda) */
.listing { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.listing > li { display: flex; }
.card {
  position: relative; display: flex; flex-direction: column; width: 100%;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; box-shadow: var(--shadow-card);
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card__img { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--chip); }
.card__img img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform 1.1s var(--ease-out); }
.card:hover .card__img img { transform: scale(1.07); }
.card__tipo { position: absolute; left: 10px; top: 10px; background: rgba(6, 30, 54, .86); color: #fff; font: 600 11px/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; padding: 6px 9px; border-radius: 999px; }
.card__more { position: absolute; right: 10px; top: 10px; background: rgba(255, 255, 255, .92); color: var(--navy-deep); font: 600 12px/1 var(--font-body); padding: 6px 9px; border-radius: 999px; }
.card__view {
  position: absolute; left: 50%; bottom: 12px; translate: -50% 0;
  background: var(--sun); color: var(--navy-deep); font: 600 13px/1 var(--font-display); white-space: nowrap;
  padding: 10px 14px; border-radius: 999px; box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .6);
  opacity: 0; transform: translateY(14px); transition: opacity .3s ease, transform .45s var(--ease-out);
}
.card:hover .card__view, .card:focus-visible .card__view { opacity: 1; transform: none; }
.card__body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 18px; flex: 1; border-top: 1px solid var(--line); }
.card__price { display: flex; flex-direction: column; font: 600 24px/1.15 var(--font-body); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.card__price small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.card__price--ask { font-size: 20px; color: var(--navy); }
.card__area { font-size: 14px; color: var(--fg); font-weight: 500; }
.card__title { font-size: 15px; line-height: 1.35; color: var(--fg); margin-top: 2px; }
.card__place { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.card__place svg { width: 14px; height: 14px; flex: none; }
.card__fin { margin-top: auto; padding-top: 8px; font-size: 14px; font-weight: 600; color: var(--ok); }

.note { margin-top: 20px; font-size: 13px; color: var(--muted); }

/* ---------- 6. Ventanas flotantes ---------- */
.sheet {
  padding: 0; border: 0; margin: 0; background: transparent; color: var(--fg);
  width: 100%; height: 100%; max-width: none; max-height: none;
  overflow: hidden;
}
.sheet[open] { display: grid; place-items: center; }
.sheet::backdrop { background: rgba(6, 30, 54, 0); backdrop-filter: blur(0); transition: background-color .35s ease, backdrop-filter .35s ease; }
.sheet.is-open::backdrop { background: rgba(6, 30, 54, .62); backdrop-filter: blur(4px); }

.sheet__panel {
  position: relative; width: min(1060px, calc(100% - 48px)); max-height: min(88vh, 860px);
  background: var(--surface); border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6);
  opacity: 0; transform: translateY(32px) scale(.97);
  transition: opacity .35s ease, transform .55s var(--ease-out);
}
.sheet--small .sheet__panel { width: min(480px, calc(100% - 32px)); }
.sheet.is-open .sheet__panel { opacity: 1; transform: none; }
.sheet.is-closing .sheet__panel { transition-duration: .3s; }
.sheet__scroll { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; flex: 1; min-height: 0; }
.sheet__grab { display: none; }
.sheet__close {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .94); color: var(--navy-deep); display: grid; place-items: center;
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .4); transition: transform .3s var(--ease-out);
}
.sheet__close:hover { transform: rotate(90deg); }
.sheet__close svg { width: 20px; height: 20px; }

/* Detalle */
.d { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "media info" "media cta"; }
.d__media { grid-area: media; background: var(--navy-deep); position: sticky; top: 0; align-self: start; }
.d__info { grid-area: info; padding: 32px 32px 8px; min-width: 0; }
.d__cta {
  grid-area: cta; position: sticky; bottom: 0; align-self: end;
  display: flex; gap: 10px; padding: 14px 32px calc(16px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.d__cta .btn { flex: 1; }

.gal { position: relative; }
.gal__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; outline-offset: -3px; }
.gal__track::-webkit-scrollbar { display: none; }
.gal__slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 1 / 1; display: grid; place-items: center; }
.gal__slide img { width: 100%; height: 100%; object-fit: contain; }
.gal__nav {
  position: absolute; top: 50%; translate: 0 -50%; width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .92); color: var(--navy-deep); font: 400 28px/1 var(--font-body); cursor: pointer;
  display: grid; place-items: center; padding-bottom: 3px; box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .5);
  transition: transform .3s var(--ease-out);
}
.gal__nav:hover { transform: scale(1.08); }
.gal__nav--prev { left: 12px; }
.gal__nav--next { right: 12px; }
.gal__dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 6px; }
.gal__dots span { width: 7px; height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .55); transition: width .4s var(--ease-out), background-color .3s ease; }
.gal__dots span.is-on { width: 22px; background: var(--sun); }
.gal__count { position: absolute; left: 12px; top: 12px; background: rgba(6, 30, 54, .8); color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; }

.d-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); padding-right: 44px; }
.d-status { background: #E3F3EB; color: var(--ok); font-weight: 600; padding: 4px 9px; border-radius: 999px; font-size: 12px; }
.d-title { font-size: clamp(24px, 2.6vw, 30px); margin-top: 10px; }
.d-place { display: flex; align-items: flex-start; gap: 6px; color: var(--muted); font-size: 14px; margin-top: 8px; }
.d-place svg, .d-map svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.d-price { display: flex; flex-direction: column; font: 600 34px/1.1 var(--font-body); margin-top: 18px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.d-price small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; text-transform: capitalize; }
.d-price--ask { font-size: 26px; color: var(--navy); }
.d-price--ask small { text-transform: none; margin-top: 4px; }
.d-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.d-quick div { background: var(--chip); border-radius: 10px; padding: 12px 14px; }
.d-quick span { display: block; font-size: 12px; color: var(--muted); }
.d-quick b { font: 600 15px/1.3 var(--font-display); }

.d-sec { padding-block: 22px; border-top: 1px solid var(--line); margin-top: 22px; }
.d-sec + .d-sec { margin-top: 0; }
.d-sec h3 { font-size: 17px; margin-bottom: 12px; }
.d-sec p { color: var(--muted); font-size: 15px; }
.d-sec p + p { margin-top: 10px; }
.d-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.d-specs div { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.d-specs div:nth-child(odd) { border-right: 1px solid var(--line); }
.d-specs div:nth-last-child(-n+2):nth-child(odd), .d-specs div:last-child { border-bottom: 0; }
.d-specs dt { font-size: 12px; color: var(--muted); }
.d-specs dd { font-weight: 600; font-size: 15px; line-height: 1.35; }
.d-fin { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.d-fin li { position: relative; padding-left: 26px; font-size: 15px; }
.d-fin li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--ok); }
.d-fin li::after { content: ""; position: absolute; left: 5px; top: 7px; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.d-dist { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.d-dist li { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.d-dist b { font-weight: 600; white-space: nowrap; }
.d-map { display: inline-flex; gap: 6px; margin-top: 14px; font-weight: 600; color: var(--navy); font-size: 15px; text-underline-offset: 3px; }

/* Agenda */
.agenda { padding: 30px 28px calc(28px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; }
.agenda h2 { font-size: 28px; margin-top: 6px; }
.agenda__lead { color: var(--muted); margin-bottom: 10px; }
.agenda label { font-weight: 600; font-size: 14px; margin-top: 8px; }
.agenda input, .agenda select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); font-size: 16px; transition: border-color .2s ease, box-shadow .2s ease; }
.agenda input:focus, .agenda select:focus { outline: 0; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(10, 46, 80, .12); }
.agenda__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.agenda__row > div { display: grid; gap: 8px; min-width: 0; }
.agenda__error { color: #B42318; font-size: 14px; font-weight: 600; }
.agenda .btn { margin-top: 14px; }
.agenda__hint { font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- 7. Secciones ---------- */
.section { padding-block: var(--section-y); }
.section--surface { background: var(--surface); }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 48px; margin-bottom: 44px; }
.section__head h2, .zones__intro h2 { font-size: clamp(28px, 3.6vw, 44px); margin-top: 12px; max-width: 18ch; }
.section__head > p { max-width: 48ch; color: var(--muted); }

.zones { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.zones__intro > p:last-child { margin-top: 18px; color: var(--muted); max-width: 44ch; }
.route { position: relative; list-style: none; margin: 0; padding: 0 0 0 36px; }
.route::before {
  content: ""; position: absolute; left: 9px; top: 22px; bottom: 22px; width: 3px; border-radius: 3px;
  background: linear-gradient(var(--navy), var(--navy)) left top / 100% var(--road, 100%) no-repeat, var(--line);
}
.route li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--line); }
.route li:last-child { border-bottom: 0; }
.route li::before { content: ""; position: absolute; left: -33px; top: 22px; width: 15px; height: 15px; border-radius: 50%; background: var(--surface); border: 3px solid var(--navy); }
.route li:first-child::before { background: var(--sun); border-color: var(--sun); }
.route b { font: 600 18px/1.3 var(--font-display); }
.route small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.route em { font: 600 14px var(--font-display); font-style: normal; color: var(--muted); white-space: nowrap; }

.reasons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.reason { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-card); }
.reason svg { width: 42px; height: 42px; margin-bottom: 16px; }
.ico-a { stroke: var(--fg); }
.ico-b { fill: var(--sun); }
.reason h3 { font-size: 18px; margin-bottom: 8px; }
.reason p { color: var(--muted); font-size: 15px; }

.contact { position: relative; background: var(--navy); color: var(--on-navy); padding-block: calc(var(--section-y) + 40px) var(--section-y); overflow: hidden; }
.contact__wave { position: absolute; top: -1px; left: 0; width: 100%; height: clamp(44px, 6vw, 80px); }
.wave-bg { fill: var(--bg); }
.wave-sun { fill: var(--sun); }
.contact__inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.contact h2 { font-size: clamp(30px, 4.2vw, 52px); max-width: 16ch; margin-top: 14px; }
.contact h2 em { font-style: normal; color: var(--sun); }
.contact__inner > div > p:last-child { margin-top: 18px; color: rgba(243, 246, 249, .8); max-width: 46ch; }
.phone { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.phone__num { font: 700 clamp(28px, 3.4vw, 38px)/1 var(--font-display); font-variant-numeric: tabular-nums; user-select: all; }
.phone__row { display: flex; flex-wrap: wrap; gap: 10px; }
.phone small { color: rgba(243, 246, 249, .68); font-size: 13px; }
.phone small a { color: #fff; }
.btn-copy { background: transparent; border: 1.5px solid rgba(255, 255, 255, .4); color: #fff; font: 600 14px/1 var(--font-display); padding: 14px 18px; border-radius: 999px; cursor: pointer; transition: background-color .2s ease; }
.btn-copy:hover { background: rgba(255, 255, 255, .08); }

/* ---------- 8. Footer ---------- */
.footer { background: var(--navy-deep); color: rgba(243, 246, 249, .72); font-size: 14px; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 24px calc(24px + env(safe-area-inset-bottom, 0px)); }
.footer a { color: #fff; text-decoration: none; }

.wa-float {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  width: 56px; height: 56px; border-radius: 50%; display: none; place-items: center;
  background: var(--sun); color: var(--navy-deep); box-shadow: 0 12px 28px -10px rgba(6, 30, 54, .6);
  transform: scale(0); transition: transform .5s var(--spring);
}
.wa-float svg { width: 28px; height: 28px; }
.wa-float.is-visible { transform: scale(1); }

/* =========================================================
   9. Animaciones (solo con JS y sin "reducir movimiento")
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {

  /* Entrada de la página: header y título */
  .js .top__inner > * { animation: drop .9s var(--ease-out) both; }
  .js .top__inner > .nav { animation-delay: .08s; }
  .js .top__inner > .top__actions { animation-delay: .16s; }
  @keyframes drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

  .js .shop__intro > * { animation: focus-up .9s var(--ease-out) both; }
  .js .shop__intro > :nth-child(2) { animation-delay: .1s; }
  .js .shop__intro > :nth-child(3) { animation-delay: .18s; }
  .js .filters { animation: slide-in-left 1s var(--ease-out) .2s both; }
  @keyframes focus-up { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
  @keyframes slide-in-left { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

  /* Tarjetas: se "revelan" desde abajo con una cortina sobre la foto.
     Se repite cada vez que cambian los filtros. */
  .js .listing > li { opacity: 0; transform: translateY(34px) rotateX(10deg); transform-origin: 50% 100%; }
  .js .listing { perspective: 1400px; }
  .js .listing.is-in > li { animation: card-in .9s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
  .js .listing > li .card__img::after { content: ""; position: absolute; inset: 0; background: var(--navy); transform-origin: top; transform: scaleY(1); }
  .js .listing.is-in > li .card__img::after { animation: curtain .9s var(--ease-in-out) both; animation-delay: calc(.12s + var(--i, 0) * 70ms); }
  .js .listing.is-in > li .card__img img { animation: settle 1.4s var(--ease-out) both; animation-delay: calc(.12s + var(--i, 0) * 70ms); }
  @keyframes card-in { from { opacity: 0; transform: translateY(34px) rotateX(10deg); } to { opacity: 1; transform: none; } }
  @keyframes curtain { from { transform: scaleY(1); } to { transform: scaleY(0); } }
  @keyframes settle { from { transform: scale(1.18); } to { transform: none; } }

  /* Ventana de detalle: el contenido entra en cascada */
  .js .sheet.is-open .d__info > *, .js .sheet.is-open .agenda > * { animation: focus-up .7s var(--ease-out) both; }
  .js .sheet.is-open .d__info > :nth-child(2), .js .sheet.is-open .agenda > :nth-child(2) { animation-delay: .05s; }
  .js .sheet.is-open .d__info > :nth-child(3), .js .sheet.is-open .agenda > :nth-child(3) { animation-delay: .1s; }
  .js .sheet.is-open .d__info > :nth-child(4), .js .sheet.is-open .agenda > :nth-child(4) { animation-delay: .15s; }
  .js .sheet.is-open .d__info > :nth-child(5), .js .sheet.is-open .agenda > :nth-child(n+5) { animation-delay: .2s; }
  .js .sheet.is-open .d__info > :nth-child(n+6) { animation-delay: .26s; }
  .js .sheet.is-open .gal__slide:first-child img { animation: settle 1.2s var(--ease-out) both; }
  .js .sheet.is-open .d__cta { animation: rise-cta .6s var(--ease-out) .25s both; }
  @keyframes rise-cta { from { transform: translateY(100%); } to { transform: none; } }

  /* Bloques de texto al hacer scroll */
  .js [data-reveal] { opacity: 0; transform: translateY(28px); filter: blur(8px); transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out), filter 1s var(--ease-out); transition-delay: var(--d, 0s); }
  .js [data-reveal].is-in { opacity: 1; transform: none; filter: none; }

  /* Razones: cascada con leve inclinación 3D y acento con rebote */
  .js [data-stagger] { perspective: 1200px; }
  .js [data-stagger] > * { opacity: 0; transform: translateY(40px) rotateX(12deg); transform-origin: 50% 100%; transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
  .js [data-stagger].is-in > * { opacity: 1; transform: none; }
  .js .reason .ico-b { transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .8s var(--spring); transition-delay: calc(.35s + var(--i, 0) * 90ms); }
  .js .reasons.is-in .ico-b { transform: scale(1); }

  /* Ruta: la carretera se dibuja y cada parada se enciende */
  .js .route { --road: 0%; transition: --road 1.6s var(--ease-in-out); }
  .js .route.is-in { --road: 100%; }
  .js .route li { opacity: 0; transform: translateX(24px); transition: opacity .8s var(--ease-out), transform .9s var(--ease-out); transition-delay: calc(.15s + var(--i) * 260ms); }
  .js .route li::before { transform: scale(0); transition: transform .6s var(--spring); transition-delay: calc(.15s + var(--i) * 260ms); }
  .js .route.is-in li { opacity: 1; transform: none; }
  .js .route.is-in li::before { transform: scale(1); }
  .js .route.is-in li::after { content: ""; position: absolute; left: -38px; top: 17px; width: 25px; height: 25px; border-radius: 50%; border: 2px solid var(--sun); opacity: 0; animation: ping 1.2s var(--ease-out) both; animation-delay: calc(.3s + var(--i) * 260ms); pointer-events: none; }
  @keyframes ping { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }

  .contact__wave .wave-sun { animation: sway 9s ease-in-out infinite alternate; }
  @keyframes sway { from { transform: translateX(-2%); } to { transform: translateX(2%); } }
}

@property --road { syntax: "<percentage>"; inherits: true; initial-value: 100%; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after, ::backdrop { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =========================================================
   10. Responsive
   PC > 1100 · Laptop 961–1100 · Tablet 721–960 · Celular ≤ 720
   ========================================================= */
@media (max-width: 1100px) {
  .reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav a { padding-inline: 10px; }
  .nav a::after { left: 10px; right: 10px; }
  .brand__text small { display: none; }
}

@media (max-width: 960px) {
  :root { --header-h: 62px; }
  .menu-btn { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 20px; background: var(--navy);
    box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .6);
    clip-path: inset(0 0 100% 0); visibility: hidden;
    transition: clip-path .5s var(--ease-in-out), visibility 0s linear .5s;
  }
  .nav a { font: 600 20px/1.2 var(--font-display); padding: 16px 0; border-radius: 0; border-bottom: 1px solid rgba(255, 255, 255, .12); opacity: 0; transform: translateY(-8px); transition: opacity .35s ease, transform .45s var(--ease-out); }
  .nav a:hover { background: none; }
  .nav a::after { display: none; }
  .nav a.is-active { color: var(--sun); }
  .menu-open .nav { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .5s var(--ease-in-out); }
  .menu-open .nav a { opacity: 1; transform: none; }
  .menu-open .nav a:nth-child(1) { transition-delay: .1s; }
  .menu-open .nav a:nth-child(2) { transition-delay: .15s; }
  .menu-open .nav a:nth-child(3) { transition-delay: .2s; }
  .menu-open .nav a:nth-child(4) { transition-delay: .25s; }

  .shop__layout { grid-template-columns: 1fr; gap: 14px; }
  .filters { position: static; animation: none !important; }
  .filters__box summary { display: flex; }
  .filters__box[open] summary { border-radius: var(--radius) var(--radius) 0 0; border-bottom-color: transparent; }
  .filters__body { background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 4px 16px 18px; }
  .filters .opts { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); column-gap: 16px; }
  .chips-scroll { display: flex; }
  .results__bar { justify-content: space-between; }

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

@media (max-width: 900px) {
  /* Detalle en una columna */
  .d { grid-template-columns: 1fr; grid-template-areas: "media" "info" "cta"; }
  .d__media { position: static; }
  .gal__slide { aspect-ratio: 4 / 3; }
  .d__info { padding: 22px 22px 4px; }
  .d__cta { padding-inline: 22px; }
}

@media (max-width: 720px) {
  /* Ventanas como hoja inferior que se desliza */
  .sheet[open] { place-items: end center; }
  .sheet__panel, .sheet--small .sheet__panel {
    width: 100%; max-height: 94dvh; border-radius: 20px 20px 0 0;
    opacity: 1; transform: translateY(100%);
    transition: transform .55s var(--ease-out);
  }
  .sheet--small .sheet__panel { max-height: 90dvh; }
  .sheet.is-closing .sheet__panel { transition: transform .35s var(--ease-in-out); }
  .sheet__grab { display: block; position: absolute; top: 0; left: 0; right: 0; height: 26px; z-index: 4; }
  .sheet__grab::before { content: ""; position: absolute; top: 8px; left: 50%; translate: -50% 0; width: 42px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .85); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
  .sheet--small .sheet__grab::before { background: var(--line); box-shadow: none; }
  .sheet__close { top: 14px; right: 14px; width: 36px; height: 36px; }
}

@media (max-width: 600px) {
  .brand__text b { font-size: 14px; white-space: normal; max-width: 118px; line-height: 1.1; }
  .brand__badge { width: 40px; height: 40px; }
  .brand__badge img { width: 30px; }
  .btn--agenda { padding: 11px 13px; }
  .btn--agenda span { font-size: 14px; }
  .top__inner { gap: 10px; }
  .sort > span { display: none; }

  /* Tarjetas como lista (foto a la izquierda), al estilo de las tiendas en celular */
  .listing { grid-template-columns: 1fr; gap: 10px; }
  .card { flex-direction: row; }
  .card__img { width: 40%; flex: none; aspect-ratio: auto; min-height: 150px; }
  .card__img img { position: absolute; inset: 0; }
  .card__more, .card__view { display: none; }
  .card__tipo { font-size: 10px; padding: 5px 7px; left: 8px; top: 8px; }
  .card__body { border-top: 0; padding: 12px 14px 14px; min-width: 0; }
  .card__price { font-size: 20px; }
  .card__price--ask { font-size: 17px; }
  .card__title { font-size: 14px; }
  .card__fin { font-size: 13px; padding-top: 6px; }

  .reasons { grid-template-columns: 1fr; }
  .d-specs { grid-template-columns: 1fr; }
  .d-specs div:nth-child(odd) { border-right: 0; }
  .d-specs div:nth-last-child(-n+2):nth-child(odd) { border-bottom: 1px solid var(--line); }
  .d-price { font-size: 28px; }
  .phone { padding: 22px; }
  .phone__row .btn, .phone__row .btn-copy { flex: 1 1 100%; }
  .agenda { padding-inline: 20px; }
  .wa-float { display: grid; }
  .footer__inner { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 420px) {
  .btn--agenda svg { display: none; }
}
@media (max-width: 340px) {
  .brand__text { display: none; }
  .agenda__row { grid-template-columns: 1fr; }
}
