/* ============================================
   NOVdental — full de disseny
   Identitat: Manual de Contingut Visual NOVdental
   Paleta: #FFFFFF #A1A1A1 #A8A8A8 #D2D2D2 #858585
   Tipografia: Montserrat (Bold / SemiBold / Regular)
   ============================================ */

/* ============ TIPOGRAFIA MONTSERRAT (allotjada localment) ============
   Fitxers a assets/fonts/, descarregats de Google Fonts (v31, llicència
   Open Font License). Mateixos pesos i format que abans (woff2, swap),
   ara sense dependre de fonts.googleapis.com / fonts.gstatic.com. */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/montserrat-v31-latin-ext-400.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/montserrat-v31-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/montserrat-v31-latin-ext-500.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/montserrat-v31-latin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/montserrat-v31-latin-ext-600.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/montserrat-v31-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/montserrat-v31-latin-ext-700.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/montserrat-v31-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/montserrat-v31-latin-ext-800.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/montserrat-v31-latin-800.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --white: #ffffff;
  --gray-light: #d2d2d2;
  --gray: #a8a8a8;
  --gray-mid: #a1a1a1;
  --gray-dark: #858585;
  --ink: #333333;
  --ink-soft: #555555;
  --bg-soft: #fafafa;
  --line: #ececec;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.07);
  --max-width: 1180px;
  --max-width-narrow: 760px;

  /* Accent premium (editorial/fotogràfic) — complementa la paleta de grisos de marca */
  --gold: #ad8a58;
  --gold-light: #d8c19c;
  --dark: #1b1916;
  --dark-soft: #262320;
  --cream: #f6f2ea;

  /* Variants per a text i botons amb contrast WCAG AA (mateix to, més fosc);
     --gold i --gray-dark es mantenen per a vores, icones i detalls decoratius */
  --gold-dark: #866940;
  --gold-darker: #735a36;
  --text-muted: #6b6b6b;
  --on-photo-tag: #f3ead9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* scroll-padding-top: la capçalera fixa no tapa l'element enfocat ni els ancoratges */
html { scroll-behavior: smooth; overflow-x: hidden; scroll-padding-top: 96px; }

body {
  font-family: 'Montserrat', sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* height:auto: les imatges porten width/height reals a l'HTML (reserven l'espai abans
   de carregar); l'alçada es calcula per la proporció si cap regla la fixa */
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
address { font-style: normal; }
ul { list-style: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 { font-weight: 800; line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); margin-bottom: 16px; }
h3 { font-size: 1.15rem; font-weight: 700; }
h4 { font-size: 0.95rem; font-weight: 700; }

p { color: var(--ink-soft); }

.center { text-align: center; margin-left: auto; margin-right: auto; }

/* Text només per a lectors de pantalla i cercadors (p. ex. encapçalaments
   d'estructura); no es veu ni ocupa espai */
.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;
}

/* Enllaç "Salta al contingut": invisible fins que rep el focus amb el teclat */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 300;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
}
.skip-link:focus { top: 12px; }
/* El <main> rep el focus des de l'enllaç de salt; no cal contorn al bloc sencer */
#contingut:focus { outline: none; }

/* ---- Sense JavaScript ----
   La capçalera i el peu es generen amb JS (partials.js). Sense JS, cada pàgina
   mostra dins de <noscript> una navegació bàsica i els enllaços legals.
   html:not(.js) només s'aplica quan el JavaScript no s'ha executat. */
