/* =========================================================
   responsive.css — Ajustes responsive globales y por página
   Depende de: reset.css, style.css, pages.css
   Breakpoints: 1200 / 992 / 768 / 600 / 480
   ========================================================= */


/* =========================
   ≤ 1200px (lg)
   ========================= */
@media (max-width: 1200px) {

  /* Hero (global) */
  .hero-container{
    width: min(94%, 1200px);
    padding: 1.6rem 2rem 0.5rem;
  }

  /* Imagen hero home */
  .hero-image-2 img{ height: 320px; }

  /* Grid experiencia / tarjetas (home + nosaltres) */
  .exp-grid{
    grid-template-columns: repeat(3, 1fr);
  }

  /* Staff (EQUIP) */
  .page-equip .staff-photo{
    width: 160px; height: 160px;
  }

  /* Mútues */
  .page-mutues .mutues-grid{
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    width: min(1000px, 94%);
  }
}


/* =========================
   ≤ 992px (md)
   ========================= */
@media (max-width: 992px) {

  /* Navbar básico (sin JS de toggle) */
  .navbar{
    padding: 0 28px;
    margin-top: 28px;
    gap: 16px;
  }
  .menu-toggle{ display: block; }  /* visible, aunque no se use */
  .contact-info{ display: none; }  /* ganamos espacio en tablets */
  .nav-links{
    gap: 6px;
    flex-wrap: wrap;
  }
  .nav-links a{ padding: 10px 16px; font-size: 1rem; }

  /* Hero dos columnas → proporciones más cómodas */
  .hero-text{ flex-basis: 58%; max-width: 58%; margin-left: 24px; }
  .hero-image{ margin-right: 40px; }
  .hero-image-2{ margin-right: 2rem; }
  .hero-image-2 img{ height: 290px; }

  /* Experiencia / tarjetas */
  .exp-grid{
    grid-template-columns: repeat(2, 1fr);
  }

  /* “Clínica” card ancha */
  .clinica-card{
    width: 94%;
  }
  .clinica-card__content{
    grid-template-columns: 1fr minmax(440px, 700px) 1fr;
    padding: 1rem 2rem 1.25rem;
  }
  .clinica-card__text h2{ font-size: 2.2rem; }

  /* Contacte: tres columnas → dos */
  .contact-rows__grid{
    grid-template-columns: repeat(2, 1fr);
  }

  /* Staff (EQUIP): 12 cols → cards a 6 col (2 por fila) */
  .page-equip .staff-grid{ grid-template-columns: repeat(12, 1fr); }
  .page-equip .staff-card{ grid-column: span 6; }

  /* Nosaltres hero */
  .page-nosaltres .hero-image img{
    max-width: 380px;
    border-radius: 1.1rem;
    filter: brightness(1.05) saturate(0.95) blur(0.3px);
  }

  /* Mútues: 3 → 2 columnas */
  .page-mutues .mutues-grid{
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    width: min(820px, 96%);
  }

  /* Footer */
  .footer-container{ width: 94%; }
}


/* =========================
   ≤ 768px (sm/tablet)
   ========================= */
