/* ==========================================================================
   Torrent Api — Maqueta UI
   Sistema de disseny (design tokens + components)
   Estil: net, càlid i airejat. Referència: careforproperty.com
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Colors */
  --c-cream: #FBFAF7;
  --c-cream-2: #F3F1EB;
  --c-sand: #ECE7DC;
  --c-ink: #1B2033;
  --c-ink-soft: #383C4A;
  --c-muted: #71747F;
  --c-line: #E4E1D8;
  --c-white: #FFFFFF;

  /* Blau Ceigrup — color principal (Pantone 2728 C · ~80%) */
  --c-accent: #0000FF;
  --c-accent-2: #0000CC;
  --c-accent-soft: #E7E7FF;
  --c-accent-ink: #0000CC;

  /* Groc Ceigrup — color secundari (Pantone 1235 C · ~20%) */
  --c-yellow: #FDB816;
  --c-yellow-2: #E9A400;
  --c-yellow-soft: #FEF3D8;
  --c-yellow-ink: #4A3400;

  /* Superfícies fosques = blau corporatiu (fons de color principal) */
  --c-navy: #0000FF;
  --c-navy-2: #0000CC;

  /* Semantic */
  --c-success: #2f9e5b;
  --c-danger: #cc3d2a;

  /* Tipografia corporativa: Gilroy (família de marca). Poppins com a
     alternativa lliure per al predev; en producció, incorporeu Gilroy
     via @font-face i el stack la farà servir automàticament. */
  --font-sans: "Gilroy", "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: var(--font-sans);
  --font-serif: var(--font-sans); /* àlies de compatibilitat amb regles existents */

  --fs-hero: clamp(2.6rem, 1.6rem + 4.4vw, 5rem);
  --fs-h1: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem);
  --fs-h2: clamp(1.7rem, 1.3rem + 1.8vw, 2.5rem);
  --fs-h3: clamp(1.3rem, 1.1rem + 0.9vw, 1.7rem);
  --fs-lead: clamp(1.05rem, 1rem + 0.4vw, 1.28rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;

  /* Spacing */
  --sp-1: 0.5rem;
  --sp-2: 0.75rem;
  --sp-3: 1rem;
  --sp-4: 1.5rem;
  --sp-5: 2rem;
  --sp-6: 3rem;
  --sp-7: 4.5rem;
  --sp-8: 6.5rem;

  /* Radius & shadows */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(28, 27, 25, 0.05), 0 4px 14px rgba(28, 27, 25, 0.05);
  --sh-2: 0 8px 30px rgba(28, 27, 25, 0.09);
  --sh-3: 0 18px 50px rgba(28, 27, 25, 0.14);

  --container: 1340px;
  --container-narrow: 820px;
  --header-h: 76px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--c-ink-soft);
  background: var(--c-cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--c-accent); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--c-accent-2); }
ul, ol { list-style: none; padding: 0; }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--c-ink); line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

/* ---------- Accessibility helpers ---------- */
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; border-radius: 4px; }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--c-ink); color: var(--c-white); padding: 0.7rem 1.1rem; border-radius: var(--r-sm);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; color: var(--c-white); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.5rem); }
.container--narrow { max-width: var(--container-narrow); }
.section { padding-block: var(--sp-8); }
.section--tight { padding-block: var(--sp-7); }
.section--cream2 { background: var(--c-cream-2); }
.section--sand { background: var(--c-sand); }
.section--ink { background: var(--c-navy); color: rgba(255,255,255,0.85); }
.section--ink h2, .section--ink h3 { color: var(--c-white); }

.grid { display: grid; gap: var(--sp-5); }
.stack > * + * { margin-top: var(--sp-3); }