html:not(.js) body { padding-top: 0; }
html:not(.js) .site-header,
html:not(.js) body[data-header="transparent"] .site-header:not(.header-solid) {
  position: relative;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
html:not(.js) .site-header::before { display: none; }
.nojs-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.nojs-header .nojs-logo img { height: 36px; width: auto; }
.nojs-header nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.nojs-header nav a { font-size: 0.9rem; font-weight: 600; color: var(--ink-soft); }
.nojs-footer { background: var(--ink); color: #ddd; padding: 28px 0; font-size: 0.85rem; }
.nojs-footer p { color: #ddd; margin-bottom: 8px; }
.nojs-footer a { color: var(--white); text-decoration: underline; }
.nojs-footer .footer-ai-notice { color: #a6a6a6; font-size: 0.75rem; margin-bottom: 0; }

.eyebrow, .section-tag {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: 12px;
}

.lede {
  font-size: 1.05rem;
  max-width: 640px;
  margin-bottom: 8px;
}

.section { padding: 88px 0; position: relative; }
.section-tight { padding: 56px 0; }
.section-alt { background: var(--gray-light); }
.section-alt p { color: #4a4a4a; }
.section-alt .value-num,
.section-alt .stat-label { color: #6f6f6f; }
.section-divider { border-top: 1px solid var(--line); }

/* ============ BOTONS ============ */
.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: 0.3px;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  border: 1.5px solid transparent;
}
.btn-primary { background: var(--gold-dark); color: var(--white); }
.btn-primary:hover { background: var(--gold-darker); transform: translateY(-2px); }
.btn-outline { border-color: var(--gray-light); color: var(--ink); }
.btn-outline:hover { border-color: var(--gray-mid); transform: translateY(-2px); }
.btn-ghost { color: var(--gold-dark); font-weight: 700; font-size: 0.92rem; }
.btn-ghost::after { content: ' →'; }
.btn-small { padding: 10px 20px; font-size: 0.86rem; }
button.btn-ghost { background: none; border: none; padding: 0; font-family: inherit; cursor: pointer; }

/* ============ FOCUS AMB TECLAT (uniforme a tot el lloc) ============ */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
/* Sobre fons foscos o fotografies, el contorn passa a blanc */
.hero :focus-visible, .page-cover :focus-visible, .panorama :focus-visible,
.closing-cta :focus-visible, .section-dark :focus-visible, .gallery-strip :focus-visible,
.site-footer :focus-visible,
body[data-header="transparent"] .site-header:not(.header-solid):not(.nav-open) :focus-visible { outline-color: var(--white); }
/* Zona tàctil ampliada en pantalles tàctils, sense canvi visual (àrea invisible al voltant de l'enllaç) */
@media (pointer: coarse) {
  .btn-ghost, .breadcrumb a { position: relative; }
  .btn-ghost::before, .breadcrumb a::before { content: ''; position: absolute; inset: -12px -6px; }
}

/* ============ MODAL (p.ex. nota de filosofia) ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 22, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  /* En tancar, la visibilitat canvia al final del fos (0,3 s de retard) */
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
/* En obrir, la visibilitat canvia a l'instant: així el botó "Tancar" pot rebre el focus */
.modal-overlay.is-open { opacity: 1; visibility: visible; transition: opacity 0.3s ease, visibility 0s linear 0s; }

.modal-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 46px 42px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.32);
  transform: translateY(26px) scale(0.96);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
}
.modal-overlay.is-open .modal-card { transform: translateY(0) scale(1); opacity: 1; }

.modal-card h2 { font-size: 1.5rem; margin-bottom: 18px; padding-right: 30px; }
.modal-card p { margin-bottom: 14px; }
.modal-card p:last-of-type { margin-bottom: 0; }
.modal-card strong { color: var(--ink); font-weight: 700; }
.modal-actions { margin-top: 28px; }

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-soft);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.modal-close:hover { background: var(--bg-soft); color: var(--ink); transform: rotate(90deg); }
.modal-close svg { width: 16px; height: 16px; }

@media (max-width: 600px) {
  .modal-card { padding: 36px 26px; }
}

/* ============ HEADER (injectat per partials.js) ============ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: transform 0.35s ease;
}
.site-header.header-hidden { transform: translateY(-100%); }

/* La capçalera és fixed i queda fora del flux: reservem el seu espai amb padding-top al body */
body { padding-top: 78px; }
body[data-header="transparent"] { padding-top: 0; }

/* Capçalera transparent sobre la foto de portada (pàgines amb .hero o .page-cover) */
body[data-header="transparent"] .site-header {
  transition: transform 0.35s ease, background 0.3s ease, border-color 0.3s ease;
}
body[data-header="transparent"] .site-header:not(.header-solid) {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body[data-header="transparent"] .site-header:not(.header-solid) .logo img { filter: brightness(0) invert(1); }
body[data-header="transparent"] .site-header:not(.header-solid) .main-nav a { color: rgba(255,255,255,0.9); }
body[data-header="transparent"] .site-header:not(.header-solid) .main-nav a:hover { color: var(--white); }
body[data-header="transparent"] .site-header:not(.header-solid) .main-nav a.active { color: var(--white); border-color: var(--gold-light); }
body[data-header="transparent"] .site-header:not(.header-solid) .phone-link { color: var(--white); }
body[data-header="transparent"] .site-header:not(.header-solid) .nav-toggle span { background: var(--white); }
/* Degradat fosc suau darrere de la capçalera transparent (contrast del menú
   sobre fotos clares); desapareix quan la capçalera passa a blanca */
body[data-header="transparent"] .site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(100% + 48px);
  background: linear-gradient(180deg, rgba(15,14,12,0.6) 0%, rgba(15,14,12,0) 100%);
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.3s ease;
}
body[data-header="transparent"] .site-header.header-solid::before { opacity: 0; }
/* Amb el menú obert no es necessita i, com que el menú es pot desplaçar, ocuparia espai buit */
body[data-header="transparent"] .site-header.nav-open::before { display: none; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}
.logo img { height: 48px; width: auto; }

.main-nav { display: flex; gap: 30px; }
.main-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a.active { color: var(--ink); border-color: var(--gold); }

.header-actions { display: flex; align-items: center; gap: 18px; }
.phone-link { font-weight: 700; font-size: 0.9rem; color: var(--ink); }
.header-actions .btn { padding: 10px 22px; font-size: 0.86rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  /* Zona tàctil de 44×44 amb la mateixa icona de 34×34 (5px de farciment);
     el marge negatiu manté la icona alineada a la mateixa vora dreta */
  width: 44px;
  height: 44px;
  padding: 5px;
  margin-right: -5px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span { height: 2px; width: 100%; background: var(--ink); border-radius: 2px; }

/* ============ HERO — pàgina d'inici (foto de portada a pantalla completa) ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  color: var(--white);
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
/* Escriptori: el text ocupa la meitat esquerra; la capa fosca es concentra
   allí i s'aclarix cap a la dreta perquè es veja la clínica. La capa vertical
   només reforça el menú (dalt) i tanca suaument la foto (baix). */
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15,14,12,0.58) 0%, rgba(15,14,12,0.56) 47%, rgba(15,14,12,0.18) 72%, rgba(15,14,12,0.08) 100%),
    linear-gradient(180deg, rgba(15,14,12,0.30) 0%, rgba(15,14,12,0) 16%, rgba(15,14,12,0) 72%, rgba(15,14,12,0.22) 100%);
}
.hero-content { position: relative; z-index: 2; padding: 140px 0 120px; max-width: 620px; }
.hero .eyebrow { color: var(--on-photo-tag); }
/* L'etiqueta forma part del H1 (SEO: diu què és i on és) però es veu igual
   que quan era un paràgraf independent damunt del títol */
