/* Starter kit for Mapaprop Express API. Single stylesheet, no build step.
   Colours and typography come from the account's `design`, injected as CSS variables by brand.js;
   the values here are only the fallback. */

:root {
  --primary: #195fa9;
  --primary-text: #ffffff;
  --secondary: #4a7fe8;
  --secondary-text: #ffffff;
  --accent-ink: #195fa9;      /* accent readable on white; recomputed from `design` */
  --accent-ink-alt: #4a7fe8;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --ink: #16202b;
  --ink-soft: #5b6b7c;
  --line: #e3e8ee;
  --surface: #ffffff;
  --surface-alt: #f5f7fa;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(22, 32, 43, .06), 0 8px 24px rgba(22, 32, 43, .06);
  --wrap: 1180px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.section { padding: 48px 0; }
.section--alt { background: var(--surface-alt); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.section__head h2 { font-size: 1.5rem; margin: 0; }
.section__head a { color: var(--accent-ink); font-weight: 500; }

/* ---------- header / nav ---------- */
.header { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
.header__bar { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.logo img { max-height: 44px; width: auto; }
.logo__text { font-weight: 700; font-size: 1.15rem; color: var(--accent-ink); }
.nav { margin-left: auto; display: flex; gap: 1.25rem; align-items: center; }
.nav a { font-size: .95rem; font-weight: 500; padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.is-active { border-bottom-color: var(--accent-ink); color: var(--accent-ink); }
.lang { display: flex; margin-left: 1rem; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface-alt); }
.lang__option { border: 0; background: none; border-radius: 999px; padding: .3rem .6rem; font: inherit; font-size: .78rem; font-weight: 600; letter-spacing: .04em; color: var(--ink-soft); cursor: pointer; line-height: 1.4; }
.lang__option:hover { color: var(--accent-ink); }
.lang__option.is-active { background: var(--surface); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
/* "ES" is enough on screen; the full name is what assistive tech should hear. */
.lang__full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.nav__toggle { margin-left: auto; display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; font-size: 1.1rem; cursor: pointer; }

@media (max-width: 860px) {
  /* The nav collapses into the drawer, so the switcher is what takes the right edge of the bar: a
     visitor who cannot read the menu is the one who needs it most. */
  .lang { margin-left: auto; }
  .nav__toggle { margin-left: .5rem; }
  .nav { position: absolute; top: 68px; left: 0; right: 0; background: var(--surface); flex-direction: column; align-items: stretch; gap: 0; padding: 0 16px; border-bottom: 1px solid var(--line); display: none; }
  .nav.is-open { display: flex; }
  .nav a { padding: .85rem 0; border-bottom: 1px solid var(--line); }
  .nav__toggle { display: block; }
}

/* ---------- hero ---------- */
.hero { position: relative; min-height: 380px; display: grid; place-items: center; background: var(--primary); color: var(--primary-text); overflow: hidden; }
/* The scrim (::after) is ALWAYS on, slide or no slide, so the hero's visible background is always
   dark and its text is always light -- regardless of the palette. This is why the hero does NOT use
   --primary-text, which is derived for filled surfaces that have no scrim (buttons, CTA, pager). */
.hero { color: #ffffff; }
.hero__slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .8s ease; }
.hero__slide.is-active { opacity: 1; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.55)); }
.hero__inner { position: relative; z-index: 2; text-align: center; padding: 56px 16px; max-width: 760px; }
.hero__inner h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.hero__inner p { font-size: 1.05rem; opacity: .95; text-shadow: 0 2px 8px rgba(0,0,0,.4); }

/* ---------- search bar ---------- */
.searcher { position: relative; z-index: 3; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-top: -42px; }
.searcher__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .3rem; }
input, select, textarea {
  width: 100%; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; color: var(--ink); background: var(--surface);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--secondary); outline-offset: 1px; border-color: var(--secondary); }
textarea { min-height: 120px; resize: vertical; }

.btn { display: inline-block; padding: .7rem 1.3rem; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-align: center; }
.btn--primary { background: var(--primary); color: var(--primary-text); }
.btn--secondary { background: var(--secondary); color: var(--secondary-text); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card__media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-alt); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media--empty { display: grid; place-items: center; height: 100%; color: var(--ink-soft); font-size: .85rem; }
.card__body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.card__kicker { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-ink-alt); font-weight: 700; margin: 0; }
.card__title { font-size: 1.02rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__zone, .card__specs { margin: 0; font-size: .87rem; color: var(--ink-soft); }
.card__price { margin: .4rem 0 0; font-size: 1.1rem; font-weight: 700; color: var(--accent-ink); }
.card--skeleton { height: 340px; background: linear-gradient(90deg, var(--surface-alt) 25%, #eef1f5 50%, var(--surface-alt) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border: 0; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.badge { position: absolute; top: 10px; padding: .25rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge--status { left: 10px; background: var(--ink); color: #fff; }
.badge--dev { right: 10px; background: var(--secondary); color: var(--secondary-text); }

/* ---------- notices ---------- */
.notice { padding: 1rem 1.1rem; border-radius: var(--radius); background: var(--surface-alt); color: var(--ink-soft); border: 1px solid var(--line); }
.notice--error { background: #fdf2f2; border-color: #f6caca; color: #8f2727; }
.notice--ok { background: #f0faf3; border-color: #bfe6cb; color: #1f6b38; }

/* ---------- pager ---------- */
.pager { display: flex; gap: .4rem; align-items: center; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.pager__item { min-width: 40px; padding: .5rem .7rem; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; font: inherit; }
.pager__item.is-current { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.pager__total { width: 100%; text-align: center; color: var(--ink-soft); font-size: .85rem; margin-top: .4rem; }

/* ---------- listing layout ---------- */
.listing { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 88px; display: grid; gap: 14px; }
.filters h2 { font-size: 1rem; margin: 0; }
.filters__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 900px) { .listing { grid-template-columns: 1fr; } .filters { position: static; } }

/* ---------- property detail ---------- */
.detail { display: grid; grid-template-columns: 1fr 360px; gap: 32px; align-items: start; }
@media (max-width: 980px) { .detail { grid-template-columns: 1fr; } }
.gallery__main { aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--surface-alt); }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; }
.gallery__thumbs img { width: 92px; height: 68px; object-fit: cover; border-radius: 8px; cursor: pointer; opacity: .65; border: 2px solid transparent; }
.gallery__thumbs img.is-active, .gallery__thumbs img:hover { opacity: 1; border-color: var(--accent-ink); }
.price-box { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.price-box__price { font-size: 1.6rem; font-weight: 700; color: var(--accent-ink); margin: 0; }
.price-box__extra { font-size: .85rem; color: var(--ink-soft); margin: .2rem 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 1rem 0 0; list-style: none; }
.chips li { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .75rem; font-size: .83rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 1.5rem 0; padding: 0; list-style: none; }
.facts li { background: var(--surface-alt); border-radius: 8px; padding: .7rem .9rem; font-size: .9rem; }
.facts strong { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); font-weight: 700; }
.prose { white-space: pre-line; color: var(--ink); }
.aside { display: grid; gap: 18px; position: sticky; top: 88px; }
@media (max-width: 980px) { .aside { position: static; } }
.form { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.form h3 { margin: 0; font-size: 1.05rem; }
.form__hint { font-size: .8rem; color: var(--ink-soft); margin: 0; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form__row, .filters__row { grid-template-columns: 1fr; } }
.map { aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); width: 100%; }
.videos { display: grid; gap: 14px; }
.videos iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); }

/* ---------- call to action ---------- */
.cta { background: var(--primary); color: var(--primary-text); border-radius: var(--radius); padding: 32px; text-align: center; }
.cta h2 { color: inherit; }
.cta p { margin: 0 auto 1.2rem; max-width: 560px; opacity: .92; }
.cta .btn { background: var(--primary-text); color: var(--primary); }

/* ---------- zones / branches ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.pills a { display: inline-block; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .45rem .95rem; font-size: .9rem; }
.pills a:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.branches { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.branch { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.branch h3 { font-size: 1rem; }
.branch p { margin: .2rem 0; font-size: .9rem; color: var(--ink-soft); }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: #cfd8e3; margin-top: 56px; padding: 40px 0 28px; font-size: .9rem; }
.footer a { color: #fff; }
.footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.footer h4 { color: #fff; margin: 0 0 .6rem; font-size: .95rem; }
.footer__social { display: flex; gap: .9rem; flex-wrap: wrap; }
.footer__legal { border-top: 1px solid rgba(255,255,255,.14); margin-top: 28px; padding-top: 18px; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: #98a7b8; font-size: .82rem; }

.whatsapp { position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 54px; height: 54px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; box-shadow: var(--shadow); font-size: 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
