/* Estils propis (no de la maqueta) per a controls afegits: toggle de capa del
   mapa, marcadors POI i perfil d'elevació. Carregat DESPRÉS del CSS de la maqueta. */

/* Botó selector de capa base del mapa */
.map-layer-toggle {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #343534;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.map-layer-toggle:hover {
  background: #84bf41;
  color: #fff;
  border-color: #84bf41;
}

/* Toggle de zones protegides — a dalt a l'esquerra */
.map-protected-toggle {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #343534;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.map-protected-toggle.active {
  background: #2e7d32;
  color: #fff;
  border-color: #2e7d32;
}

/* Cercador de rutes: botó X per esborrar el text (només si n'hi ha), a l'esquerra
   de la lupa; el camp reserva espai perquè el text no quedi sota els dos botons. */
.troba-search .search-clear {
  position: absolute;
  top: 11px;
  right: 40px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #343534;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.troba-search .search-clear:hover {
  background: #84bf41;
  color: #fff;
}
.view-tab ul.tab-list li .troba-search.has-clear input[type="text"] {
  padding-right: 75px;
}
/* Mateix cercador (.troba-search) però al capçal de Serveis (.serveis-top),
   sobre fons fosc: la icona per defecte (#343534) hi seria invisible. */
.serveis-top .troba-search.has-clear input[type="text"] {
  padding-right: 75px;
}
.serveis-top .troba-search .search-clear {
  color: #fff;
}

/* Mateix botó X per als cercadors de Notícies/Activitats (.notices-search,
   fons clar: no en tenien cap regla pròpia perquè no existia el botó). */
.notices-search .search-clear {
  position: absolute;
  top: 12px;
  right: 38px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #343534;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notices-search .search-clear:hover {
  background: #84bf41;
  color: #fff;
}
.notices-search.has-clear input[type="text"] {
  padding-right: 65px;
}

/* Cercador de rutes del mapa de la home (.filter-search, dins .rutes-lft,
   fons fosc): mateix botó X, colors clars com la resta del camp. */
.filter-search .search-clear {
  position: absolute;
  top: 12px;
  right: 38px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.filter-search .search-clear:hover {
  background: #84bf41;
  color: #343534;
}
.filter-search.has-clear input[type="text"] {
  padding-right: 70px;
}

/* Botó de centrar la ruta: control natiu de MapLibre (grup de dalt a la dreta),
   amb la mateixa mida i estil que zoom / brúixola / pantalla completa. */
.maplibregl-ctrl-group .map-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #343534;
  cursor: pointer;
}
.maplibregl-ctrl-group .map-reset-btn img {
  display: block;
}

/* Icona de pantalla completa pròpia (substitueix la de MapLibre). Només hi ha una
   icona: es fa servir tant per entrar com per sortir de pantalla completa. */