.hero h1 .eyebrow { display: block; line-height: 1.65; }
.hero h1 { color: var(--white); margin-bottom: 22px; font-size: clamp(1.75rem, 4.4vw, 2.6rem); max-width: 560px; }
.hero-text { color: #f1f1f1; font-size: 1.05rem; max-width: 520px; margin-bottom: 32px; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }
.hero .btn-outline { border-color: rgba(255,255,255,0.55); color: var(--white); }
.hero .btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }

/* ============ PAGE COVER — portada a pantalla completa de les pàgines interiors ============ */
.page-cover {
  position: relative;
  min-height: 62vh;
  display: flex;
  align-items: flex-end;
  color: var(--white);
  overflow: hidden;
}
.page-cover-media { position: absolute; inset: 0; overflow: hidden; }
.page-cover-media img { width: 100%; height: 100%; object-fit: cover; }
.page-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,14,12,0.28) 0%, rgba(15,14,12,0.42) 40%, rgba(15,14,12,0.82) 100%);
}
.page-cover-content { position: relative; z-index: 2; padding: 120px 0 56px; max-width: 680px; }
.page-cover .breadcrumb, .page-cover .breadcrumb a { color: var(--white); }
.page-cover .breadcrumb a:hover { text-decoration: underline; }
.page-cover h1 { color: var(--white); margin-bottom: 14px; }
.page-cover .lede { color: #f1efe9; }

.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--ink); }

/* ============ PAGE HERO SENZILL — pàgines de text (legals), sense fotografia ============ */
.page-hero {
  padding: 56px 0 64px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.page-hero h1 { max-width: 560px; }

/* ============ SECCIONS AMB VARIANT DE COLOR ============ */
.section-cream { background: var(--cream); }
.section-cream p { color: #5c5648; }

.section-dark { background: var(--dark); color: #f1efe9; }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark p { color: #cfcabf; }
.section-dark .section-tag { color: var(--gold-light); }
.section-dark .btn-outline { border-color: rgba(255,255,255,0.55); color: var(--white); }
.section-dark .btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.1); }

/* ============ GALERIA EN FRANJA (fons fosc, fotografia real) ============ */
.gallery-strip { background: var(--dark); padding: 88px 0; }
.gallery-strip .section-tag,
.gallery-strip h2 { text-align: center; }
.gallery-strip h2 { color: var(--white); }
.gallery-strip .section-tag { color: var(--gold-light); display: block; }
.gallery-strip-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 44px;
}
.gallery-strip-row .hover-zoom { aspect-ratio: 3 / 4; border-radius: var(--radius-sm); }
.gallery-strip-row img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .gallery-strip-row { grid-template-columns: repeat(2, 1fr); }
}

/* ============ BANDA DE TANCAMENT (CTA final a pantalla completa) ============ */
.closing-cta {
  position: relative;
  min-height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  overflow: hidden;
}
.closing-cta-media { position: absolute; inset: 0; overflow: hidden; }
.closing-cta-media img { width: 100%; height: 100%; object-fit: cover; }
.closing-cta-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,14,12,0.68) 0%, rgba(15,14,12,0.55) 50%, rgba(15,14,12,0.72) 100%);
}
.closing-cta-content { position: relative; z-index: 2; max-width: 560px; padding: 64px 24px; }
.closing-cta h2 { color: var(--white); }
.closing-cta p { color: #efece5; }
.closing-cta .section-tag { color: var(--on-photo-tag); }
.closing-cta .btn-outline { border-color: rgba(255,255,255,0.55); color: var(--white); }
.closing-cta .btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.1); }

/* ============ FORMES ORGÀNIQUES DECORATIVES (identitat de marca) ============ */
.deco-blob {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gray-light), transparent 70%);
  opacity: 0.5;
  filter: blur(6px);
  pointer-events: none;
  z-index: 0;
}
.section .deco-blob.behind-title { width: 320px; height: 320px; top: -60px; left: 50%; transform: translateX(-50%); opacity: 0.4; }

/* ============ FRANJA DE CONFIANÇA (dades reals) ============ */
.trust-strip {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: -64px;
  padding: 10px 0;
}
.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
}
.trust-item:last-child { border-right: none; }
.trust-item .trust-num { font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.trust-item .trust-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.trust-item .trust-note { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* ============ FILA D'ICONES D'ESPECIALITATS ============ */
.icon-badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 34px;
  margin-top: 56px;
  padding-top: 46px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}
.icon-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100px;
  text-align: center;
}
.icon-badge .badge-circle {
  width: 58px; height: 58px; border-radius: 50%;
  border: 1.5px solid var(--gray);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-dark);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.icon-badge .badge-circle svg,