/* Section heading */
.eyebrow {
  font-family: var(--font-sans); font-size: var(--fs-small); font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-accent);
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.eyebrow::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c-yellow); display: inline-block; } /* punt de marca (com el favicon / la "i" de ceigrup) */
.eyebrow--light { color: var(--c-white); } /* variant sobre fons fosc/fotografia */
.section-head { max-width: 640px; margin-bottom: var(--sp-6); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow::before { display: none; }
.section-head p { margin-top: var(--sp-3); font-size: var(--fs-lead); color: var(--c-muted); }
.lead { font-size: var(--fs-lead); color: var(--c-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.85rem 1.5rem; border-radius: var(--r-pill); border: 1px solid transparent;
  font-weight: 600; font-size: 0.97rem; line-height: 1; text-align: center;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  min-height: 48px;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--c-accent); color: var(--c-white); box-shadow: var(--sh-1); }
.btn--primary:hover { background: var(--c-accent-2); color: var(--c-white); box-shadow: var(--sh-2); }
.btn--dark { background: var(--c-ink); color: var(--c-white); }
.btn--dark:hover { background: #000; color: var(--c-white); }
.btn--ghost { background: transparent; color: var(--c-ink); border-color: var(--c-line); }
.btn--ghost:hover { background: var(--c-white); border-color: var(--c-ink); color: var(--c-ink); }
.btn--light { background: var(--c-white); color: var(--c-ink); }
.btn--light:hover { background: var(--c-cream-2); color: var(--c-ink); }
.btn--block { width: 100%; }
.btn--sm { padding: 0.6rem 1.1rem; min-height: 40px; font-size: 0.9rem; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Top bar (contacte, idioma i accessos externs) ---------- */
/* Franja blava corporativa. No és sticky: desapareix en fer scroll i només
   queda fixada la capçalera principal (evitem menjar alçada de pantalla). */
.topbar { background: var(--c-navy); color: rgba(255, 255, 255, 0.92); font-size: 0.85rem; }
.topbar__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--sp-3); min-height: 46px; padding-block: 0.3rem; }
.topbar__group { display: flex; align-items: center; gap: var(--sp-4); min-width: 0; }
.topbar__tools { gap: var(--sp-2); }
.topbar__link { display: inline-flex; align-items: center; gap: 0.4rem; color: rgba(255, 255, 255, 0.92); font-weight: 500; white-space: nowrap; padding-block: 0.55rem; }
.topbar__link:hover { color: var(--c-white); text-decoration: underline; text-underline-offset: 3px; }
.topbar__link svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--c-yellow); }
.topbar__cta {
  display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap;
  background: var(--c-yellow); color: var(--c-yellow-ink); font-weight: 700;
  border-radius: var(--r-pill); padding: 0.4rem 0.95rem; min-height: 36px;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.topbar__cta:hover { background: var(--c-yellow-2); color: var(--c-yellow-ink); transform: translateY(-1px); }
/* Focus visible amb contrast suficient sobre el blau corporatiu */
.topbar :focus-visible { outline-color: var(--c-yellow); }
.topbar .lang__toggle { color: var(--c-white); border-color: rgba(255, 255, 255, 0.35); padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.topbar .lang__toggle:hover { border-color: var(--c-white); }
/* Icona de "s'obre en finestra nova" (↗) */
.ext-icon { font-size: 0.85em; line-height: 1; }
@media (max-width: 940px) {
  /* En pantalles petites la franja se simplifica: telèfon + idioma + botó
     "Valora". Correu i "Àrea propietaris" passen al menú mòbil
     (.main-nav__extra), sense provocar scroll horitzontal. */
  .topbar__link--mail, .topbar__link--area { display: none; }
  .topbar__cta-txt { display: none; }
  .topbar__group { gap: var(--sp-2); }
}
@media (max-width: 400px) {
  .topbar { font-size: 0.8rem; }
  .topbar__inner, .topbar__group { gap: 0.5rem; }
  .topbar__cta { padding: 0.35rem 0.75rem; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251, 250, 247, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 0.15rem; font-family: var(--font-display); font-size: 1.5rem; color: var(--c-ink); font-weight: 700; letter-spacing: -0.02em; }
.brand strong { font-weight: 800; }
.brand .brand__dot { color: var(--c-accent); }
.brand__img { height: 46px; width: auto; display: block; }
@media (max-width: 520px) { .brand__img { height: 38px; } }
.brand--footer { display: inline-block; background: var(--c-white); padding: 0.7rem 1rem; border-radius: var(--r-md); }
.brand--footer .brand__img { height: 42px; }

.main-nav { display: flex; align-items: center; gap: 0.15rem; }
.main-nav a {
  color: var(--c-ink-soft); font-weight: 500; padding: 0.5rem 0.6rem; border-radius: var(--r-pill);
  font-size: 0.94rem; position: relative; white-space: nowrap;
}
.main-nav a:hover { color: var(--c-ink); background: var(--c-cream-2); }
.main-nav a[aria-current="page"],
.main-nav a[aria-current="true"] { color: var(--c-accent-ink); background: var(--c-accent-soft); } /* "true": secció activa en pàgines de detall (p. ex. serveis) */

.header-tools { display: flex; align-items: center; gap: var(--sp-2); }
/* Correu i "Àrea propietaris" dins del menú: només visibles en mòbil */
.main-nav__extra { display: none; }
/* Amb 8 entrades al menú, el CTA de capçalera només cap en pantalles amples */
@media (max-width: 1280px) { .header-tools .btn--cta { display: none; } }

/* Language dropdown */
.lang { position: relative; }
.lang__toggle {
  display: inline-flex; align-items: center; gap: 0.4rem; background: transparent; border: 1px solid var(--c-line);
  border-radius: var(--r-pill); padding: 0.5rem 0.85rem; font-weight: 600; font-size: 0.85rem; color: var(--c-ink);
}
.lang__toggle:hover { border-color: var(--c-ink); }
.lang__toggle svg { width: 14px; height: 14px; transition: transform 0.2s var(--ease); }
.lang[data-open="true"] .lang__toggle svg { transform: rotate(180deg); }
.lang__menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px;
  background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-md);
  box-shadow: var(--sh-2); padding: 0.4rem; display: none; z-index: 110;
}
.lang[data-open="true"] .lang__menu { display: block; }
.lang__menu a, .lang__menu button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.55rem 0.7rem; border: 0; border-radius: var(--r-sm); background: transparent; text-align: left; color: var(--c-ink-soft); font-size: 0.92rem; }
.lang__menu a:hover, .lang__menu button:hover { background: var(--c-cream-2); color: var(--c-ink); }
.lang__menu [aria-current="true"] { color: var(--c-accent-ink); font-weight: 600; }