@media (max-width: 768px) {

  /* Tipografía del hero */
  .hero-text h1{ font-size: 2.2rem; }
  .hero-text h2{ font-size: 1rem; max-width: 52ch; }
  .hero-buttons{ gap: 0.8rem; margin-top: 1.2rem; }

  /* Hero: stack vertical */
  .hero{
    min-height: auto;
    padding-top: 0.5rem;
  }
  .hero-container{
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem 1rem;
    min-height: unset;
  }
  .hero-text{
    flex-basis: auto;
    max-width: 100%;
    margin: 0;
    text-align: center;
  }
  .hero-image,
  .hero-image-2{
    flex-basis: auto;
    margin: 0;
    justify-content: center;
    align-self: center;
  }
  .hero-image img,
  .hero-image-2 img{
    height: 240px;
    max-width: 85%;
  }

  /* Tarjetas experiencia */
  .exp-card{ padding-bottom: 3.4rem; }
  .exp-card__icon img{ width: 76px; }

  /* “Clínica” card */
  .clinica-card{
    aspect-ratio: auto;
    min-height: 300px;
  }
  .clinica-card__content{
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    padding: 1rem 1rem 1.25rem;
  }
  .clinica-card__text{
    grid-column: 1; grid-row: 1; padding-top: 22px;
  }
  .clinica-card__content .btn-primary{
    grid-column: 1; grid-row: 2; margin-top: .75rem;
  }
  .clinica-card__text h2{ font-size: 2rem; }

  /* Contacte: mapa más bajo */
  .contact-map__card iframe{ height: 340px; }

  /* Nosaltres: cards más apretadas */
  .page-nosaltres .invest-text{ margin-bottom: 1.25rem; }
  .page-nosaltres .experience.section .exp-grid{
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Mútues: tarjetas algo más compactas */
  .page-mutues .mutua-card{
    max-width: 260px;
    padding: 1.25rem .9rem;
  }
  .page-mutues #consulta-cobertures{
    width: 94%;
    margin: 4rem auto 3rem;
    padding: 2.5rem 1.25rem;
  }

  /* Footer padding */
  .footer-content{ padding: 2.2rem 1.25rem; }

   /* 🔹 HERO TRACTAMENTS: ocultar títulos h2 y h3 */
  .page-tractaments .hero h2,
  .page-tractaments .hero h3 {
    display: none !important;
  }

  /* 🔹 Texto introductorio debajo del hero */
  .page-tractaments .intro p {
    display: none !important;
  }

  /* 🔹 Párrafo dentro de cada ficha de tractament */
  .page-tractaments .exp-card p {
    display: none !important;
  }
}


/* =========================
   ≤ 600px (xs grande)
   ========================= */
@media (max-width: 600px) {

  /* Menú en columna (siempre visible) */
  .nav-links{
    width: 100%;
    justify-content: center;
    gap: 8px 10px;
  }
  .nav-links a{
    padding: 8px 14px;
    font-size: .95rem;
  }
  

  /* Grids a 1 columna */
  .exp-grid,
  .page-nosaltres .experience.section .exp-grid{
    grid-template-columns: 1fr !important;
  }
  .contact-rows__grid{
    grid-template-columns: 1fr;
  }
  .page-equip .staff-card{ grid-column: 1 / -1; }

  /* Hero imágenes aún más bajas */
  .hero-image img,
  .hero-image-2 img{
    height: 210px;
  }

  /* Mútues: 1 columna */
  .page-mutues .mutues-grid{
    grid-template-columns: 1fr;
    width: min(520px, 94%);
  }

  /* CTA flotante: compacta */
  .floating-cta{ right: 14px; bottom: 14px; gap: 8px; }
  .cta-btn{ padding: .7rem .95rem; font-size: .95rem; }
}


/* =========================
   ≤ 480px (xs)
   ========================= */
@media (max-width: 480px) {

  /* H1/H2 más contenidos */
  .hero-text h1{ font-size: 1.9rem; }
  .hero-text h2{ font-size: .98rem; }

  /* Botones redondos compactos */
  .btn-primary, .btn-secondary{
    padding: .72rem 1.1rem;
    border-width: 2px;
  }

  /* Tarjetas: icono más pequeño y texto cómodo */
  .exp-card__icon img{ width: 68px; }
  .invest-card__icon img{ width: 72px; }
  .invest-card{ min-height: 220px; padding: 1.8rem 1.4rem; }

  /* Contacte: mapa */
  .contact-map__card iframe{ height: 300px; }

  /* Footer textos */
  .footer-text h2{ font-size: 1.6rem; }
  .footer-links{ gap: .8rem; }
}

/* =========================================================
   🔹 NAVBAR RESPONSIVE DESPLEGABLE
   ========================================================= */

/* Botón hamburguesa */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  content: "";
  display: block;
  height: 3px;
  width: 26px;
  background: var(--text-dark);
  border-radius: 3px;
  transition: 0.3s ease;
}

.hamburger::before { transform: translateY(-7px); }
.hamburger::after { transform: translateY(4px); }

/* Animación al abrir */
.menu-toggle.active .hamburger {
  background: transparent;
}
.menu-toggle.active .hamburger::before {
  transform: rotate(45deg);
}
.menu-toggle.active .hamburger::after {
  transform: rotate(-45deg);
  translate: 0 -3px;
}

/* Menú móvil (oculto por defecto) */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }

  .navbar{ position: relative; }