.icon-badge .badge-circle img { width: 26px; height: 26px; object-fit: contain; }
.icon-badge span { font-size: 0.76rem; font-weight: 600; color: var(--ink-soft); }
.icon-badge:hover .badge-circle { border-color: var(--ink); transform: translateY(-3px); box-shadow: 0 8px 16px rgba(0,0,0,0.12); }

/* ============ MINI GALERIA (franges de fotos) ============ */
.mini-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.mini-gallery img {
  border-radius: var(--radius-sm);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  box-shadow: var(--shadow);
  transition: transform 0.35s ease;
}
.mini-gallery img:hover { transform: scale(1.03); }

/* ============ EDITORIAL SPLIT ============ */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.split.reverse .split-media { order: 2; }
.split-media { position: relative; }
.split-media img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.split-text blockquote {
  border-left: 3px solid var(--gray-mid);
  padding-left: 20px;
  margin: 24px 0;
  font-style: italic;
  color: var(--ink);
  font-weight: 500;
  font-size: 1.05rem;
}

.stat-row { display: flex; gap: 40px; margin-top: 30px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--gray-dark); }
.stat-label { font-size: 0.82rem; color: var(--gray-dark); text-transform: uppercase; letter-spacing: 1px; }

/* ============ VALORS ============ */
.values-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.value-card { padding: 8px; }
.value-num { font-size: 0.8rem; font-weight: 800; color: var(--text-muted); margin-bottom: 10px; }
.value-card h3 { margin-bottom: 8px; }
.value-card p { font-size: 0.92rem; }

/* ============ GALERIA (instal·lacions) ============ */
/* Tres fotos iguals en proporció 4:5; l'alçada es calcula a partir de l'amplada */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 20px;
}
.gallery-grid .frame { width: 100%; aspect-ratio: 4 / 5; border-radius: var(--radius-sm); overflow: hidden; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-grid .frame:hover img { transform: scale(1.08); }

/* Gabinet vist des de dalt: logotip, llum, equip i cadira */
.gallery-grid .img-gabinet-zenital-crop { object-position: center 55%; }
/* Recepció apaïsada: el taulell és a la meitat esquerra i baixa de la foto */
.gallery-grid .img-recepcio-taulell-crop { object-position: 20% 70%; }

/* ============ TRACTAMENTS ============ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.service-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.service-card.is-linked { cursor: pointer; }
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.service-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--gray-mid), var(--ink) 140%);
  display: flex; align-items: center; justify-content: center;
  color: var(--white); margin-bottom: 20px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 10px 22px rgba(0,0,0,0.16);
}
.service-card:hover .service-icon { transform: scale(1.1) rotate(-4deg); box-shadow: 0 14px 28px rgba(0,0,0,0.22); }
.service-icon svg { width: 28px; height: 28px; stroke-width: 1.6; }
.service-icon img { width: 30px; height: 30px; object-fit: contain; }
.service-card p { font-size: 0.92rem; margin-bottom: 14px; }
.service-card .btn-ghost { font-size: 0.85rem; }
.service-note { font-size: 0.82rem; color: var(--gray-dark); }

/* Variant amb fotografia real (targeta destacada) */
.service-card.photo-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.service-card.photo-card .photo-wrap { aspect-ratio: 16 / 11; overflow: hidden; }
.service-card.photo-card .photo-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.service-card.photo-card:hover .photo-wrap img { transform: scale(1.06); }
.service-card.photo-card .photo-card-body { padding: 24px 26px 28px; }
.service-card.photo-card .badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--white); background: var(--gray-dark);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 12px;
}