/* Mobile toggle */
.nav-toggle { display: none; width: 46px; height: 46px; border: 1px solid var(--c-line); border-radius: var(--r-sm); background: var(--c-white); align-items: center; justify-content: center; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { content: ""; display: block; width: 20px; height: 2px; background: var(--c-ink); border-radius: 2px; transition: transform 0.25s var(--ease), opacity 0.2s var(--ease); }
.nav-toggle span::before { transform: translateY(-6px); }
.nav-toggle span::after { transform: translateY(4px); }
body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { transform: rotate(45deg); }
body.nav-open .nav-toggle span::after { transform: rotate(-45deg) translateY(-1px); }

@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    /* --nav-top el calcula el JS (base de la capçalera); sense JS cau al
       valor per defecte --header-h. */
    position: fixed; inset: var(--nav-top, var(--header-h)) 0 0 0; flex-direction: column; align-items: stretch;
    background: var(--c-cream); padding: var(--sp-4); gap: 0.2rem; transform: translateX(100%);
    transition: transform 0.3s var(--ease); overflow-y: auto; z-index: 95;
  }
  body.nav-open .main-nav { transform: translateX(0); }
  .main-nav a { padding: 0.9rem 1rem; font-size: 1.1rem; border-radius: var(--r-md); white-space: normal; }
  .header-tools .btn--cta { display: none; }
  .main-nav__extra {
    display: flex; flex-direction: column; gap: 0.2rem;
    margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--c-line);
  }
}

/* ---------- Hero ---------- */
/* El contingut flueix dins del flux normal (min-height en lloc de posició
   absoluta) perquè el titular i el cercador mai no quedin retallats en mòbil. */
.hero { position: relative; }
.hero__media { position: relative; border-radius: 0; overflow: hidden; display: flex; align-items: flex-end; min-height: clamp(460px, 72vh, 760px); }
.hero__figure { position: absolute; inset: 0; }
.hero__figure img { width: 100%; height: 100%; object-fit: cover; }
.hero__overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,19,17,0.15) 0%, rgba(20,19,17,0.05) 40%, rgba(20,19,17,0.55) 100%); }
.hero__content { position: relative; width: 100%; padding-top: clamp(5rem, 12vh, 8rem); padding-bottom: clamp(2rem, 6vw, 4.5rem); }
.hero__title { color: var(--c-white); font-size: var(--fs-hero); max-width: 15ch; text-shadow: 0 2px 30px rgba(0,0,0,0.25); }
.hero__subtitle { color: rgba(255,255,255,0.92); font-size: var(--fs-lead); max-width: 46ch; margin-top: var(--sp-3); }