/* Menú compacto, debajo del botón (derecha) */
    .nav-links{
    position: absolute;
    top: calc(100% + 10px);     /* debajo del navbar */
    right: 12px;                /* alineado al botón */
    left: auto;                 /* evita pegarse a la izquierda */
    width: clamp(220px, 70vw, 320px);   /* tamaño más pequeño */
    max-height: min(70vh, 440px);       /* por si hay muchos links */
    overflow: auto;

    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    padding: .85rem 1rem;

    flex-direction: column;
    align-items: stretch;
    gap: .6rem;

    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transform-origin: top right;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 2000;
    }

    .nav-links.show{
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    }

    /* Links más compactos */
    .nav-links li{ width: 100%; }
    .nav-links a{
    display: block;
    padding: .55rem .2rem;
    font-size: .98rem;
    line-height: 1.1;
    border-radius: 10px;
    }
    .nav-links a:hover{
    background: #f5f7fb;
    }

  /* Hero: ajustes HOME */
    .hero{
    margin-top: 14px;                 /* separa del header */
    min-height: auto;
    padding-top: 0.5rem;
  }

  /* Apilar y centrar contenido del hero */
  .hero-container{
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 1.5rem 1rem 1.25rem;     /* un pelín más de aire */
    width: min(90%, 640px);
  }

  /* Ocultar imagen del hero en responsive */
  .hero-image,
  .hero-image-2{
    display: none !important;
  }

  /* Centrar textos */
  .hero-text{
    text-align: center;
    margin: 0 auto;
    max-width: 680px;
    max-width: 90%;
  }

  /* Centrar los botones */
  .hero-buttons{
    display: flex;                    /* por si no lo era ya */
    justify-content: center;
    align-items: center;
    gap: .9rem;
    margin-top: 1rem;
  }

   .exp-header h3 {
    display: none !important;
  }

  /* 🔹 Hacer las tarjetas más pequeñas y mantenerlas centradas */
  .experience.section .exp-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;       /* centradas horizontalmente */
    gap: 1rem;
  }

  .experience.section .exp-card {
    flex: 0 1 48%;                 /* ocupa el 50% del ancho aprox. */
    max-width: 240px;              /* límite para no crecer demasiado */
    padding: 1rem 0.75rem 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,.05);
  }

  .experience.section .exp-card__icon img {
    width: 68px;
    height: auto;
  }

   /* 🔹 Ocultar subtítulo en el bloque "El nostre equip" */
  .page-index .clinica-card__text h3,
  .clinica-card__text h3 {
    display: none !important;
  }
}

/* === TRACTAMENTS: hero más alto y H1 centrado en móvil/tablet === */
@media (max-width: 768px) {
  /* El propio bloque hero */
   /* Hero general */
  .page-tractaments .hero {
    margin-top: 14px !important;       /* misma separación con el header */
    min-height: 220px !important;      /* mismo alto que el resto */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 1.5rem 1rem !important;
  }

  /* Contenedor interno */
  .page-tractaments .hero-container {
    width: min(92%, 720px) !important;
    min-height: 180px !important;      /* ↑ altura */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;     /* centra vertical */
    justify-content: center !important; /* centra horizontal */
    text-align: center !important;
    padding: 1.25rem 1rem !important;   /* algo de aire interno */
    gap: .5rem !important;
  }

  /* Títulos del hero */
  .page-tractaments #hero-tractaments h1 {
    margin: 0 !important;
    font-size: clamp(1.8rem, 4.5vw, 2.2rem) !important;
  }
  .page-tractaments #hero-tractaments h2,
  .page-tractaments #hero-tractaments h3 {
    display: none !important;           /* como pediste antes */
  }
}

@media (max-width: 768px) {
  /* 🔹 Igualar tamaño de H1 en página EQUIP */
  .page-equip .hero h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.2rem) !important;
    text-align: center;
    margin: 0 auto;
  }

  /* 🔹 Ajustar contenedor del hero */
  .page-equip .hero-container {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 160px; /* igual que en Tractaments */
    padding: 1.5rem 1rem;
  }

  .page-equip .hero {
    margin-top: 14px !important;       /* misma separación que el resto */
    min-height: 180px !important;      /* mismo alto que en tractaments */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 2rem 1rem !important;
  }

  .page-equip .hero-container {
    width: min(92%, 720px) !important;
    min-height: 180px !important;      /* ↑ altura */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;     /* centra vertical */
    justify-content: center !important; /* centra horizontal */
    text-align: center !important;
    padding: 1.25rem 1rem !important;   /* algo de aire interno */
    gap: .5rem !important;
  }

  .page-equip .hero h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.2rem) !important;
    margin: 0 !important;
  }
  
}