/* ============ EQUIP ============ */
.team-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  margin-top: 44px;
}
.team-card { text-align: center; }
.team-card .frame {
  border-radius: var(--radius);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.team-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.team-card:hover img { transform: scale(1.08); }
.team-card h3 { font-size: 1.02rem; margin-bottom: 4px; }
.team-card .role { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.team-card .specialty { font-size: 0.82rem; color: var(--ink-soft); margin-top: 2px; }

/* ============ OPINIONS ============ */
.reviews-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.review-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.stars { color: var(--gray-dark); letter-spacing: 3px; margin-bottom: 14px; }
.review-card p { font-size: 0.92rem; flex-grow: 1; }
.review-source {
  display: block; margin-top: 16px; font-size: 0.78rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
}

/* ============ CONTACTE ============ */
.contact-list { margin: 26px 0 30px; display: flex; flex-direction: column; gap: 18px; }
.contact-list li { display: flex; flex-direction: column; gap: 3px; }
.contact-list strong { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.contact-list span, .contact-list a { font-size: 1rem; color: var(--ink); }
.contact-list a:hover { color: var(--text-muted); }
.map-wrap { min-height: 340px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
/* El mapa ocupa tot el contenidor (mateixa alçada mínima que el bloc previ) */
.map-wrap .map-frame { display: block; width: 100%; height: 100%; min-height: 340px; border: 0; }
/* El contenidor retalla (overflow: hidden): el contorn de focus va per dins */
.map-wrap .map-frame:focus-visible { outline-offset: -3px; }
/* Enllaç "Com arribar" sota l'adreça */
.contact-list .contact-directions { align-self: flex-start; font-size: 0.9rem; font-weight: 700; color: var(--gold-dark); margin-top: 4px; }
.contact-list .contact-directions::after { content: ' →'; }
.contact-list .contact-directions:hover { text-decoration: underline; }

/* Bloc de consentiment previ al mapa: substitueix l'iframe de Google Maps
   fins que l'usuari decidisca carregar-lo voluntàriament. */
.map-placeholder {
  width: 100%;
  height: 100%;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 32px 28px;
  background: var(--cream);
}
.map-placeholder-icon { width: 40px; height: 40px; color: var(--gold); }
.map-placeholder-text { font-size: 0.98rem; font-weight: 600; color: var(--ink); }
.map-placeholder-note { font-size: 0.78rem; color: var(--text-muted); max-width: 320px; }
.map-placeholder-note a { color: inherit; text-decoration: underline; }

.contact-form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-field input, .form-field select, .form-field textarea {
  border: 1.5px solid #949494;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--white);
}
/* Focus del formulari: vora fosca + el contorn general de :focus-visible */
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--ink);
}
.form-note { font-size: 0.8rem; color: var(--text-muted); }
/* Camps obligatoris: asterisc discret (la llegenda "* Camps obligatoris" ho explica) */
.req { color: var(--gold-dark); font-weight: 700; margin-left: 3px; }
/* Camp marcat com a incorrecte per la validació */
.form-field [aria-invalid="true"] { border-color: #7a2b2b; }
.form-consent input[aria-invalid="true"] { outline: 2px solid #7a2b2b; outline-offset: 2px; }
.form-confirm-error p { color: inherit; }
.form-confirm ul { list-style: disc; padding-left: 20px; margin-top: 6px; }
.form-confirm li + li { margin-top: 2px; }
.form-confirm {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.9rem;
  color: var(--ink);
}
.form-confirm-ok { background: #f2f6f2; border-color: #c9dcc9; }
.form-confirm-error { background: #fbf1f1; border-color: #e3b8b8; color: #7a2b2b; }
.form-confirm-error a { color: #7a2b2b; text-decoration: underline; }
#contactSubmit:disabled { opacity: 0.65; cursor: not-allowed; }
.form-privacy-info { font-size: 0.78rem; line-height: 1.55; color: var(--text-muted); border-top: 1px solid var(--line); padding-top: 14px; }
.form-privacy-info p { margin: 0 0 4px; }
.form-privacy-info a, .form-consent a { color: inherit; text-decoration: underline; }
.form-consent .consent-label { display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; font-weight: 500; color: var(--ink); text-transform: none; letter-spacing: 0; cursor: pointer; }
.form-consent input[type="checkbox"] { width: 18px; height: 18px; padding: 0; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--gold); cursor: pointer; }

/* ============ PROSE (pàgines legals) ============ */
.prose { max-width: var(--max-width-narrow); }
.prose h2 { margin-top: 36px; }
.prose p, .prose li { margin-bottom: 14px; }
.prose ul { padding-left: 20px; }
.prose ul li { list-style: disc; }
.legal-pending {
  background: var(--bg-soft);
  border: 1px dashed var(--gray-light);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 30px;
}

/* ============ ACCORDIÓ (pàgines legals) ============ */
.accordion { border-top: 1px solid var(--line); }
.accordion-item { border-bottom: 1px solid var(--line); }
.accordion-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 2px;
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--ink);
}
.accordion-item summary::-webkit-details-marker,
.accordion-item summary::marker { display: none; content: ""; }
.accordion-item summary:hover { color: var(--gold-dark); }
.accordion-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  transition: transform 0.3s ease, background 0.2s ease, border-color 0.2s ease;
}
/* Es gira només el símbol (+ → ×), no el cercle: es veu igual i el cercle girat
   ja no desborda la línia del títol */
.accordion-icon svg { width: 13px; height: 13px; transition: transform 0.3s ease; }
.accordion-item[open] .accordion-icon { background: var(--cream); border-color: var(--gold); }
.accordion-item[open] .accordion-icon svg { transform: rotate(45deg); }
.accordion-body { padding: 0 2px 24px; }
.accordion-body p { margin-bottom: 14px; }
.accordion-body p:last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) {
  .accordion-icon, .accordion-icon svg { transition: none; }
}

/* ============ FOOTER (injectat per partials.js) ============ */
.site-footer { background: var(--ink); color: #ddd; padding: 64px 0 0; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
/* Títols de columna del peu: H2 (jerarquia correcta) amb el mateix aspecte que tenien com a H4 */
.footer-col .footer-heading { color: #f2f2f2; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 1px; font-size: 0.8rem; font-weight: 700; line-height: 1.2; }
.footer-col a, .footer-col address {
  display: block;
  color: #bbb;
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.footer-col a:hover { color: var(--white); }
.footer-logo { height: 24px; width: auto; margin-bottom: 14px; filter: brightness(0) invert(1); }
.footer-tagline { color: #ddd; font-weight: 600; font-size: 0.92rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 0;
  text-align: center;
}
.footer-bottom p { color: #a6a6a6; font-size: 0.78rem; }
.footer-bottom .footer-ai-notice { margin-top: 4px; font-size: 0.75rem; }

/* ============ WHATSAPP FLOAT ============ */
.whatsapp-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25D366;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  z-index: 60;
  transition: transform 0.2s ease, opacity 0.25s ease, visibility 0s linear 0s;
}
.whatsapp-fab:hover { transform: scale(1.06); }

/* Portada en mòbil (≤480px, o en horitzontal amb ≤500px d'alçada): el botó s'amaga
   mentre els botons principals passen per la franja inferior on es troba (main.js afig
   .fab-visible quan no els tapa; la condició és la mateixa que a main.js).
   Amb visibility: hidden no rep el focus ni l'anuncien els lectors de pantalla. */
@media (max-width: 480px), (max-width: 1024px) and (orientation: landscape) and (max-height: 500px) {
  .js body[data-page="inici"] .whatsapp-fab:not(.fab-visible) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.25s ease, visibility 0s linear 0.25s;
  }
  /* Sense JavaScript: el botó deixa de flotar i apareix com un enllaç més al final
     de la portada (no tapa res i WhatsApp continua accessible) */
  html:not(.js) body[data-page="inici"] .whatsapp-fab {
    position: relative;
    right: auto;
    bottom: auto;
    margin: 24px auto;
  }
}
.whatsapp-fab svg { width: 26px; height: 26px; position: relative; z-index: 1; }
.whatsapp-fab::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #25D366;
  opacity: 0.55;
  animation: waPulse 2.6s ease-out infinite;
}
@keyframes waPulse {
  0% { transform: scale(0.85); opacity: 0.55; }
  100% { transform: scale(1.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .whatsapp-fab::after { animation: none; display: none; }
}

/* ============================================
   EFECTES D'IMATGE PREMIUM
   ============================================ */

/* ---- Scroll-driven image animation (paral·laxi + zoom subtil en fer scroll) ---- */
[data-scroll-fx] {
  will-change: transform;
  transform: translateY(0) scale(1.001);
}
@media (prefers-reduced-motion: reduce) {
  [data-scroll-fx] { transform: none !important; }
}

/* ---- Image crossfade (dues imatges apilades que es fonen l'una en l'altra) ---- */
.crossfade { position: relative; width: 100%; height: 100%; }
.crossfade img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.crossfade img.cf-a { animation: crossfadeA 16s ease-in-out infinite; }
.crossfade img.cf-b { animation: crossfadeB 16s ease-in-out infinite; }
@keyframes crossfadeA { 0%, 42% { opacity: 1; } 55%, 92% { opacity: 0; } 100% { opacity: 1; } }
@keyframes crossfadeB { 0%, 42% { opacity: 0; } 55%, 92% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .crossfade img.cf-a, .crossfade img.cf-b { animation: none; }
  .crossfade img.cf-b { opacity: 0; }
}

/* ---- Image hover zoom (targeta amb marc que retalla el zoom en passar el ratolí) ---- */
.hover-zoom { display: block; overflow: hidden; border-radius: var(--radius); }
.hover-zoom img { transition: transform 0.6s cubic-bezier(0.16, 0.84, 0.24, 1); }
.hover-zoom:hover img { transform: scale(1.07); }

/* ---- Mask reveal (la imatge es desvela amb un "escombrat" en entrar en pantalla) ---- */
.mask-reveal { position: relative; overflow: hidden; }
.mask-reveal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: clip-path 1.3s cubic-bezier(0.16, 0.84, 0.24, 1), transform 1.6s cubic-bezier(0.16, 0.84, 0.24, 1);
}
/* L'estat inicial amagat només s'aplica amb JavaScript (html.js): sense JS la imatge es veu */
.js .mask-reveal img { clip-path: inset(0 100% 0 0); transform: scale(1.12); }
.js .mask-reveal.is-visible img { clip-path: inset(0 0 0 0); transform: scale(1); }
.mask-reveal--card { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 16 / 11; }
/* Foto vertical en targeta 16:11: centra el tall en el monitor amb la radiografia i l'instrumental */
.mask-reveal .img-tecnologia-crop { object-position: center 43%; }
@media (prefers-reduced-motion: reduce) {
  .js .mask-reveal img { clip-path: inset(0); transform: none; transition: none; }
}

/* ---- Banda panoràmica de pantalla completa amb mask-reveal + paral·laxi ---- */
.panorama {
  position: relative;
  min-height: 56vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--white);
}
.panorama .mask-reveal { position: absolute; inset: 0; }
.panorama .mask-reveal img { height: 108%; top: -4%; position: relative; }
.panorama-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30,30,30,0.56) 0%, rgba(20,20,20,0.70) 100%);
}
.panorama-content { position: relative; z-index: 2; text-align: center; max-width: 620px; margin: 0 auto; }
.panorama-content .section-tag { color: #f2f2f2; }
.panorama-content h2 { color: var(--white); }
.panorama-content p { color: #ececec; }
.panorama-content .btn-outline { border-color: rgba(255,255,255,0.55); color: var(--white); }
.panorama-content .btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.1); }