.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon,
.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {
  background-image: url('/maqueta/images/ico-map-fullscreen.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}

/* Marcador POI (icona de categoria) — mida com a la maqueta (pins grossos 83×98) */
.poi-marker {
  width: 46px;
  height: 54px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center bottom;
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

/* Perfil d'elevació */
.elevation-profile {
  width: 100%;
  float: left;
  margin: 20px 0;
}
.elevation-profile h4 {
  font-family: 'DMSans-Bold', sans-serif;
  font-size: 18px;
  color: #343534;
  margin-bottom: 10px;
}
.elevation-range {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #6b6b6b;
  margin-top: 6px;
}
.elevation-chart {
  display: grid;
  grid-template-columns: 52px 1fr;
  grid-template-rows: 220px auto;
  font-size: 12px;
  color: #6b6b6b;
}
.elevation-y {
  position: relative;
}
.elevation-y span {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  white-space: nowrap;
}
.elevation-plot {
  position: relative;
  touch-action: pan-y;
  cursor: crosshair;
}
.elevation-plot svg {
  width: 100%;
  height: 100%;
  display: block;
}
.elevation-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #84BF41;
  border: 2px solid #fff;
  pointer-events: none;
}
.elevation-tip {
  position: absolute;
  top: 4px;
  padding: 3px 8px;
  background: #343534;
  color: #fff;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}
.elevation-x {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

/* Mapa de ruta: alçada raonable (la maqueta el deixava massa alt ~837px).
   El contenidor no ha de limitar amb max-height més petit que el mapa. */
.serveis-list-content.rutes-single {
  max-height: none;
}
/* El mapa fa la mateixa alçada que el bloc de Rutes (la columna esquerra té
   max-height 730px). Així el mapa i la llista queden alineats. */
.home-map-div {
  height: 730px !important;
  width: 100%;
}
.home-map-div #map {
  height: 100%;
}

/* Els popups sempre per sobre dels marcadors (inici 2, final 3, incidències 2). */
.maplibregl-popup {
  z-index: 10;
}

/* Popup POI (estil maqueta) dins del popup de MapLibre */
.maplibregl-popup-content {
  padding: 0 !important;
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
}
/* Només l'àncora "bottom" (popup per sobre del marcador, fletxa avall — el cas
   habitual): forçar sempre border-top-color afegia una vora blanca extra i
   incorrecta quan el popup s'ancorava a "left"/"right"/cantonades (el
   navegador ajusta l'àncora si no hi ha espai a la posició per defecte),
   deformant la fletxa perquè quedaven dues vores visibles alhora en comptes
   d'una de sola. maplibre-gl.css ja posa blanc la vora correcta per a la
   resta d'àncores; no cal tocar-les. */
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
  border-top-color: #fff !important;
}
/* Àncores de cantonada (top-left/top-right/bottom-left/bottom-right, quan el
   marcador queda a prop del marge del mapa): MapLibre hi dibuixa un mig
   triangle enganxat a la cantonada, que amb border-radius:14px quedava
   deformat. Es fa servir el mateix triangle simètric (20×10) que a l'àncora
   per defecte, a 14px del cantó perquè la base quedi sobre el tram recte de la
   vora (14px de radi + 10px de mig triangle = 24px fins a la punta), i es
   desplaça tot el popup 24px amb la propietat `translate` (se suma al
   `transform` que posa MapLibre) perquè la punta continuï caient al marcador. */
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
  border-left: 10px solid transparent !important;
  border-right: 10px solid transparent !important;
  border-top: 10px solid #fff !important;
  border-bottom: none !important;
}
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
  border-left: 10px solid transparent !important;
  border-right: 10px solid transparent !important;
  border-bottom: 10px solid #fff !important;
  border-top: none !important;
}
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {
  margin-left: 14px;
}
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
  margin-right: 14px;
}
.maplibregl-popup-anchor-top-left,
.maplibregl-popup-anchor-bottom-left {
  translate: -24px 0;
}
.maplibregl-popup-anchor-top-right,
.maplibregl-popup-anchor-bottom-right {
  translate: 24px 0;
}
/* Fitxa de servei: botó "Tornar als serveis" (contorn fosc; verd en hover, com la
   resta de botons del site). */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 25px;
  padding: 10px 18px;
  border: 2px solid #343534;
  color: #343534;
  font-family: 'DMSans-Bold', sans-serif;
  font-size: 14px;
  line-height: 24px;
  letter-spacing: -0.28px;
  text-transform: uppercase;
  transition: all 0.3s ease;
}
.back-btn:hover {
  background: #84bf41;
  border-color: #84bf41;
  color: #343534;
}

/* Final de ruta als mapes: rodona amb el fons a quadres d'una bandera de meta. */
.finish-flag-marker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: conic-gradient(#1a1919 25%, #fff 0 50%, #1a1919 0 75%, #fff 0) 0 0 / 13px 13px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Botó X de tancar dels popups del mapa de rutes: el per defecte de MapLibre és
   un "×" minúscul sense fons, invisible sobre la imatge de portada. */
.home-map-div .maplibregl-popup-close-button {
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  color: #343534;
  font-size: 20px;
  line-height: 30px;
  z-index: 2;
}
.home-map-div .maplibregl-popup-close-button:hover {
  opacity: 0.8;
}
.poi-popup {
  width: 220px;
}
.poi-popup .custom-img img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}
.poi-popup .custom-content {
  padding: 14px 18px;
  background: #fff;
  min-width: 180px;
}
.poi-popup .custom-content h4 {
  font-family: 'DMSans-Bold', sans-serif;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #84bf41;
  margin: 0 0 4px;
}
.poi-popup .custom-content h2 {
  font-family: 'DMSans-Black', sans-serif;
  font-size: 18px;
  line-height: 1.2;
  color: #343534;
  margin: 0;
}