/* =========================================================
   🔹 HERO NOSALTRES (igual que TRACTAMENTS)
   ========================================================= */
@media (max-width: 768px) {

  /* Hero igual que el de tractaments */
  .page-nosaltres .hero {
    margin-top: 14px !important;       /* misma separación con el header */
    min-height: 220px !important;      /* misma altura que tractaments */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 1.5rem 1rem !important;
  }

  .page-nosaltres .hero-container {
     width: min(92%, 720px) !important;
    min-height: 180px !important;      /* ↑ altura */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;     /* centra vertical */
    justify-content: center !important; /* centra horizontal */
    text-align: center !important;
    padding: 1.25rem 1rem !important;   /* algo de aire interno */
    gap: .5rem !important;
  }

  /* Título principal */
  .page-nosaltres .hero h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.2rem) !important;
    margin: 0 !important;
  }

  /* 🔹 Ocultar subtítulo del hero */
  .page-nosaltres .hero h2 {
    display: none !important;
  }

   /* 🔹 Sección "Per què triar la Clínica Dental Ribas?" */
  .page-nosaltres .invest-text h3 {
    display: none !important;          /* oculta el subtítulo */
  }

  .page-nosaltres .invest-text h2 {
    padding-left: 0.75rem !important;  /* más sangría izquierda */
    line-height: 1.4;
  }

   /* 🔹 Centrar las tarjetas del bloque Tractaments en Nosaltres */
  .page-nosaltres .experience.section .exp-grid {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center !important;   /* centra horizontalmente */
    align-items: center;
    gap: 0.9rem;                           /* separación entre tarjetas */
    padding: 0 1rem;                       /* aire lateral */
  }

  .page-nosaltres .experience.section .exp-card {
    flex: 0 1 44%;                         /* dos por fila */
    max-width: 180px;
    min-height: 160px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.04);
  }

  .page-nosaltres .experience.section .exp-card__icon img {
    width: 58px;
    height: auto;
  }

  .page-nosaltres .experience.section .exp-card h3 {
    font-size: 0.95rem;
    margin-top: 0.5rem;
  }
}

/* =========================================================
   🔹 HERO MÚTUES (igual que los demás heroes)
   ========================================================= */
@media (max-width: 768px) {

  /* Hero general */
  .page-mutues .hero {
    margin-top: 14px !important;       /* misma separación con el header */
    min-height: 220px !important;      /* mismo alto que el resto */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 1.5rem 1rem !important;
  }

  /* Contenedor interno */
  .page-mutues .hero-container {
    width: min(92%, 720px) !important;
    min-height: 180px !important;      /* ↑ altura */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;     /* centra vertical */
    justify-content: center !important; /* centra horizontal */
    text-align: center !important;
    padding: 1.25rem 1rem !important;   /* algo de aire interno */
    gap: .5rem !important;
  }

  /* Título principal */
  .page-mutues .hero h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.2rem) !important;
    margin: 0 !important;
  }

  /* 🔹 Ocultar subtítulos */
  .page-mutues .hero h2,
  .page-mutues .hero h3 {
    display: none !important;
  }
}

/* =========================================================
   🔹 HERO CONTACTE (unificado con el resto) – móvil/tablet
   ========================================================= */
@media (max-width: 768px) {

  /* Hero: mismo alto, margen y centrado */
  .page-contacte .hero {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    text-align: center !important;
    margin-top: 14px !important;
    min-height: 220px !important;
    padding: 1.5rem 1rem !important;
  }

  .page-contacte .hero-container {
    width: min(92%, 720px) !important;
    min-height: 180px !important; 
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: min(92%, 720px) !important;
    text-align: center !important;
    padding: 1.25rem 1rem !important;
    gap: .5rem !important;
  }

  .page-contacte .hero h1 {
    margin: 0 !important;
    text-align: center !important;
    font-size: clamp(1.8rem, 4.5vw, 2.2rem) !important;
  }

  /* Ocultar todo lo demás dentro del hero */
  .page-contacte .hero h2,
  .page-contacte .hero p,
  .page-contacte .hero .hero-buttons,
  .page-contacte .hero .btn-primary,
  .page-contacte .hero .btn-secondary {
    display: none !important;
  }
}

/* =========================================================
   Endodòncia / pàgines de tractament — ajustes responsive
   ========================================================= */