/* Search box */
.searchbox {
  background: var(--c-white); border-radius: var(--r-lg); box-shadow: var(--sh-3);
  padding: 0.6rem; margin-top: var(--sp-5); border: 1px solid rgba(255,255,255,0.6);
}
.searchbox__row { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 0.4rem; align-items: stretch; }
.searchbox .field { display: flex; flex-direction: column; padding: 0.55rem 0.85rem; border-radius: var(--r-md); }
.searchbox .field + .field { border-left: 1px solid var(--c-line); }
.searchbox .field label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-muted); }
.searchbox .field select, .searchbox .field input {
  border: 0; background: transparent; padding: 0.15rem 0; font-size: 0.98rem; color: var(--c-ink); font-weight: 500; width: 100%;
}
.searchbox .field select:focus, .searchbox .field input:focus { outline: none; }
/* Focus visible al cercador: anell al camp sencer en lloc de l'outline del select */
.searchbox .field:focus-within { box-shadow: inset 0 0 0 2px var(--c-accent); }
.searchbox .searchbox__submit { align-self: stretch; }
.searchbox .searchbox__submit .btn { height: 100%; width: 100%; }
@media (max-width: 860px) {
  .searchbox__row { grid-template-columns: 1fr 1fr; }
  .searchbox .field + .field { border-left: 0; }
  .searchbox .field { border: 1px solid var(--c-line); }
  .searchbox .searchbox__submit { grid-column: 1 / -1; }
}

/* Segmented control (Venda/Lloguer) */
.segmented { display: inline-flex; background: var(--c-cream-2); padding: 0.35rem; border-radius: var(--r-pill); gap: 0.25rem; margin-bottom: 0.7rem; box-shadow: var(--sh-1); }
.segmented button { border: 0; background: transparent; padding: 0.62rem 1.5rem; border-radius: var(--r-pill); font-weight: 700; font-size: 0.95rem; color: var(--c-ink-soft); display: inline-flex; align-items: center; gap: 0.45rem; transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.segmented button svg { width: 17px; height: 17px; }
.segmented button:hover { color: var(--c-accent); }
.segmented button[aria-pressed="true"] { background: var(--c-accent); color: var(--c-white); box-shadow: var(--sh-1); }
.segmented button[aria-pressed="true"]:hover { color: var(--c-white); }
.hero .segmented { background: var(--c-white); }

/* ---------- Property card ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
@media (max-width: 980px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .cards { grid-template-columns: 1fr; } }

.property-card {
  background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column; transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s var(--ease);
}
.property-card:hover { transform: translateY(-6px); box-shadow: var(--sh-2); border-color: transparent; }
.property-card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.property-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.property-card:hover .property-card__media img { transform: scale(1.05); }
.property-card__badges { position: absolute; top: 0.9rem; left: 0.9rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 0.35rem 0.7rem; border-radius: var(--r-pill); background: var(--c-white); color: var(--c-ink);
}
.badge--sale { background: var(--c-accent); color: var(--c-white); }
.badge--rent { background: var(--c-ink); color: var(--c-white); }
.badge--new { background: var(--c-yellow); color: var(--c-yellow-ink); }
.property-card__body { padding: 1.15rem 1.25rem 1.35rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.property-card__type { font-size: var(--fs-small); color: var(--c-muted); font-weight: 600; }
.property-card__title { font-family: var(--font-serif); font-size: 1.2rem; color: var(--c-ink); line-height: 1.2; }
.property-card__title a { color: inherit; }
.property-card__title a:hover { color: var(--c-accent); }
.property-card__loc { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--c-muted); font-size: 0.92rem; }
.property-card__loc svg { width: 15px; height: 15px; }
.property-card__price { font-family: var(--font-serif); font-size: 1.4rem; color: var(--c-ink); font-weight: 600; margin-top: auto; }
.property-card__price span { font-size: 0.85rem; color: var(--c-muted); font-weight: 500; font-family: var(--font-sans); }
.feature-list { display: flex; flex-wrap: wrap; gap: 0.9rem; padding-top: 0.7rem; border-top: 1px solid var(--c-line); }
.feature-list li { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.88rem; color: var(--c-ink-soft); }
.feature-list svg { width: 17px; height: 17px; color: var(--c-accent); }

/* ---------- Feature/value blocks ---------- */
.value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
@media (max-width: 820px) { .value-grid { grid-template-columns: 1fr; } }
.value {
  background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-5);
  display: flex; flex-direction: column; gap: 0.7rem;
}
.value__icon { width: 54px; height: 54px; border-radius: var(--r-md); background: var(--c-accent-soft); color: var(--c-accent-ink); display: flex; align-items: center; justify-content: center; }
.value__icon svg { width: 26px; height: 26px; }
.value h3 { font-size: 1.25rem; }
.value .read-more { margin-top: auto; font-weight: 600; color: var(--c-accent); display: inline-flex; align-items: center; gap: 0.3rem; }
.value .read-more:hover { color: var(--c-accent-2); gap: 0.5rem; }