@media (max-width: 760px) {
  .panorama { min-height: 46vh; }
}

/* ============ REVEAL (microinteracció discreta) ============ */
/* Només amb JavaScript (html.js): sense JS tot el contingut es veu directament */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Imatge que apareix difuminada i s'enfoca en revelar-se */
.js .img-blur-in {
  filter: blur(22px);
  transform: scale(1.04);
  transition: filter 1.3s ease, transform 1.3s ease;
}
.js .img-blur-in.is-visible { filter: blur(0); transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .img-blur-in { filter: none; transform: none; transition: none; }
}

/* ============================================
   RESPONSIVE
   4 nivells: mòbil vertical (≤480), mòbil horitzontal (≤767),
   tauleta (≤1024), escriptori (>1024, estils base de dalt)
   ============================================ */

/* ---- TAULETA I PER DAVALL (≤1024px) ---- */
@media (max-width: 1024px) {
  .container { padding: 0 20px; }

  /* La capçalera completa (logo + nav + telèfon + botó) no cap en amplades
     de tauleta: usem el mateix menú hamburguesa que en mòbil des d'ací. */
  .main-nav, .header-actions { display: none; }
  .nav-toggle { display: flex; }

  /* Panell desplegable en flux normal (sense posicions fixes ni desplaçaments
     codificats): logo i botó de menú es queden a la fila de dalt, i el nau
     i les accions s'apilen davall en una sola columna. */
  /* Menú obert: mai més alt que la pantalla (mòbil en horitzontal); si no cap,
     es desplaça per dins. Queda per damunt del botó flotant de WhatsApp. */
  .site-header.nav-open {
    background: var(--white) !important;
    border-bottom: 1px solid var(--line);
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 70;
  }
  .site-header.nav-open .logo img { filter: none !important; }
  .site-header.nav-open .nav-toggle span { background: var(--ink) !important; }
  .site-header.nav-open .header-inner {
    height: auto;
    flex-wrap: wrap;
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  }
  .site-header.nav-open .logo { order: 1; }
  .site-header.nav-open .nav-toggle { order: 2; }
  .site-header.nav-open .main-nav {
    display: flex;
    flex-direction: column;
    order: 3;
    flex-basis: 100%;
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }
  .site-header.nav-open .main-nav a {
    color: var(--ink-soft) !important;
    padding: 12px 2px;
    border-bottom: 1px solid var(--line);
  }
  .site-header.nav-open .main-nav a:hover,
  .site-header.nav-open .main-nav a.active { color: var(--ink) !important; }
  .site-header.nav-open .header-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    order: 4;
    flex-basis: 100%;
    width: 100%;
    gap: 14px;
    margin-top: 16px;
  }
  .site-header.nav-open .header-actions .phone-link { color: var(--ink) !important; text-align: center; }
  .site-header.nav-open .header-actions .btn { width: 100%; text-align: center; }

  /* Graelles: reduïm columnes perquè el text no vaja massa comprimit */
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(3, 1fr); }
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .reviews-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .trust-strip { grid-template-columns: repeat(2, 1fr); margin-top: 30px; }
  .trust-item { border-bottom: 1px solid var(--line); }
  .trust-item:nth-child(2n) { border-right: none; }
  .mini-gallery { grid-template-columns: repeat(3, 1fr); }

  /* Seccions en dues columnes a escriptori: apilades en tauleta i mòbil */
  .split { grid-template-columns: 1fr; gap: 32px; }
  .split-media { order: -1 !important; }

  /* Portades a pantalla completa: reduïm una mica el paddings */
  .hero-content { padding: 120px 0 90px; }
  .page-cover-content { padding-top: 100px; }

  /* Portada d'inici: el text ocupa quasi tot l'ample; la capa fosca es limita
     a la franja vertical del text i la foto respira dalt i baix */
  .hero-overlay { background: linear-gradient(180deg, rgba(15,14,12,0.18) 0%, rgba(15,14,12,0.18) 16%, rgba(15,14,12,0.60) 28%, rgba(15,14,12,0.60) 74%, rgba(15,14,12,0.26) 88%, rgba(15,14,12,0.20) 100%); }
  /* Sense menú de text (només icona), la capçalera de la portada pot ser més lleugera */
  body[data-page="inici"] .site-header::before { background: linear-gradient(180deg, rgba(15,14,12,0.45) 0%, rgba(15,14,12,0) 100%); }
}

