/* Capa visual del portal público de paga: agencia + explorador para cliente. */
:root {
  --marine-900: oklch(27% .065 248);
  --marine-950: oklch(21% .05 250);
  --gold-500: oklch(73% .12 82);
  --paper-50: oklch(97.5% .008 90);
  --paper-100: oklch(93.5% .015 85);
  --slate-700: oklch(39% .035 235);
  --portal-ink: var(--marine-950);
  --portal-body: var(--slate-700);
  --portal-accent: var(--color-accent, var(--gold-500));
  --portal-surface: var(--paper-50);
}
.portal-site {
  font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--portal-body);
  background: var(--portal-surface);
  font-size: 16px;
  line-height: 1.6;
}
.portal-site .container { max-width: 1320px; }
.portal-site .brand-header { background: rgba(255,255,255,.97); }
.portal-site .brand-header .logo { font-family: 'Jost', sans-serif; }
.portal-site .brand-header nav a { border-radius: 4px; }
.portal-site .brand-header nav a:hover { background: var(--paper-100); }
.portal-site h1, .portal-site h2, .portal-site .section-title {
  color: var(--portal-ink);
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 500;
}
.portal-site .btn { min-height: 46px; border-radius: 4px; padding-inline: 22px; }
.portal-site .btn:focus-visible, .portal-site input:focus-visible,
.portal-site select:focus-visible, .portal-site summary:focus-visible,
.portal-site .view-tabs button:focus-visible, .portal-site a:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 3px;
}
.section-kicker, .hero-kicker {
  margin: 0 0 10px;
  color: var(--gold-500);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* Home de agencia */
.agency-home .hero {
  min-height: min(760px, calc(100dvh - 68px));
  background: var(--marine-900);
}
.agency-home .hero::after {
  background: linear-gradient(90deg, rgba(6,22,45,.88) 0%, rgba(6,22,45,.62) 48%, rgba(6,22,45,.18) 100%);
}
.agency-home .hero-content { max-width: 1320px; padding-block: 72px; }
.agency-home .hero-content > * { max-width: 850px; }
.agency-home .hero-kicker { color: oklch(84% .09 84); }
.agency-home .hero h1 {
  max-width: 12ch;
  margin: 0;
  color: oklch(99% .003 90);
  font-size: clamp(46px, 6.2vw, 78px);
  letter-spacing: -.035em;
  line-height: .98;
}
.agency-home .hero-intro {
  max-width: 610px;
  margin: 24px 0 32px;
  color: oklch(96% .008 90);
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.55;
  opacity: 1;
}
.agency-home .search-box {
  max-width: 1120px;
  padding: 10px;
  border-radius: 6px;
  background: oklch(99% .003 90);
  box-shadow: 0 20px 55px rgba(6,22,45,.22);
}
.agency-home .search-box label { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.agency-home .search-box label > span {
  padding: 4px 14px 0;
  color: var(--portal-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.agency-home .search-box select, .agency-home .search-box input {
  min-height: 44px;
  padding: 6px 14px 10px;
  color: var(--portal-ink);
  background: transparent;
  font-family: inherit;
  font-size: 15px;
}
.agency-home .search-box .btn { align-self: stretch; margin-left: 4px; white-space: nowrap; }
.home-featured { padding-block: 72px 84px; }
.home-section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.home-section-head .section-title { margin: 0; font-size: clamp(36px, 4vw, 48px); line-height: 1.05; }
.inventory-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.inventory-link span { transition: transform .2s ease-out; }
.inventory-link:hover span { transform: translateX(4px); }
.portal-site .card { border-color: oklch(90% .012 85); border-radius: 6px; box-shadow: none; }
.portal-site .card:hover { box-shadow: 0 14px 32px rgba(6,22,45,.09); }
.portal-site .card .cover { aspect-ratio: 4 / 3; }
.portal-site .card .cover:not(:has(img))::after {
  content: 'Fotografía no disponible';
  display: grid;
  place-items: center;
  height: 100%;
  padding: 20px;
  color: var(--portal-body);
  font-size: 13px;
  text-align: center;
}
.portal-site .card .body { padding: 18px; }
.portal-site .card .price { font-size: 21px; }
.portal-site .card .title { font-size: 16px; }
.portal-site .card .loc, .portal-site .card .stats { font-size: 13px; }

/* Explorador público */
.public-search-page { min-height: 100dvh; }
.search-intro { padding: 54px 0 88px; background: var(--marine-900); color: oklch(94% .01 85); }
.search-intro h1 { max-width: 760px; margin: 0; color: oklch(99% .003 90); font-size: clamp(42px, 5vw, 62px); line-height: 1.02; letter-spacing: -.025em; }
.search-intro p:last-child { max-width: 690px; margin: 18px 0 0; font-size: 18px; }
.search-shell { position: relative; z-index: 2; margin-top: -42px; padding-bottom: 72px; }
.portal-filters { overflow: hidden; border: 1px solid oklch(89% .014 85); border-radius: 6px; background: oklch(99% .003 90); box-shadow: 0 14px 38px rgba(6,22,45,.09); }
.filter-main { display: grid; grid-template-columns: minmax(240px, 1.7fr) minmax(145px, .75fr) minmax(155px, .8fr) auto; gap: 12px; padding: 18px; }
.portal-filters label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.portal-filters label > span, .sort-control > span { color: var(--portal-body); font-size: 12px; font-weight: 600; }
.portal-filters input, .portal-filters select, .sort-control select {
  width: 100%;
  min-height: 46px;
  border: 1px solid oklch(86% .016 85);
  border-radius: 4px;
  background: oklch(99% .003 90);
  color: var(--portal-ink);
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
}
.portal-filters .filter-submit { align-self: end; min-width: 116px; }
.advanced-filters { border-top: 1px solid oklch(91% .012 85); }
.advanced-filters summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 50px; padding: 12px 18px; cursor: pointer; list-style: none; }
.advanced-filters summary::-webkit-details-marker { display: none; }
.advanced-filters summary span:first-child { color: var(--portal-ink); font-weight: 700; }
.advanced-filters summary span:last-child { font-size: 13px; }
.advanced-filters summary::after { content: '+'; margin-left: 8px; color: var(--portal-ink); font-size: 20px; }
.advanced-filters[open] summary::after { content: '−'; }
.advanced-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 6px 18px 20px; }
.filter-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; border-top: 1px solid oklch(91% .012 85); background: var(--paper-50); font-size: 13px; }
.filter-footer a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; }
.results-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 38px 0 18px; }
.results-toolbar h2 { margin: 0; font-family: 'Jost', sans-serif; font-size: 24px; font-weight: 700; }
.results-toolbar p { margin: 3px 0 0; font-size: 14px; }
.sort-control { display: flex; align-items: center; gap: 10px; flex: none; }
.sort-control > span { white-space: nowrap; }
.sort-control select { min-width: 190px; }
.view-tabs { display: inline-flex; gap: 4px; margin-bottom: 20px; padding: 4px; border-radius: 6px; background: var(--paper-100); }
.view-tabs button { min-height: 44px; padding: 8px 18px; border: 0; border-radius: 4px; background: transparent; color: var(--portal-body); cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; }
.view-tabs button[aria-selected="true"] { background: oklch(99% .003 90); color: var(--portal-ink); box-shadow: 0 1px 4px rgba(6,22,45,.1); }
.property-explorer { display: grid; gap: 24px; align-items: start; }
.property-explorer[data-view="ambas"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.property-explorer[data-view="lista"] .map-column, .property-explorer[data-view="mapa"] .list-column { display: none; }
.property-explorer[data-view="ambas"] .cards-grid { grid-template-columns: 1fr; }
.property-explorer[data-view="ambas"] .card { display: grid; grid-template-columns: minmax(150px, 38%) minmax(0, 1fr); }
.property-explorer[data-view="ambas"] .card .cover { height: 100%; min-height: 218px; aspect-ratio: auto; }
.property-explorer[data-view="ambas"] .card .body { min-width: 0; }
.property-explorer[data-view="ambas"] .card .stats { flex-wrap: wrap; gap: 8px 12px; }
.property-explorer[data-view="mapa"] .map-stage { height: min(720px, 72dvh); }
.map-column { min-width: 0; }
.map-stage { position: sticky; top: 88px; height: 640px; overflow: hidden; border-radius: 6px; background: oklch(92% .015 235); }
.map-canvas { width: 100%; height: 100%; }
.map-message { position: absolute; inset: 0; display: grid; place-items: center; padding: 28px; background: oklch(94% .012 235); color: var(--portal-body); text-align: center; pointer-events: none; }
.map-message[hidden] { display: none; }
.map-note { margin: 8px 0 0; font-size: 12px; }
.map-preview { position: absolute; right: 12px; bottom: 12px; left: 12px; z-index: 4; }
.map-preview[hidden] { display: none; }
.map-property-card { position: relative; display: grid; grid-template-columns: 128px minmax(0, 1fr); overflow: hidden; border-radius: 6px; background: oklch(99% .003 90); box-shadow: 0 14px 38px rgba(6,22,45,.2); color: var(--portal-body); font-family: 'Jost', sans-serif; }
.map-property-card.no-photo { grid-template-columns: minmax(0, 1fr); }
.map-property-card img { width: 100%; height: 100%; min-height: 150px; object-fit: cover; }
.map-property-body { min-width: 0; padding: 14px; }
.map-property-price { color: var(--portal-ink); font-size: 18px; font-weight: 700; }
.map-property-title { margin-top: 2px; color: var(--portal-ink); font-size: 14px; font-weight: 600; }
.map-property-location { margin-top: 3px; font-size: 12px; }
.map-property-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 10px; padding: 8px 14px; border-radius: 4px; background: var(--marine-900); color: oklch(99% .003 90); font-size: 13px; font-weight: 600; text-decoration: none; }
.map-preview-close { position: absolute; top: 6px; right: 6px; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(6,22,45,.82); color: #fff; cursor: pointer; font-size: 22px; }
.search-empty { margin-top: 24px; padding-block: 64px; }
.search-empty p { margin: 8px 0 20px; }
.portal-site footer.site-foot { margin-top: 0; }

@media (min-width: 768px) {
  .agency-home .search-box { grid-template-columns: .85fr .9fr 1.55fr auto; }
}
@media (max-width: 1100px) {
  .advanced-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .property-explorer[data-view="ambas"] { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
  .property-explorer[data-view="ambas"] .card { grid-template-columns: 1fr; }
  .property-explorer[data-view="ambas"] .card .cover { min-height: 0; aspect-ratio: 4 / 3; }
}
@media (max-width: 820px) {
  .agency-home .hero { min-height: 660px; }
  .agency-home .hero::after { background: linear-gradient(180deg, rgba(6,22,45,.66), rgba(6,22,45,.9)); }
  .filter-main { grid-template-columns: 1fr 1fr; }
  .filter-query { grid-column: 1 / -1; }
  .filter-submit { width: 100%; }
  .advanced-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .property-explorer[data-view="ambas"] { grid-template-columns: 1fr; }
  .property-explorer[data-view="ambas"] .map-column { order: -1; }
  .map-stage { position: relative; top: auto; height: 520px; }
}
@media (max-width: 600px) {
  .portal-site .container { padding-inline: 16px; }
  .agency-home .hero { min-height: calc(100dvh - 68px); }
  .agency-home .hero-content { padding-block: 48px; }
  .agency-home .hero h1 { font-size: clamp(44px, 14vw, 60px); }
  .agency-home .hero-intro { margin-block: 20px 26px; font-size: 17px; }
  .agency-home .search-box { padding: 12px; }
  .agency-home .search-box .btn { margin: 4px 0 0; min-height: 50px; }
  .home-featured { padding-block: 52px 64px; }
  .home-section-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .search-intro { padding: 40px 0 76px; }
  .search-intro h1 { font-size: 44px; }
  .search-intro p:last-child { font-size: 16px; }
  .search-shell { margin-top: -36px; }
  .filter-main { grid-template-columns: 1fr; padding: 14px; }
  .filter-query { grid-column: auto; }
  .advanced-grid { grid-template-columns: 1fr 1fr; gap: 12px; padding-inline: 14px; }
  .filter-footer { align-items: flex-start; padding-inline: 14px; }
  .filter-footer > span { max-width: 60%; }
  .results-toolbar { align-items: flex-start; flex-direction: column; gap: 14px; margin-top: 28px; }
  .sort-control { width: 100%; }
  .sort-control select { flex: 1; min-width: 0; }
  .view-tabs { display: flex; width: 100%; }
  .view-tabs button { flex: 1; padding-inline: 8px; }
  .property-explorer[data-view="ambas"] .card { grid-template-columns: 1fr; }
  .map-stage, .property-explorer[data-view="mapa"] .map-stage { height: 62dvh; min-height: 440px; }
  .map-property-card { grid-template-columns: 104px minmax(0, 1fr); }
  .map-property-card img { min-height: 164px; }
  .map-property-body { padding: 12px; }
  .map-property-title { padding-right: 26px; }
}
@media (max-width: 380px) {
  .advanced-grid { grid-template-columns: 1fr; }
  .view-tabs button { font-size: 12px; }
  .map-property-card { grid-template-columns: 88px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .portal-site *, .portal-site *::before, .portal-site *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