/* Split feature */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }
.split__media img { border-radius: var(--r-lg); box-shadow: var(--sh-2); width: 100%; }
.split--reverse .split__media { order: 2; }
@media (max-width: 880px) { .split--reverse .split__media { order: 0; } }

/* Zones / poblacions */
.zones { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
@media (max-width: 900px) { .zones { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .zones { grid-template-columns: 1fr; } }
.zone { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 3 / 4; display: block; }
.zone img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.zone:hover img { transform: scale(1.06); }
.zone__label { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.1rem; background: linear-gradient(180deg, transparent 40%, rgba(20,19,17,0.65)); color: var(--c-white); }
.zone__label strong { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 500; }
.zone__label span { font-size: 0.85rem; opacity: 0.85; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { text-align: center; }
.stat__num { font-family: var(--font-display); font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem); color: var(--c-white); font-weight: 800; }
.stat__label { color: rgba(255,255,255,0.82); font-size: 0.95rem; }

/* Testimonials */
.testimonials { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
@media (max-width: 900px) { .testimonials { grid-template-columns: 1fr; } }
.testimonial { background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-5); display: flex; flex-direction: column; gap: 1rem; }
.testimonial__quote { font-family: var(--font-serif); font-size: 1.15rem; color: var(--c-ink); line-height: 1.4; }
.testimonial__author { display: flex; align-items: center; gap: 0.75rem; margin-top: auto; }
.testimonial__author img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--c-accent); color: var(--c-white); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em; flex-shrink: 0; }
.avatar--lg { width: 96px; height: 96px; font-size: 1.7rem; }
.testimonial__author strong { display: block; color: var(--c-ink); font-size: 0.95rem; }
.testimonial__author span { font-size: 0.85rem; color: var(--c-muted); }
.stars { color: var(--c-yellow); display: inline-flex; gap: 2px; }
.stars svg { width: 16px; height: 16px; }