/* ---- NOMÉS TAULETA (768–1024px) ----
   La fila d'icones de tractaments és flex-wrap: a amplada de tauleta hi
   caben 7 badges per fila i el 8é queda sol davall. Ho forcem a graella
   4x2 només en este rang; escriptori (flex, 8 en una fila) i mòbil
   (flex-wrap, com fins ara) no es toquen. */
@media (min-width: 768px) and (max-width: 1024px) {
  .icon-badge-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    justify-items: center;
  }
}

/* ---- TAULETA VERTICAL (768–899px) ----
   Tres columnes quedarien massa xicotetes: dues fotos verticals dalt i la
   recepció (foto apaïsada) a tot l'ample davall, en format panoràmic. */
@media (min-width: 768px) and (max-width: 899px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid .frame:last-child { grid-column: span 2; aspect-ratio: 16 / 9; }
}

/* ---- MÒBIL, VERTICAL I HORITZONTAL (≤767px) ---- */
@media (max-width: 767px) {
  .section { padding: 56px 0; }
  .section-tight { padding: 40px 0; }
  .hero { min-height: 92vh; }
  .hero-content { padding: 110px 0 64px; }
  /* En mòbil el text ocupa del 25% al 80% de l'alçada: només s'aclarix dalt i baix */
  .hero-overlay { background: linear-gradient(180deg, rgba(15,14,12,0.20) 0%, rgba(15,14,12,0.60) 23%, rgba(15,14,12,0.60) 82%, rgba(15,14,12,0.30) 100%); }
  .page-cover { min-height: 56vh; }
  .page-cover-content { padding-top: 96px; padding-bottom: 40px; }
  /* En mòbil el text de la portada queda més amunt: reforcem la franja central */
  .page-cover-overlay { background: linear-gradient(180deg, rgba(15,14,12,0.28) 0%, rgba(15,14,12,0.55) 35%, rgba(15,14,12,0.82) 100%); }
  .panorama { min-height: 42vh; }
  .closing-cta { min-height: 44vh; }
  .closing-cta-content { padding: 48px 20px; }
  .page-hero { padding: 40px 0 44px; }

  h1 { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  h2 { font-size: clamp(1.4rem, 5.5vw, 1.7rem); }

  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-grid .frame { aspect-ratio: 4 / 3; }
  /* La primera foto (gabinet vist des de dalt) és vertical: manté el 4:5 */
  .gallery-grid .frame:first-child { aspect-ratio: 4 / 5; }
  .trust-strip { grid-template-columns: 1fr; margin-top: 24px; }
  .trust-item { border-right: none; }
  .mini-gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery-strip-row { grid-template-columns: repeat(2, 1fr); }
  .icon-badge-row { gap: 22px; row-gap: 26px; }

  /* Botons en columna i a tot l'ample: més fàcils de tocar i sense
     que es queden massa junts en amples xicotets */
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; text-align: center; }

  /* Espai final perquè el botó flotant de WhatsApp no tape l'últim contingut
     (.site-footer per a tindre prioritat sobre ".container { padding }") */
  .site-footer .footer-bottom { padding-bottom: 76px; }
}