@media (max-width: 768px){

  /* 1) Ocultar el H2 del HERO */
  .page-tractament .hero .hero-text h2{
    display: none !important;
  }

  /* 2) Ocultar los párrafos intro de los blocs 2, 3 y 4 */
  .page-tractament #simptomes p,
  .page-tractament #beneficis p,
  .page-tractament #reserva p{
    display: none !important;
  }

  /* 3) Botón “Reserva ara” más compacto */
  .page-tractament #reserva .btn-primary{
    min-width: 180px;
    padding: .75rem 1.1rem;
    font-size: .95rem;
    box-shadow: 0 8px 20px rgba(9,124,63,.16);
  }
}

/* Afinado extra en móviles muy pequeños */
@media (max-width: 480px){
  .page-tractament #reserva .btn-primary{
    min-width: 160px;
    padding: .68rem 1rem;
    font-size: .92rem;
  }
}


@media (max-width: 768px) {

  /* Contenedor de tarjetas centrado horizontalmente */
  .page-index .experience.section .exp-grid,
  .container.exp-grid {
    display: flex !important;
    flex-wrap: nowrap !important;         /* todas en una fila */
    justify-content: center !important;   /* 🔹 centradas horizontalmente */
    align-items: center !important;
    gap: 0.7rem !important;               /* espacio entre tarjetas */
    overflow-x: auto !important;
    padding: 0.5rem 1rem !important;
    grid-template-columns: none !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  /* Tarjetas pequeñas */
  .page-index .experience.section .exp-card {
    flex: 0 0 auto !important;
    width: 120px !important;
    min-height: 120px !important;
    padding: 0.7rem 0.5rem !important;
    border-radius: 12px;
    text-align: center;
    scroll-snap-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,.05);
    background: linear-gradient(180deg, #f9fffc 0%, #ebfff5 100%);
  }

  .page-index .experience.section .exp-card__icon img {
    width: 46px !important;
    height: auto;
  }

  .page-index .experience.section .exp-card h3 {
    font-size: 0.85rem !important;
    margin-top: 0.4rem;
  }

  /* Ocultar scrollbar (estético) */
  .page-index .experience.section .exp-grid::-webkit-scrollbar {
    display: none;
  }
  .page-index .experience.section .exp-grid {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
}

/* =========================================================
   TRACTAMENTS – Grid 3×N en móvil/tablet
   ========================================================= */
@media (max-width: 768px) {

  /* 🔹 3 columnas, centradas y con espacio entre ellas */
  .page-tractaments .experience.section .exp-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important; /* ✅ 3 columnas */
    gap: 0.7rem !important;
    justify-items: center;
    align-items: stretch;
    padding: 0 1rem;
    overflow: visible !important;
  }

  /* 🔹 Tarjetas más proporcionadas */
  .page-tractaments .experience.section .exp-card {
    width: 100%;
    max-width: 140px;            /* ajustado para 3 por fila */
    min-height: 150px;
    padding: .7rem .5rem;
    text-align: center;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,.05);
    background: linear-gradient(180deg, #f9fffc 0%, #ebfff5 100%);
  }

  /* 🔹 Iconos y texto adaptados */
  .page-tractaments .experience.section .exp-card__icon img {
    width: 46px;
    height: auto;
  }

  .page-tractaments .experience.section .exp-card h3 {
    font-size: 0.9rem;
    margin-top: 0.4rem;
  }
}


/* =========================================================
   TRACTAMENTS – Ajustes para pantallas pequeñas (≤600px)
   ========================================================= */
@media (max-width: 600px) {
  /* 🔹 2 columnas centradas */
  .page-tractaments .experience.section .exp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important; /* ✅ ahora 2 columnas */
    gap: 0.7rem !important;
    justify-items: center;
    padding: 0 0.5rem !important;
  }

  /* 🔹 Tarjetas proporcionadas */
  .page-tractaments .experience.section .exp-card {
    width: 100% !important;
    max-width: 150px !important;
    min-height: 120px !important;
    padding: 0.6rem 0.5rem !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, #f9fffc 0%, #ebfff5 100%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    text-align: center;
  }

  /* 🔹 Iconos más pequeños */
  .page-tractaments .experience.section .exp-card__icon img {
    width: 38px !important;
    height: auto;
  }

  .page-tractaments .experience.section .exp-card__icon img{
    width: 36px !important;                 /* -2px */
    height: auto;
  }

  /* títulos que no ensanchan la tarjeta */
  .page-tractaments .experience.section .exp-card h3{
    font-size: 0.82rem !important;          /* -0.03rem */
    line-height: 1.2;
    margin-top: 0.35rem !important;
    text-align: center;
    white-space: normal;                     /* puede saltar de línea */
    word-break: break-word;                  /* rompe palabras largas */
    overflow-wrap: anywhere;
    hyphens: auto;
    display: -webkit-box;                    /* 2 líneas máx. */
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}



/* =========================================================
   🔹 HERO HOME — más estrecho + sin h3 en móviles
   ========================================================= */
@media (max-width: 600px) {
  /* Solo afecta al hero de la home */
  body:not(.page-nosaltres):not(.page-equip):not(.page-mutues):not(.page-contacte):not(.page-tractaments) .hero-container {
    width: 84% !important;            /* 🔹 aún más estrecho */
    max-width: 320px !important;      /* 🔹 reduce el límite */
    padding: 1rem 0.9rem !important;  /* 🔹 ajusta el aire interior */
    border-radius: 1.6rem !important;
  }

  /* Ajustar altura del bloque hero */
  body:not(.page-nosaltres):not(.page-equip):not(.page-mutues):not(.page-contacte):not(.page-tractaments) .hero {
    min-height: auto !important;
    margin-top: 1rem !important;
    justify-content: center !important;
  }

  /* Centrar texto y reducir tipografía */
  .hero-text {
    text-align: center !important;
    margin: 0 auto !important;
  }

  .hero-text h1 {
    font-size: clamp(1.2rem, 5.5vw, 1.6rem) !important; /* 🔹 más pequeño */
    line-height: 1.25 !important;
  }

  .hero-text h2 {
    display: none !important;
  }

  /* Ocultar imagen del hero */
  .hero-image,
  .hero-image-2 {
    display: none !important;
  }
}

/* =========================================================
   🔹 Secció "La nostra experiència" — Menys espai en mòbils
   ========================================================= */
@media (max-width: 600px) {
  .experience.section {
    padding: 2.5rem 0 3rem 0 !important; /* 🔹 abans: 6rem 0 */
  }

  /* També pots reduir una mica el gap entre el títol i les targetes */
  .exp-header {
    margin-bottom: 1.5rem !important;
  }

  /* I opcionalment ajustar l'espai intern de cada targeta */
  .exp-card {
    padding: 0.8rem 0.6rem 1rem !important;
  }
}


/* =========================================================
   HOME — Experiència: botón debajo del título en móviles
   ========================================================= */
@media (max-width: 600px) {
  /* Contenedor principal */
  .experience .exp-header {
    display: flex !important;
    flex-direction: column !important;  /* apilar título y botón */
    align-items: center !important;     /* centrar contenido */
    text-align: center !important;
    gap: 0.8rem;
  }

  /* El bloque de títulos ocupa todo el ancho */
  .experience .exp-header__titles {
    width: 100% !important;
  }

  /* Botón debajo del título */
  .experience .exp-header .btn-primary {
    order: 2 !important;
    margin-top: 0.5rem !important;
    align-self: center !important;      /* centrado */
    padding: 0.6rem 1rem !important;
    font-size: 0.95rem !important;
  }
}

/* =========================================================
   INDEX — Tarjetas experiencia ultra-compactas (móviles pequeños)
   ========================================================= */

/* Móviles comunes (≤ 600px) */
@media (max-width: 600px) {
  .experience .exp-grid {
    display: flex !important;
    flex-wrap: nowrap !important;          /* 1 sola fila */
    justify-content: center !important;
    align-items: stretch !important;
    gap: .5rem !important;
    overflow-x: auto !important;           /* evita solapes: permite scroll */
    padding: .5rem .75rem !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .experience .exp-card {
    flex: 0 0 auto !important;             /* tamaño fijo, no se estira */
    width: 110px !important;
    min-height: 118px !important;
    padding: .6rem .45rem !important;
    border-radius: 12px;
    text-align: center;
    scroll-snap-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,.05);
  }

  .experience .exp-card__icon img {
    width: 42px !important;
    height: auto;
  }

  .experience .exp-card h3 {
    font-size: .82rem !important;
    line-height: 1.15 !important;
    margin-top: .35rem !important;
    white-space: nowrap;                    /* evita saltos raros */
  }
}

/* Móviles muy pequeños (iPhone 12 Mini/SE y similares ≤ 400px) */
@media (max-width: 400px) {
  .experience .exp-grid { gap: .45rem !important; padding: .45rem .6rem !important; }

  .experience .exp-card {
    width: 96px !important;                /* 🔹 aún más pequeñas */
    min-height: 106px !important;
    padding: .5rem .4rem !important;
    border-radius: 10px;
  }

  .experience .exp-card__icon img { width: 36px !important; }
  .experience .exp-card h3 { font-size: .75rem !important; }
}

/* Oculta la barra de scroll (estético) */
.experience .exp-grid::-webkit-scrollbar { display: none; }
.experience .exp-grid { -ms-overflow-style: none; scrollbar-width: none; }


/* =========================================================
   INDEX — Experiència: 2 columnas x 2 filas (móviles)
   ========================================================= */
@media (max-width: 600px) {
  .experience .exp-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; /* 🔹 2 columnas */
    gap: 0.8rem !important;                            /* 🔹 separación */
    justify-items: center !important;
    align-items: stretch !important;
    width: 92% !important;
    margin: 0 auto !important;
    padding: 0.5rem 0 !important;
  }

  .experience .exp-card {
    width: 100% !important;
    max-width: 160px !important;
    min-height: 140px !important;
    padding: 0.75rem 0.5rem !important;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    background: linear-gradient(180deg, #f9fffc 0%, #ebfff5 100%);
  }

  .experience .exp-card__icon img {
    width: 52px !important;
    height: auto;
  }

  .experience .exp-card h3 {
    font-size: 0.9rem !important;
    line-height: 1.2 !important;
    margin-top: 0.45rem !important;
  }
}

/* =========================================================
   INDEX — Secció "Confía en la nostra Clínica dental" (invest)
   ========================================================= */
@media (max-width: 600px) {
  .invest-text h2 {
    font-size: 25.6px !important; /* 🔹 més petit */
    line-height: 1.25 !important;                     /* 🔹 més compacte */
    max-width: 18ch !important;                       /* 🔹 evita línies molt llargues */
    margin: 0 auto 0.5rem auto !important;            /* 🔹 centra i separa una mica */
    text-align: center !important;
  }

  .invest-text h3 {
    font-size: clamp(0.9rem, 3.8vw, 1rem) !important;
    line-height: 1.4 !important;
    text-align: center !important;
    max-width: 36ch !important;
    margin: 0 auto !important;
  }
}

/* =========================================================
   🔹 Secció "Confía en la nostra Clínica dental" (invest)
   ========================================================= */
@media (max-width: 600px) {
  .invest {
    padding: 2.5rem 1.5rem 2.8rem 1.5rem !important; /* 🔹 antes: ~6rem 2rem */
  }

  /* Opcional: reducir margen entre el título y las tarjetas */
  .invest-text {
    margin-bottom: 1.6rem !important;
  }

  /* Ajustar las tarjetas al nuevo espacio */
  .invest-card {
    padding: 0.8rem 0.6rem 1rem !important;
  }
}

/* 📱 Ocultar iconos de las fichas de la sección .invest en móviles */
@media (max-width: 600px) {
  .invest-card__icon { 
    display: none !important; 
  }

  /* Ajustes de la tarjeta cuando no hay icono */
  .invest-card {
    min-height: auto;
    padding: 1.4rem 1.2rem;
  }

  .invest-card h3 { 
    margin-bottom: .35rem; 
  }
}

/* =============== TRACTAMENTS (solo responsive, scoping por #tractaments) =============== */

/* ≤1200px: 3 columnas */
@media (max-width: 1200px) {
  #tractaments .exp-grid{
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.25rem !important;
  }
}