/* ---------- CTA band ---------- */
.cta-band { position: relative; border-radius: var(--r-lg); overflow: hidden; padding: clamp(2.5rem, 6vw, 5rem); color: var(--c-white); }
.cta-band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.cta-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(0,0,180,0.86), rgba(0,0,255,0.55)); z-index: -1; }
.cta-band h2 { color: var(--c-white); max-width: 18ch; }
.cta-band p { color: rgba(255,255,255,0.9); max-width: 50ch; margin-top: var(--sp-3); }
.cta-band .btn-row { margin-top: var(--sp-5); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* ---------- Footer ---------- */
.site-footer { background: var(--c-navy); color: rgba(255,255,255,0.82); padding-block: var(--sp-7) var(--sp-5); margin-top: 0; }
.site-footer a { color: rgba(255,255,255,0.86); }
.site-footer a:hover { color: var(--c-white); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--sp-5); padding-bottom: var(--sp-6); border-bottom: 1px solid rgba(255,255,255,0.12); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer .brand { color: var(--c-white); }
.footer-col h4 { color: var(--c-white); font-family: var(--font-sans); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: var(--sp-3); font-weight: 700; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.55rem; }
.footer-about p { max-width: 34ch; margin-block: var(--sp-3); }
.footer-contact li { display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 0.5rem; }
.footer-contact svg { width: 18px; height: 18px; color: var(--c-yellow); flex-shrink: 0; margin-top: 2px; }
.social { display: flex; gap: 0.6rem; margin-top: var(--sp-3); }
.social a { width: 40px; height: 40px; border: 1px solid rgba(255,255,255,0.28); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.social a:hover { background: var(--c-yellow); border-color: var(--c-yellow); color: var(--c-navy); }
.social svg { width: 18px; height: 18px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; padding-top: var(--sp-4); font-size: var(--fs-small); }
.footer-bottom ul { display: flex; gap: var(--sp-4); flex-wrap: wrap; }

/* Focus visible amb contrast suficient sobre superfícies blaves */
.site-footer :focus-visible, .section--ink :focus-visible { outline-color: var(--c-yellow); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { padding-block: var(--sp-4); font-size: var(--fs-small); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; color: var(--c-muted); }
.breadcrumbs li { display: flex; align-items: center; gap: 0.4rem; }
.breadcrumbs li:not(:last-child)::after { content: "/"; color: var(--c-line); }
.breadcrumbs a { color: var(--c-muted); }
.breadcrumbs a:hover { color: var(--c-accent); }
.breadcrumbs [aria-current="page"] { color: var(--c-ink); }

/* ---------- Page hero (interior) ---------- */
.page-hero { background: var(--c-cream-2); border-bottom: 1px solid var(--c-line); padding-block: var(--sp-6) var(--sp-7); }
.page-hero h1 { max-width: 20ch; }
.page-hero p { margin-top: var(--sp-3); font-size: var(--fs-lead); color: var(--c-muted); max-width: 60ch; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 0.4rem; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 0.9rem; font-weight: 600; color: var(--c-ink); }
.form-field .req { color: var(--c-danger); }
.form-control {
  width: 100%; padding: 0.8rem 1rem; border: 1px solid var(--c-line); border-radius: var(--r-md);
  background: var(--c-white); font-size: 1rem; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.form-control:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
textarea.form-control { min-height: 140px; resize: vertical; }
.form-hint { font-size: var(--fs-small); color: var(--c-muted); }
.form-error { font-size: var(--fs-small); color: var(--c-danger); display: none; }
.form-field.has-error .form-control { border-color: var(--c-danger); }
.form-field.has-error .form-error { display: block; }
.checkbox { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.9rem; }
.checkbox input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--c-accent); }
.form-success { display: none; background: var(--c-accent-soft); color: var(--c-accent-ink); border: 1px solid rgba(0, 0, 255, 0.25); border-radius: var(--r-md); padding: var(--sp-4); }
.form-success.show { display: block; }

.card-panel { background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: clamp(1.5rem, 3vw, 2.5rem); box-shadow: var(--sh-1); }

/* honeypot */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Search results page ---------- */
.results-layout { display: grid; grid-template-columns: 320px 1fr; gap: var(--sp-5); align-items: start; }
@media (max-width: 940px) { .results-layout { grid-template-columns: 1fr; } }
.filters { background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-5); position: sticky; top: calc(var(--header-h) + 16px); }
@media (max-width: 940px) { .filters { position: static; } }
.filters h2 { font-size: 1.2rem; margin-bottom: var(--sp-3); }
.filter-group { padding-block: var(--sp-3); border-top: 1px solid var(--c-line); }
.filter-group:first-of-type { border-top: 0; }
.filter-group > label, .filter-group > .filter-label { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c-muted); display: block; margin-bottom: 0.5rem; }
.range-row { display: flex; gap: 0.6rem; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.results-bar .count { font-size: 0.95rem; color: var(--c-muted); }
.results-bar .count strong { color: var(--c-ink); }
.results-cards { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 620px) { .results-cards { grid-template-columns: 1fr; } }
.filters-toggle { display: none; }
@media (max-width: 940px) {
  .filters-toggle { display: inline-flex; }
  .filters[data-collapsed="true"] .filters__body { display: none; }
}

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 0.35rem; margin-top: var(--sp-6); }
.pagination a, .pagination span { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-md); border: 1px solid var(--c-line); color: var(--c-ink); font-weight: 600; background: var(--c-white); }
.pagination a:hover { border-color: var(--c-ink); }
.pagination [aria-current="page"] { background: var(--c-accent); color: var(--c-white); border-color: var(--c-accent); }
.pagination .is-disabled { opacity: 0.4; pointer-events: none; }

