/* App-wide styling */
html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: rgb(32, 31, 31);
  color: white;
  font-family: 'Alice', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
}


nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  /* perquè quedi per sobre del hero */
  background: transparent;
  /* al principi transparent */
}

h2 {
  font-size: clamp(15px, 4vw, 2.5rem);
  margin-bottom: 1rem;
  text-align: center;
}

p {
  max-width: 70ch;
  /* millora la lectura */
  margin-inline: auto;
  font-size: clamp(13px, 2vw, 1.2rem);
}


.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem var(--page-padding);
  background-color: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  gap: clamp(0.5rem, 2vw, 1.5rem);
}

.nav-list {
  list-style: none;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(0.75rem, 2.5vw, 1.5rem);
  width: 100%;
}

.navbar__logo {
  width: clamp(90px, 16vw, 140px);
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  font-weight: bold;
  background-color: lightskyblue;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
}


.link-nav {
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: lightskyblue;
  font-size: clamp(13px, 2vw, 1.15rem);
  transition: color 0.2s ease;
}

.link-nav:hover,
.link-nav:focus-visible {
  color: white;
}


/*Secció del HERO*/
.Hero {
  height: 100vh;
  /* Fem que ocpupi tota la pantalla */
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* centra vertical */
  align-items: center;
  /* centra horitzontal */
  text-align: center;
}

/* Hero crossfade setup */
.hero-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  /* queda darrere del contingut del hero */
  opacity: 0;
  /* punt de partida per a l'animació */
  will-change: opacity;
  /* ajuda a fer el fade fi (GPU)*/
}

.hero-text h2 {
  color: white;
  font-size: clamp(15px, 3vw, 1.5rem);
  letter-spacing: 0.12em;
  text-decoration: overline
}

.hero-text h1 {
  color: white;
  font-size: clamp(18px, 8vw, 4rem);
  line-height: 1.05
}

.hero-text p {
  color: white;
  font-size: clamp(13px, 3vw, 1.5rem);
  max-width: 40ch;
  text-decoration: underline;
}

/*
 Cicle total: 15s
 - 0%  → 45%   : Imatge A visible
 - 45% → 55%   : Crossfade suau (2s) A -> B
 - 55% → 100%  : Imatge B visible
 La secundària fa el contrari per quedar sincronitzades.
*/
@keyframes heroFadeA {
  0% {
    opacity: 0.5;
  }

  /* igual que 100% per evitar salt */
  5%,
  45% {
    opacity: 1;
  }

  55%,
  95% {
    opacity: 0;
  }

  100% {
    opacity: 0.5;
  }
}

@keyframes heroFadeB {
  0% {
    opacity: 0.5;
  }

  /* igual que 100% per evitar salt */
  5%,
  45% {
    opacity: 0;
  }

  55%,
  95% {
    opacity: 1;
  }

  100% {
    opacity: 0.5;
  }
}

/* Assignem les animacions a cada imatge */
/* Assignació amb lineal i “both” perquè s’apliqui des del primer frame */
.hero-img.primary {
  animation: heroFadeA 15s linear infinite both;
}

.hero-img.secondary {
  animation: heroFadeB 15s linear infinite both;
}

/*ENCAREM L'APARICIÓ DELS TÍTOLS*/
/* Blur-reveal: res → borros → net */
@keyframes blurReveal {
  0% {
    opacity: 0;
    filter: blur(14px);
  }

  20% {
    opacity: 1;
    filter: blur(14px);
  }

  100% {
    opacity: 1;
    filter: blur(0);
  }
}

/* Estat inicial per evitar parpelleig */
.Hero h1,
.Hero h2,
.Hero p {
  opacity: 0;
  filter: blur(14px);
  will-change: opacity, filter;
}

/* Sequència: h1 → h2 → p */
.Hero h1 {
  animation: blurReveal 900ms ease-out forwards;
  animation-delay: 0s;
}

.Hero h2 {
  animation: blurReveal 900ms ease-out forwards;
  animation-delay: 0.25s;
}