/* ≤992px: 2 columnas */
@media (max-width: 992px) {
  #tractaments .exp-grid{
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
  }
}

/* ≤768px: tarjetas más compactas (igual que index) */
@media (max-width: 768px) {
  /* títulos centrados como en la home */
  #tractaments .exp-header__titles{
    text-align: center !important;
  }
  #tractaments .exp-header__titles h2{
    margin-bottom: .25rem !important;
  }
  #tractaments .exp-header__titles h3{
    max-width: 600px !important;
    margin: 0 auto 1.25rem !important;
    font-size: 1.05rem !important;
    line-height: 1.5 !important;
  }

  /* grid 2×N y proporciones de tarjeta */
  #tractaments .exp-grid{
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
    width: min(1100px, 92%) !important;
    margin-inline: auto !important;
    padding-top: 1rem !important;
  }

  #tractaments .exp-card{
    min-height: 160px !important;
    padding: 1.2rem 1rem 3.2rem !important;
    border-radius: 18px !important;
  }

  #tractaments .exp-card__icon img{
    width: 76px !important;
  }

  #tractaments .exp-card h3{
    font-size: 1rem !important;
    margin-top: .4rem !important;
    text-align: center !important;
  }
}

/* ≤600px: igual que index (2 columnas centradas, tarjeta + pequeña) */
@media (max-width: 600px) {
  #tractaments .exp-grid{
    grid-template-columns: repeat(2, 1fr) !important;
    gap: .8rem !important;
    justify-items: center !important;
    width: 92% !important;
    margin: 0 auto !important;
    padding: .5rem 0 !important;
  }

  #tractaments .exp-card{
    width: 100% !important;
    max-width: 160px !important;
    min-height: 140px !important;
    padding: .75rem .5rem !important;
    border-radius: 14px !important;
    text-align: center !important;
  }

  #tractaments .exp-card__icon img{
    width: 52px !important;
    height: auto !important;
  }

  #tractaments .exp-card h3{
    font-size: .9rem !important;
    line-height: 1.2 !important;
    margin-top: .45rem !important;
  }
}