/* Empty state */
.empty-state { text-align: center; background: var(--c-white); border: 1px dashed var(--c-line); border-radius: var(--r-lg); padding: clamp(2rem, 5vw, 3.5rem); }
.empty-state__icon { width: 64px; height: 64px; border-radius: 50%; background: var(--c-accent-soft); color: var(--c-accent-ink); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--sp-4); }
.empty-state__icon svg { width: 30px; height: 30px; }

/* ---------- Property detail ---------- */
.gallery { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 0.75rem; border-radius: var(--r-lg); overflow: hidden; }
.gallery__main { grid-row: 1 / 3; }
.gallery button { border: 0; padding: 0; overflow: hidden; position: relative; cursor: pointer; background: var(--c-cream-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3/2; transition: transform 0.5s var(--ease), opacity 0.2s var(--ease); }
.gallery__main img { aspect-ratio: 16/10; }
.gallery button:hover img { transform: scale(1.04); }
.gallery__more { position: absolute; inset: 0; background: rgba(20,19,17,0.55); color: var(--c-white); display: flex; align-items: center; justify-content: center; font-weight: 600; }
@media (max-width: 720px) { .gallery { grid-template-columns: 1fr 1fr; } .gallery__main { grid-row: auto; grid-column: 1 / -1; } }

.detail-layout { display: grid; grid-template-columns: 1fr 380px; gap: var(--sp-6); align-items: start; margin-top: var(--sp-6); }
@media (max-width: 940px) { .detail-layout { grid-template-columns: 1fr; } }
.detail-aside { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: var(--sp-4); }
@media (max-width: 940px) { .detail-aside { position: static; } }

.detail-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-4); flex-wrap: wrap; }
.detail-price { font-family: var(--font-serif); font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.6rem); color: var(--c-ink); font-weight: 600; }
.key-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); margin-block: var(--sp-5); }
@media (max-width: 560px) { .key-features { grid-template-columns: repeat(2, 1fr); } }
.key-feature { background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--sp-4); text-align: center; }
.key-feature svg { width: 26px; height: 26px; color: var(--c-accent); margin: 0 auto 0.5rem; }
.key-feature strong { display: block; font-family: var(--font-serif); font-size: 1.25rem; color: var(--c-ink); }
.key-feature span { font-size: 0.82rem; color: var(--c-muted); }

.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { text-align: left; padding: 0.8rem 0; border-bottom: 1px solid var(--c-line); font-size: 0.97rem; }
.spec-table th { color: var(--c-muted); font-weight: 500; width: 45%; }
.spec-table td { color: var(--c-ink); font-weight: 600; }

.amenities { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
@media (max-width: 620px) { .amenities { grid-template-columns: repeat(2, 1fr); } }
.amenities li { display: flex; align-items: center; gap: 0.6rem; font-size: 0.95rem; }
.amenities svg { width: 18px; height: 18px; color: var(--c-accent); }

.energy { display: inline-flex; align-items: center; gap: 0.6rem; }
.energy__grade { width: 42px; height: 42px; border-radius: var(--r-sm); background: #3f7d54; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--font-serif); }

.map-embed { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--c-line); background: var(--c-cream-2); }
.map-embed img { width: 100%; height: 340px; object-fit: cover; }

/* Mortgage simulator */
.range-field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: var(--sp-3); }
.range-field .range-head { display: flex; justify-content: space-between; font-size: 0.9rem; }
.range-field .range-head strong { color: var(--c-ink); }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 6px; background: var(--c-sand); border-radius: var(--r-pill); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--c-accent); cursor: pointer; border: 3px solid var(--c-white); box-shadow: var(--sh-1); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--c-accent); cursor: pointer; border: 3px solid var(--c-white); }
.mortgage-result { text-align: center; padding: var(--sp-4); background: var(--c-accent-soft); border-radius: var(--r-md); margin-top: var(--sp-3); }
.mortgage-result .quota { font-family: var(--font-serif); font-size: 2.2rem; color: var(--c-accent-ink); font-weight: 600; }