/* Serveis: amb menys de 4 cards, alinear-les a l'esquerra (no separar-les
   als extrems). Mantenim el gap però fixem l'origen i evitem space-between. */
.serveis-content ul {
  justify-content: flex-start;
}

/* Imatges de les cards de serveis: alçada uniforme (retall object-fit: cover)
   perquè logos/fotos de mides diferents no descompensin la graella. */
.serveis-content ul li .serveis-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.serveis-content ul li .serveis-img .blur-img {
  height: 100%;
}
.serveis-content ul li .serveis-img .blur-img img {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

/* ---- Blocs de contingut ric (BlockRenderer) a la fitxa de servei ---- */
/* .rest-contpad és flex item de .rest-details (flex): sense min-width:0 el
   contingut del bloc 'gallery' (swiper amb slides no encongibles) infla
   l'amplada mínima automàtica de .rest-contpad molt per sobre del 70% que li
   pertoca, desplaçant tot el bloc fora de pantalla. */
.rest-contpad {
  min-width: 0;
}
.rest-contpad .block-heading {
  width: 100%;
  font-family: 'DMSans-Black', sans-serif;
  font-size: 28px;
  line-height: 1.2;
  color: #343534;
  margin: 10px 0;
}
.rest-contpad .block-richtext {
  width: 100%;
  font-family: 'DMSans-Regular', sans-serif;
  font-size: 20px;
  line-height: 1.4;
  color: #343534;
}
.rest-contpad .block-richtext strong {
  font-family: 'DMSans-Bold', sans-serif;
  color: #84bf41;
}
.rest-contpad .block-richtext a {
  color: #007fa3;
  text-decoration: underline;
}
.rest-contpad .block-richtext ul,
.rest-contpad .block-richtext ol {
  padding-left: 22px;
  margin: 10px 0;
}
.rest-contpad .block-richtext ul {
  list-style: disc;
}
.rest-contpad .block-richtext ol {
  list-style: decimal;
}
.rest-contpad .block-richtext ul li,
.rest-contpad .block-richtext ol li {
  list-style: inherit;
}
.rest-contpad .block-image {
  width: 100%;
  margin: 10px 0;
}
.rest-contpad .block-image.is-full {
  width: 100%;
}
.rest-contpad .block-image figcaption {
  font-size: 14px;
  color: #6b6b6b;
  margin-top: 6px;
}
.rest-contpad .slide-imgpad {
  float: none;
  clear: none;
  width: 100%;
  min-width: 0;
  margin: 10px 0;
}
.rest-contpad .block-map {
  width: 100%;
  margin: 10px 0;
}
.rest-contpad .block-columns {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.rest-contpad .block-columns .block-column {
  flex: 1 1 calc(50% - 10px);
}
.rest-contpad .block-cta {
  display: inline-block;
  font-family: 'DMSans-Bold', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  color: #fff;
  background: #84bf41;
  padding: 12px 22px;
  border: 2px solid #84bf41;
  margin-top: 10px;
}
.rest-contpad .block-cta:hover {
  background: #343534;
  border-color: #343534;
}
.rest-contpad .block-divider {
  width: 100%;
  border: none;
  border-top: 1px solid #d9d9d9;
  margin: 10px 0;
}

/* Imatge destacada/portada a la fitxa de servei/notícia/activitat
   (.slide-imgpad, entre el títol i el mapa): alçada fixa i object-fit
   cover perquè ocupi el 100% d'ample amb un retall uniform. */
.slide-imgpad .swiper-slide {
  aspect-ratio: 21 / 9;
  overflow: hidden;
}
.slide-imgpad .swiper-slide .blur-img {
  height: 100%;
}
.slide-imgpad .swiper-slide img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  display: block;
}

/* Imatge amb LQIP (placeholder base64 difuminat + fade-in). El span no ha
   d'alterar el layout: es comporta com la imatge que envolta. */
.blur-img {
  display: block;
  position: relative;
  overflow: hidden;
  line-height: 0;
}
.blur-img > img {
  display: block;
  width: 100%;
}
/* El placeholder LQIP marca les dimensions; la imatge real s'hi superposa. */
.blur-img-lqip {
  filter: blur(8px);
  transform: scale(1.05);
  transition: opacity 0.4s ease;
}
.blur-img-lqip.is-hidden {
  opacity: 0;
}
.blur-img-real {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.4s ease;
}

/* ---- Webcams: reproducció directa en iframe (sense clic previ) ---- */
/* .webcam-image no té alçada pròpia (la marca la imatge de la maqueta, ratio 1270:846);
   com l'iframe no té mida intrínseca, li fixem el mateix aspect-ratio perquè la fila
   (i .webcam-content, que s'estira per flex) quedin tan alts com a la maqueta. */
.webcam-image iframe {
  float: left;
  width: 100%;
  height: auto;
  aspect-ratio: 1270 / 846;
  border: 0;
  display: block;
}

/* ---- Galeria: lightbox propi (React, sense jQuery/lightcase) ---- */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.gallery-lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gallery-lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}
.gallery-lightbox-content iframe,
.gallery-lightbox-content video {
  width: min(90vw, 960px);
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  background: #000;
}
.gallery-lightbox-caption {
  color: #fff;
  font-family: 'DMSans-Regular', sans-serif;
  font-size: 14px;
  margin-top: 12px;
  text-align: center;
}
.gallery-lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
}
.gallery-lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.gallery-lightbox-arrow:hover {
  background: #84bf41;
  border-color: #84bf41;
}
.gallery-lightbox-prev { left: 12px; }
.gallery-lightbox-next { right: 12px; }
@media (max-width: 600px) {
  .gallery-lightbox-arrow { width: 40px; height: 40px; font-size: 22px; }
}