.Hero p {
  animation: blurReveal 900ms ease-out forwards;
  animation-delay: 0.6s;
}

/* Respecte a preferències d’usuari */
@media (prefers-reduced-motion: reduce) {

  .Hero h1,
  .Hero h2,
  .Hero p {
    animation: none !important;
    opacity: 1;
    filter: none;
  }

  .hero-img {
    animation: none !important;
    opacity: 1;
  }
}

/*Això és el contenidor principal de la carta de serveis*/
.main-service-container {
  width: min(1100px, 92vw);
  margin: 0 auto;
  transition: 0.3s;
  border-radius: 1em;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  background-color: rgb(37, 37, 37);
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.service-title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Aquí és on desplegem el contingut de manera horitzontal per fer les files */
.card-service-container {
  font-size: clamp(13px, 3vw, 1.5rem);
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  /* margin: 1em; */
}

.service-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  margin: 0 auto;
}

.service-content h3 {
  font-size: clamp(15px, 2.5vw, 1.75rem);
  text-align: center;
  margin-bottom: 1.5rem;
  width: 100%;
}

/* Fem que les imatges tinguin totes les mateixa mida. */
.image-container {
  width: 100%;
  position: relative;
  padding-top: 56.25%;
  /* Relació d'aspecte 3:2 (puedes ajustar-la) */
  overflow: hidden;
  border-radius: 1em;
  margin: 0 auto;
}

.image-container img {
  position: absolute;
  top: 0;
  left: 20px;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Fem que quan passem el ratolí per damunt la imatge s'escali. */
.image-container:hover img {
  transform: scale(1.05);
}

/* Fem les configuracións pel mòbil */
@media (max-width: 600px) {
  .menu-toggle {
    display: block;
  }

  .nav-list {
    display: none;
  }

  /* AFEGIT: MOSTRAR EL MENU QUAN TINGUI LA CLASSE "OPEN" EN MÒBIL */
  .navbar:focus-within .nav-list {
    display: flex;
    /* AFEGIT: MOSTRA EL MENU AL FER TOGGLE */
    flex-direction: column;
    /* AFEGIT: DISPOSICIÓ EN COLUMNA EN MÒBIL */
    gap: 0.5rem;
    /* AFEGIT: ESPAI ENTRE ENLLAÇOS */
    position: absolute;
    /* AFEGIT: POSICIONA EL MENU SOBRE LA NAV */
    top: 60px;
    /* AFEGIT: SEPAREM DEL TOP (AJUSTA SEGONS ALÇADA DE LA NAV) */
    right: 1rem;
    /* AFEGIT: ENCAIXEM A LA DRETA EN MÒBIL */
    background: #111111c9;
    /* AFEGIT: FONS PER LLEGIBILITAT EN MÒBIL */
    padding: 0.75rem 1rem;
    /* AFEGIT: ESPAI INTERIOR */
    border-radius: 8px;
    /* AFEGIT: CANTONS ARRODONITS */
    z-index: 1000;
    /* AFEGIT: PER SOBRE D'ALTRES ELEMENTS */
    max-width: 50vw;
  }

  .main-service-container {
    width: 90vw;
    /* Augmentem una mica l'ample en mòbil */
    margin: 0 auto;
    /* Centrem el contenidor principal */
  }

  .card-service-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    /* Afegim espai entre elements */
    padding: 0.5em;
  }

  .service-content {
    width: 90%;
    /* Reduïm una mica l'ample del contingut */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
  }

  .image-container {
    width: 100%;
    margin: 0 auto;
    /* Centrem les imatges */
  }

  .service-content h3 {
    text-align: center;
    margin-bottom: 1rem;
    width: 100%;
  }
}