/* Price alert box */
.alert-box { background: var(--c-cream-2); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--sp-4); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--c-line); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 0.7rem 1rem; font-weight: 600; color: var(--c-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--c-ink); border-color: var(--c-accent); }
.tab-panel[hidden] { display: none; }

/* ---------- Blog ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }
.post-card { display: flex; flex-direction: column; gap: 0.7rem; }
.post-card__media { border-radius: var(--r-md); overflow: hidden; aspect-ratio: 3/2; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.post-card:hover .post-card__media img { transform: scale(1.05); }
.post-card__meta { font-size: 0.82rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.post-card h3 { font-size: 1.25rem; }
.post-card h3 a { color: var(--c-ink); }
.post-card h3 a:hover { color: var(--c-accent); }

.article-body { max-width: 72ch; margin-inline: auto; }
.article-body p, .article-body ul, .article-body ol, .article-body blockquote, .article-body h2, .article-body h3, .article-body figure { margin-bottom: var(--sp-4); }
.article-body h2 { margin-top: var(--sp-6); }
.article-body ul { list-style: disc; padding-left: 1.4rem; }
.article-body ul li { margin-bottom: 0.5rem; }
.article-body blockquote { border-left: 3px solid var(--c-accent); padding-left: var(--sp-4); font-family: var(--font-serif); font-size: 1.3rem; color: var(--c-ink); font-style: italic; }
.article-body img { border-radius: var(--r-md); }
.article-lead { font-size: var(--fs-lead); color: var(--c-ink-soft); }

/* ---------- FAQ / accordion ---------- */
.accordion { border-top: 1px solid var(--c-line); }
.accordion__item { border-bottom: 1px solid var(--c-line); }
.accordion__trigger { width: 100%; text-align: left; background: transparent; border: 0; padding: 1.3rem 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-family: var(--font-serif); font-size: 1.15rem; color: var(--c-ink); }
.accordion__trigger svg { width: 22px; height: 22px; flex-shrink: 0; transition: transform 0.25s var(--ease); color: var(--c-accent); }
.accordion__trigger[aria-expanded="true"] svg { transform: rotate(45deg); }
.accordion__panel { overflow: hidden; }
.accordion__panel[hidden] { display: none; }
.accordion__panel > div { padding-bottom: 1.3rem; color: var(--c-muted); max-width: 72ch; }

/* ---------- Calendar (meeting scheduler) ---------- */
.scheduler { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
@media (max-width: 760px) { .scheduler { grid-template-columns: 1fr; } }
/* Dues columnes formulari + calendari a Contacte (col·lapsen en mòbil) */
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); gap: var(--sp-5); align-items: start; }
@media (max-width: 940px) { .contact-layout { grid-template-columns: 1fr; } }
/* Calendari de reunions incrustat (Google Calendar, informatiu) */
.calendar-embed { width: 100%; border: 1px solid var(--c-line); border-radius: var(--r-md); overflow: hidden; background: var(--c-white); }
.calendar-embed iframe { display: block; width: 100%; height: 560px; border: 0; }
@media (max-width: 640px) { .calendar-embed iframe { height: 460px; } }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 150; width: min(680px, calc(100% - 24px));
  background: var(--c-ink); color: #d9d6cf; border-radius: var(--r-lg); padding: 1.1rem 1.4rem; box-shadow: var(--sh-3);
  display: flex; gap: var(--sp-3); align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.cookie-banner p { font-size: 0.9rem; max-width: 42ch; }
.cookie-banner a { color: var(--c-white); text-decoration: underline; }
.cookie-banner .btn-row { gap: 0.5rem; }
.cookie-banner[hidden] { display: none; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mb-0 { margin-bottom: 0; }
.divider { height: 1px; background: var(--c-line); border: 0; margin-block: var(--sp-5); }
.tag { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--c-accent-ink); background: var(--c-accent-soft); padding: 0.3rem 0.7rem; border-radius: var(--r-pill); }
.pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