/* ---- CAMPS DEL FORMULARI EN MÒBIL I TAULETA ----
   16px: Safari d'iPhone i iPad no amplia la pàgina en tocar-los
   (també iPhone en horitzontal i tauletes tàctils de més de 1024px) */
@media (max-width: 1024px), (pointer: coarse) {
  .form-field input, .form-field select, .form-field textarea { font-size: 16px; }
}

/* ---- MÒBIL HORITZONTAL AMB POCA ALÇADA (evita portades desproporcionades) ---- */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .hero { min-height: 100vh; }
  .hero-content { padding: 100px 0 32px; }
  /* Poca alçada: el text ocupa quasi tota la portada, capa uniforme */
  .hero-overlay { background: linear-gradient(180deg, rgba(15,14,12,0.45) 0%, rgba(15,14,12,0.60) 20%, rgba(15,14,12,0.60) 100%); }
  .page-cover { min-height: 100vh; align-items: center; }
  .page-cover-content { padding: 96px 0 32px; }
  .panorama, .closing-cta { min-height: 100vh; }
  /* Botó de WhatsApp més xicotet i més arrimat a la vora, i espai final */
  .whatsapp-fab { width: 48px; height: 48px; right: 14px; bottom: 14px; }
  .whatsapp-fab svg { width: 24px; height: 24px; }
  .site-footer .footer-bottom { padding-bottom: 76px; }
}

/* ---- MÒBIL VERTICAL (320–480px) ---- */
@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .logo img { height: 34px; }
  .header-inner { height: 66px; }
  body { padding-top: 66px; }
  body[data-header="transparent"] { padding-top: 0; }

  .section { padding: 44px 0; }
  .hero-content {
    padding: 96px 0 48px;
    max-width: 86%;
    margin-left: auto;
    margin-right: auto;
  }
  .hero h1 br { display: none; }
  .page-cover-content { padding-top: 84px; }

  .services-grid { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .mini-gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gallery-strip-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .icon-badge-row { gap: 18px; row-gap: 22px; }
  .icon-badge { width: 84px; }
  /* "Odontopediatria" (una sola paraula de ~94px) no cap en 84px: la seua etiqueta
     pot ocupar 6px més per cada costat, dins de l'espai entre icones. No canvia
     l'amplada de la icona, la distribució ni el salt de línia de la resta d'etiquetes */
  .icon-badge[href$="/odontopediatria"] span { margin: 0 -6px; }
  /* Botó de WhatsApp més xicotet i més arrimat a la vora */
  .whatsapp-fab { width: 48px; height: 48px; right: 14px; bottom: 14px; }
  .whatsapp-fab svg { width: 24px; height: 24px; }

  .modal-card { padding: 32px 22px; }
  .section .deco-blob.behind-title { width: 220px; height: 220px; }
}