/* Secció La nostra història. */
.about-us-principal {
  width: min(1100px, 92vw);
  margin: 4rem auto;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  background-color: rgb(37, 37, 37);
  border-radius: 1em;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.about-us-principal h2 {
  text-align: center;
  font-size: clamp(15px, 4vw, 2.25rem);
  margin-bottom: 2rem;
  text-decoration: underline;
}

.History {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.quatre-d-servint,
.anys-experiencia {
  flex: 1;
  padding: 1.5rem;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 0.5em;
}

.quatre-d-servint h3,
.anys-experiencia h3 {
  font-size: clamp(15px, 2.5vw, 1.5rem);
  margin-bottom: 1rem;
  color: lightskyblue;
}

.quatre-d-servint p,
.anys-experiencia p {
  font-size: clamp(13px, 2vw, 1.1rem);
  margin-bottom: 1rem;
  line-height: 1.6;
}

strong {
  color: lightskyblue;
  font-weight: bold;
}

/* Responsivitat per mòbils */
@media (max-width: 768px) {
  .History {
    flex-direction: column;
  }

  .quatre-d-servint,
  .anys-experiencia {
    width: 100%;
  }
}

/* Botons generals */
.btn,
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.4rem;
  border-radius: 0.75rem;
  background: lightskyblue;
  color: #0b0b0b;
  font-size: clamp(14px, 2.4vw, 1.25rem);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}

.btn:hover,
.btn:focus-visible,
.cta-btn:hover,
.cta-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  background: #99d2ff;
}

.btn:active,
.cta-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

@media (prefers-reduced-motion: reduce) {

  .btn,
  .cta-btn {
    transition: none;
  }
}

/* CTA grup per a About_us */
.cta-group {
  margin-top: 1rem;
}

.cta-desktop {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cta-phone {
  color: lightskyblue;
  font-size: clamp(13px, 2.2vw, 1.25rem);
  letter-spacing: 0.02em;
  opacity: 0.95;
}

.cta-mobile {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  text-align: center;
}

.cta-msg {
  font-size: clamp(13px, 2vw, 1.1rem);
  opacity: 0.9;
}

/* Variant WhatsApp */
.cta-btn.whatsapp {
  background: #25D366;
  color: #0b0b0b;
}

.cta-btn.whatsapp:hover,
.cta-btn.whatsapp:focus-visible {
  background: #1ebe5d;
}

/* Responsivitat per a CTAs */
@media (max-width: 768px) {
  .cta-desktop {
    display: none;
  }

  .cta-mobile {
    display: flex;
  }
}

/* Secció mapa */
.mapa {
  width: min(1100px, 92vw);
  max-width: 1100px;
  margin: 4rem auto;
  padding: clamp(1.25rem, 3vw, 2rem);
  background-color: rgb(37, 37, 37);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
}

.mapa h2 {
  margin-bottom: 0.25rem;
}

.mapa p {
  margin-inline: auto;
  font-size: clamp(13px, 2vw, 1.5rem);
}

/* Wrapper del mapa i placeholder fins al consentiment */
.map-wrapper {
  position: relative;
  width: 100%;
}

.map-placeholder {
  padding: 1rem;
  background: #222;
  border: 1px solid #333;
  border-radius: 12px;
}

.map-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-top: .5rem;
}

.remember-choice {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .95rem;
  opacity: .9;
}

.remember-choice input {
  accent-color: lightskyblue;
}

/* Iframe del mapa (un cop carregat) */
.map-wrapper iframe,
.mapa iframe {
  /* <- per si en algun moment tornes a incrustar directament */
  width: 100%;
  height: clamp(280px, 45vw, 420px);
  border: 0;
  border-radius: 12px;
  display: block;
}

/* Enllaç "Com arribar-hi" */
.mapa a {
  color: lightskyblue;
  text-decoration: underline;
  margin-top: 0.5rem;
  align-self: center;
}

/* Mòbil: ajustos */
@media (max-width: 768px) {
  .mapa {
    max-width: 90vw;
    margin: 2.5rem auto;
    padding: 1rem;
  }

  .map-wrapper iframe,
  .mapa iframe {
    height: 260px;
  }
}