/* ---- Dots reutilitzables (paginació de carousels propis, p. ex. RouteNearby) ---- */
/* Replica l'aspecte de .slick-dots de slick-theme.css (cercles, actiu verd).
   NO es diu .slick-slider-dots: slick.css (llibreria de tercers, carregada
   abans) ja defineix aquesta classe amb width/height:12px fixos (per als seus
   propis punts), i en heretar-la el nostre contenidor quedava encaixat a
   12px d'ample — amb flex-wrap, cada punt saltava a la seva pròpia línia
   (apilats en vertical) en lloc de quedar en fila. */
.bn-dots {
  display: flex;
  flex-wrap: wrap;
  column-gap: 10px;
}
.bn-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  font-size: 0;
  line-height: 0;
  border: 2px solid #fff;
  border-radius: 10px;
  background: transparent;
  color: transparent;
  cursor: pointer;
}
.bn-dots button.active {
  background: #84bf41;
  border-color: #84bf41;
}

/* El títol de la ruta és un <Link> (no text pla com la maqueta): hereta el
   color blanc del h4 sobre el fons fosc de .rutes-lft. */
.routes-list ul li .routes-cnt h4 a {
  color: #fff;
}
.routes-list ul li .routes-cnt h4 a:hover {
  color: #84bf41;
}

/* ---- Home: marcador numerat de ruta al mapa (color per dificultat) ---- */
.home-route-marker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DMSans-Bold', sans-serif;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ---- Home: marcador d'incidència ---- */
.home-incident-marker {
  width: 52px;
  height: 52px;
  cursor: pointer;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}
.home-incident-marker img {
  width: 100%;
  height: 100%;
}

/* ---- Home: popup d'incidència (.pop-in-cont.test3) ----
   Selectors amb ".home-map-div" al davant per pujar l'especificitat per sobre
   de ".home-map-div .pop-cont .pop-in-cont a" (override.css, pensat pel CTA
   del popup de ruta), que si no s'imposava i deixava el botó "MÉS INFORMACIÓ"
   amb el fons/vora verds de hover però sense el text a sobre. */
.home-map-div .maplibregl-popup-content .pop-in-cont.test3 {
  padding: 12px 14px;
  min-width: 220px;
  max-width: 280px;
}
.home-map-div .maplibregl-popup-content .pop-in-cont.test3 h3 {
  font-size: 13px;
  font-weight: 700;
  color: #f00373;
  margin: 0 0 6px;
  text-transform: uppercase;
  line-height: 1.3;
}
.home-map-div .maplibregl-popup-content .pop-in-cont.test3 p {
  font-size: 12px;
  color: #343534;
  margin: 0 0 8px;
  line-height: 1.5;
}
.home-map-div .maplibregl-popup-content .pop-in-cont.test3 a {
  display: inline-block;
  height: auto;
  padding: 0;
  border: none;
  background: none;
  font-size: 11px;
  font-weight: 700;
  color: #84BF41;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.home-map-div .maplibregl-popup-content .pop-in-cont.test3 a:hover {
  background: none;
  border: none;
  color: #84BF41;
  text-decoration: underline;
}