/* ≤480px: ajuste fino como en la home */
@media (max-width: 480px) {
  #tractaments .exp-card{
    max-width: 150px !important;
    min-height: 130px !important;
    padding: .65rem .45rem 1rem !important;
    border-radius: 12px !important;
  }
  #tractaments .exp-card__icon img{ width: 46px !important; }
  #tractaments .exp-card h3{ font-size: .85rem !important; }
}

/* 📱 Ocultar cabecera del bloque de contacto en móviles */
@media (max-width: 600px) {
  .contact-rows__header {
    display: none !important;
  }
}

/* =========================================================
   HERO — versión móvil (≤600px)
   Añade la imagen entre el título y los botones
   ========================================================= */
@media (max-width: 600px) {
  .hero-container {
    flex-direction: column !important;
    align-items: center !important;
    padding: 2rem 1rem !important;
    gap: 1.2rem !important;
  }

  .hero-text {
    max-width: 100% !important;
    text-align: center !important;
    margin: 0 !important;
  }

  /* 🔹 Oculta la imagen lateral grande */
  .hero-image-2 {
    order: 2; /* se reordenará en móvil */
    display: flex !important;
    justify-content: center !important;
    margin: 1rem 0 0 0 !important;
  }

  /* 🔹 Imagen pequeña centrada */
  .hero-image-2 img {
    width: 70% !important;      /* más pequeña */
    max-width: 240px !important;
    height: auto !important;
    border-radius: 1.2rem !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  }

  /* 🔹 Reordena los bloques: título → imagen → botones */
  .hero-text h1 { order: 1; }
  .hero-image-2 { order: 2; }
  .hero-buttons { order: 3; margin-top: 1rem !important; }
}