/* ---- Home: popup de ruta (markup .pop-cont de la maqueta dins MapLibre) ---- */
.maplibregl-popup-content .pop-cont {
  width: 300px;
}
.maplibregl-popup-content .pop-cont .pop-img img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}

/* ---- Home: activitats — amplada de slide fixa a ~1/3 perquè una sola
   activitat no s'estiri al 100% (no fem servir Swiper JS, és grid flex). ---- */
.activitats-slide .swiper-wrapper {
  display: flex;
  flex-wrap: wrap;
  column-gap: 40px;
  row-gap: 24px;
  transform: none !important;
}
.activitats-slide .swiper-slide {
  width: calc(33.333% - 27px);
  max-width: calc(33.333% - 27px);
  flex: 0 0 auto;
}
@media screen and (max-width: 1023px) {
  .activitats-slide .swiper-wrapper { column-gap: 20px; }
  .activitats-slide .swiper-slide {
    width: calc(50% - 10px);
    max-width: calc(50% - 10px);
  }
}
@media screen and (max-width: 639px) {
  .activitats-slide .swiper-slide {
    width: 100%;
    max-width: 100%;
  }
}

/* Avatar de compte al header (sessió iniciada) — substitueix el botó Login. */
.header-account { position: relative; display: inline-block; }
.header-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  cursor: pointer;
  border-radius: 9999px;
  background: #84BF41;
  color: #fff;
  font-family: 'DMSans-Bold';
  font-size: 14px;
  line-height: 1;
  letter-spacing: -0.28px;
  text-transform: uppercase;
  transition: all 0.3s ease;
}
.header-avatar:hover { background: #343534; }
.inner-header .header-avatar { background: #343534; }
.inner-header .header-avatar:hover { background: #84BF41; }
.inner-header .is-sticky .header-avatar { background: #84BF41; }

/* Popover del compte. */
.header-account-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1000;
  min-width: 220px;
  padding: 8px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.header-account-name {
  margin: 0;
  padding: 6px 12px 10px;
  font-family: 'DMSans-Bold';
  font-size: 13px;
  color: #343534;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.header-account-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin-top: 4px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'DMSans-SemiBold', 'DMSans-Bold', sans-serif;
  font-size: 14px;
  color: #343534;
  transition: background 0.2s ease;
}
.header-account-item:hover { background: rgba(132, 191, 65, 0.12); color: #84BF41; }
.header-account-item.is-danger:hover { background: rgba(206, 0, 58, 0.1); color: #CE003A; }

/* ---- Fitxa de ruta: POIs i serveis propers (RouteNearby) ---- */
/* Una sola fila amb carousel paginat de 3 en 3 (sense Swiper JS). */
.route-nearby .activitats-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.route-nearby .nearby-viewport {
  overflow: hidden;
  position: relative;
}
/* Durant l'arrossegament (drag/swipe) es veu un tros de la targeta següent/
   anterior tallat en sec per l'overflow:hidden del viewport. Difuminem els
   vius amb un degradat blanc-transparent (fons blanc de la secció) perquè el
   tall no es noti. Només al costat on hi ha més pàgines (`fade-left`/
   `fade-right`, calculats des del component): a la primera/última pàgina no
   hi ha res a insinuar en aquell costat. */
.route-nearby .nearby-viewport::before,
.route-nearby .nearby-viewport::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.route-nearby .nearby-viewport::before {
  left: 0;
  background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
}
.route-nearby .nearby-viewport::after {
  right: 0;
  background: linear-gradient(to left, #fff, rgba(255, 255, 255, 0));
}
.route-nearby .nearby-viewport.fade-left::before,
.route-nearby .nearby-viewport.fade-right::after {
  opacity: 1;
}
/* Quan és carousel, el viewport és arrossegable (drag/swipe). */
.route-nearby .nearby-viewport.is-draggable {
  cursor: grab;
  touch-action: pan-y; /* permet scroll vertical; l'horitzontal el gestiona el drag */
}
.route-nearby .nearby-viewport.is-draggable:active {
  cursor: grabbing;
}
/* Evita el "fantasma" d'arrossegar imatges/enllaços durant el gest. */
.route-nearby .nearby-viewport.is-draggable img,
.route-nearby .nearby-viewport.is-draggable a {
  user-select: none;
  -webkit-user-drag: none;
}
.route-nearby .nearby-track {
  display: flex;
  transition: transform 0.4s ease;
}
.route-nearby .nearby-page {
  flex: 0 0 100%;
  display: flex;
  column-gap: 20px;
}
/* Targetes força més petites: 4 per pàgina a desktop. */
.route-nearby .nearby-page .swiper-slide {
  width: calc(25% - 15px);
  max-width: calc(25% - 15px);
  flex: 0 0 auto;
  /* Mateixa alçada encara que un títol ocupi 2 línies. */
  display: flex;
}
.route-nearby .nearby-page .swiper-slide > a,
.route-nearby .nearby-page .swiper-slide > .nearby-card-static {
  display: flex;
  flex-direction: column;
  width: 100%;
}
/* Imatge d'alçada fixa: no s'encongeix quan el text creix. */
.route-nearby .activitats-img {
  height: 160px;
}
.route-nearby .activitats-img .blur-img,
.route-nearby .activitats-img .blur-img img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  display: block;
}
.route-nearby .activitats-cont {
  flex: 1 1 auto;
}
/* Targeta petita i compacta: menys padding, sense min-height (massa alçada). */
.route-nearby .activitats-slide .swiper-slide .activitats-cont {
  padding: 18px 18px 20px;
  min-height: 0;
}
.route-nearby .activitats-cont h3 {
  font-size: 17px;
  line-height: 1.25;
  margin-bottom: 0;
}
.route-nearby .activitats-cont h6,
.route-nearby .activitats-cont p.eyebrow {
  font-size: 11px;
  line-height: 16px;
  margin-bottom: 8px;
  padding-left: 22px;
}
/* Fila de distància: lleugera, sense la vora/marges grossos de .details. */
.route-nearby .activitats-cont .details {
  border-top: 0;
  padding-top: 8px;
  margin-top: 8px;
}
.route-nearby .activitats-cont .details p {
  font-size: 13px;
  line-height: 18px;
  color: rgba(52, 53, 52, 0.7);
}
/* Targeta de POI no enllaçada: mateix aspecte, sense cursor de clic. */
.route-nearby .nearby-card-static {
  cursor: inherit;
}

/* Fletxes de navegació (només quan hi ha >3 elements). */
.route-nearby .nearby-arrows {
  display: flex;
  column-gap: 10px;
}
.route-nearby .nearby-arrow {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #84bf41;
  border-radius: 9999px;
  background: transparent;
  color: #84bf41;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}
.route-nearby .nearby-arrow:hover:not(:disabled) {
  background: #84bf41;
  color: #fff;
}
.route-nearby .nearby-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Dots: reusem .bn-dots però sobre fons clar (vora inactiva grisa). */
.route-nearby .nearby-dots {
  justify-content: center;
  margin-top: 24px;
}
.route-nearby .nearby-dots button {
  border-color: #ccc;
}
.route-nearby .nearby-dots button.active {
  background: #84bf41;
  border-color: #84bf41;
}

/* Fletxes interactives del slider de la home (substitueixen els dots de
   l'esquerra; els de la dreta ja els cobreix el .rgt-thumb). */
.top-banner .hero-arrows {
  display: flex;
  column-gap: 10px;
}
.top-banner .hero-arrow {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 9999px;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}
.top-banner .hero-arrow:hover {
  background: #84bf41;
  border-color: #84bf41;
}

@media screen and (max-width: 1023px) {
  .route-nearby .nearby-page { column-gap: 20px; }
  .route-nearby .nearby-page .swiper-slide {
    width: calc(50% - 10px);
    max-width: calc(50% - 10px);
  }
}
@media screen and (max-width: 639px) {
  .route-nearby .nearby-page .swiper-slide {
    width: 100%;
    max-width: 100%;
  }
}

/* ---- Banner de consentiment de cookies (RGPD/LSSI) ---- */
.cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background: #343534;
  color: #fff;
  padding: 20px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}
.cookie-banner,
.cookie-preferences {
  max-width: 1100px;
  margin: 0 auto;
}
.cookie-consent h2 {
  font-family: 'DMSans-Bold', sans-serif;
  font-size: 18px;
  margin: 0 0 8px;
}
.cookie-consent p {
  font-family: 'DMSans-Regular', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.85);
}
.cookie-consent a {
  color: #84bf41;
  text-decoration: underline;
}
.cookie-banner-actions,
.cookie-preferences-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.cookie-btn {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 6px;
  border: 2px solid #fff;
  background: transparent;
  color: #fff;
  font-family: 'DMSans-Bold', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cookie-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.cookie-btn.is-primary {
  background: #84bf41;
  border-color: #84bf41;
  color: #fff;
}
.cookie-btn.is-primary:hover {
  background: #6fa833;
  border-color: #6fa833;
}
.cookie-category {
  margin-bottom: 16px;
}
.cookie-category label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'DMSans-Bold', sans-serif;
  font-size: 15px;
  cursor: pointer;
}
.cookie-category input[type='checkbox'] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}
.cookie-category input[type='checkbox']:disabled {
  cursor: not-allowed;
}
.cookie-category p {
  margin: 4px 0 0 30px;
  font-size: 13px;
}
@media screen and (max-width: 639px) {
  .cookie-consent {
    padding: 16px;
  }
  .cookie-banner-actions,
  .cookie-preferences-actions {
    flex-direction: column;
  }
  .cookie-btn {
    width: 100%;
  }
}

/* ---- Llistat d'incidències (/incidencies): files de text, sense imatge ---- */
.incident-list { float: left; width: 100%; margin-top: 60px; }
.incident-list > ul { width: 100%; float: left; display: flex; flex-wrap: wrap; row-gap: 20px; margin-bottom: 60px; }
.incident-list > ul > li { flex: 0 1 100%; }
.incident-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 24px;
  row-gap: 12px;
  padding: 24px 28px;
  border: 2px solid #e5e5e5;
  transition: border-color 0.2s ease;
}
.incident-row:hover { border-color: #343534; }
.incident-row-main { flex: 1 1 320px; }
.incident-row-main p {
  font-family: 'DMSans-Bold', sans-serif;
  font-size: 22px;
  line-height: 1.4;
  color: #343534;
  margin: 0;
}
.incident-row-meta {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 20px;
  row-gap: 8px;
}
.incident-row-meta span {
  font-family: 'DMSans-Regular', sans-serif;
  font-size: 14px;
  color: rgba(52, 53, 52, 0.7);
  white-space: nowrap;
}
.incident-row-meta label {
  font-family: 'DMSans-Bold', sans-serif;
  color: #343534;
}
.incident-row-status {
  font-family: 'DMSans-Bold', sans-serif !important;
  text-transform: uppercase;
  padding: 5px 14px;
  border: 2px solid;
  border-radius: 9999px;
}

/* Icona flotant fixa per reobrir les preferències de cookies un cop l'usuari
   ja ha respost al banner (patró tipus plugin de WordPress). */
.cookie-fab {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 9998;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9999px;
  background: #84bf41;
  color: #343534;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, background 0.2s ease;
}
.cookie-fab:hover {
  background: #6fa833;
  transform: scale(1.06);
}
@media screen and (max-width: 639px) {
  .cookie-fab {
    left: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
  }
}

/* Fotos de ruta: han d'omplir tot l'espai (retall cover, sense franges buides). */
.enduro-list ul li .enduro-img {
  align-self: stretch;
}
.enduro-list ul li .enduro-img a {
  display: block;
  height: 100%;
}
.enduro-list ul li .enduro-img a img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}
.routes-list ul li .routes-img {
  align-self: stretch;
}
.routes-list ul li .routes-img img {
  height: 100%;
  object-fit: cover;
}
.rutes-details {
  align-items: stretch;
}
.rutes-slide,
.rutes-slide .slide-imgpad,
.rutes-slide .swiper-container,
.rutes-slide .swiper-wrapper {
  height: 100%;
}
.rutes-slide .slide-imgpad .swiper-slide {
  aspect-ratio: auto;
  height: 100%;
}
.rutes-slide .slide-imgpad .swiper-slide img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}