/* =========================================================
   HERO móvil: imagen entre título y botón + recorte
   ========================================================= */
.hero-inline { display: none; } /* por defecto, oculta (desktop) */

@media (max-width: 600px) {
  .hero-container{
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 1.6rem 1rem !important;
  }

  .hero-text{
    width: 100% !important;
    text-align: center !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
  }

  .hero-text h1 {
  margin: 0 !important;
  }

  /* 🔹 Mostrar la imagen inline y ocultar la lateral */
 .hero-inline{
  display: block;
  width: 85%;
  max-width: 320px;
  margin: .2rem auto 0;
  overflow: hidden;   /* recorta la parte superior */
  padding: 0;         /* ❌ elimina borde blanco */
  box-shadow: none;   /* ❌ elimina sombra */
  background: none;   /* ❌ sin fondo */
  }

  .hero-inline img{
    display: block;
    width: 100%;
    height: 195px;                    /* recorte vertical */
    object-fit: cover;                /* recorta sin deformar */
    object-position: 50% 18%;         /* 👈 ajusta foco (brazos) */
  }

  .hero-image-2{
    display: none !important;         /* oculta la imagen de escritorio */
  }

  /* Un poco de aire antes del botón */
  .hero-buttons{
    margin-top: .4rem !important;
  }
}





