/* ==========================================================
   🌐 CONFIGURACIÓ GLOBAL I VARIABLES
   ========================================================== */

:root {
  /* 🎨 Colors base */
  --color-primari: #e16734;
  --color-fons: #000000;
  --color-fons-secundari: #1a1a1a;
  --color-text: #ffffff;
  --color-border: #ffffff22;

  /* 🌤️ Tipografia */
  --font-principal: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* 📏 Breakpoints */
  --breakpoint-tablet: 768px;
  --breakpoint-desktop: 1024px;
}

* {
  font-family: "Barlow", sans-serif;
}

.main-nav a {
  font-family: "Poppins", sans-serif;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ======================= SECCIONS ======================= */
/* 📱 MENÚ HAMBURGUESA */
.menu-toggle {
  display: none;
  order: -1;
  background: none;
  border: none;
  cursor: pointer;
  margin-right: 10px;
}
.menu-toggle .hamburger {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--color-text);
  position: relative;
  transition: background-color 0.3s ease;
}
.menu-toggle .hamburger::before,
.menu-toggle .hamburger::after {
  content: "";
  position: absolute;
  width: 25px;
  height: 3px;
  background-color: var(--color-text);
  transition: transform 0.3s ease;
}
.menu-toggle .hamburger::before {
  top: -10px;
  right: 0;
}
.menu-toggle .hamburger::after {
  top: 10px;
  right: 0;
}
.menu-toggle.open .hamburger {
  background-color: transparent;
}
.menu-toggle.open .hamburger::before {
  transform: rotate(45deg) translate(5px, 5px);
  top: -7px;
}
.menu-toggle.open .hamburger::after {
  transform: rotate(-45deg) translate(5px, -5px);
  top: 7px;
}

/* 🔹 HEADER AMB GLASSMORPHIC */
.main-header {
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  margin: 0 auto;
  padding: 0 3.5%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ✨ COLORS I CONTRAST NAV */
.main-nav a {
  color: var(--color-text);
  font-size: clamp(1rem, 0.8rem + 0.5vw, 1.2rem);
  transition: color 0.3s;
}
.main-nav a:hover {
  color: var(--color-primari);
}
.main-nav a.active {
  font-weight: bold;
  color: var(--color-primari);
}

/* ==========================================================
       🔄 RESET SUAU
       Normalize bàsic per garantir consistència sense excessos
       ========================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-principal);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-fons);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.section-title {
  max-width: 1200px;
  align-items: center;
  margin: 0 auto;
  font-size: clamp(1.6rem, 2vw, 2rem); /* 📏 responsive */
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: left;
  color: var(--color-primari);
}

/* ==========================================================
       🔝 HEADER I NAVEGACIÓ
       Logo, menú, toggle tema, menú mòbil
     ========================================================== */

.main-header {
  display: flex;
  align-items: center;
  background: var(--background);
  color: var(--text-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  margin: 0 auto;
  padding: 0 3.5%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px); /* Difuminat elegant */
  -webkit-backdrop-filter: blur(10px); /* Compatibilitat Safari */
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1900px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ================= Logo ================= */
.logo-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  padding: 10px;
  z-index: 1000;

  flex-shrink: 0; /* Evita que es comprimeixi si falta espai */
  height: auto; /* Deixa que l'alçada depengui del contingut */
  min-height: clamp(60px, 8vw, 140px); /* Opcional: altura mínima flexible */
}

.logo {
  margin: 0;
}

.logo-image {
  height: clamp(40px, 6vw, 90px); /* ⬅️ mida fluida entre mòbil i 4K */
  width: auto;
  display: block;
  transition: transform 0.3s ease;
}

.logo-image:hover {
  transform: scale(1.05);
}

/* ================= Navigation ================= */
.main-nav {
  margin-right: 0;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  color: var(--color-text);
  font-size: clamp(0.9rem, 0.7rem + 0.5vw, 1.2rem);
  transition: color 0.3s;
}

@media (min-width: 860px) {
  section[id] {
    scroll-margin-top: 120px;
  }
}

.main-nav a.active {
  font-weight: bold;
  color: var(--color-primari);
}

.main-nav a:hover {
  color: var(--color-primari);
}

/* ==========================================================
       🍔 BOTÓ MENÚ HAMBURGUESA (Estat per defecte: amagat)
       Es mostra només a pantalles petites via @media query
       ========================================================== */

.menu-toggle {
  display: none;
  order: -1;
  background: none;
  border: none;
  cursor: pointer;
  margin-right: 10px;
}

/* 🍔 ICONA VISUAL DE LA HAMBURGUESA */
.menu-toggle .hamburger {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--color-text);
  position: relative;
  transition: background-color 0.3s ease;
}

.menu-toggle .hamburger::before,
.menu-toggle .hamburger::after {
  content: "";
  position: absolute;
  width: 25px;
  height: 3px;
  background-color: var(--color-text);
  transition: transform 0.3s ease;
}

.menu-toggle .hamburger::before {
  top: -10px;
  right: 0;
}

.menu-toggle .hamburger::after {
  top: 10px;
  right: 0;
}

/* Quan el menú està obert, la hamburguesa es transforma en creu */
.menu-toggle.open .hamburger {
  background-color: transparent;
}

.menu-toggle.open .hamburger::before {
  transform: rotate(45deg) translate(5px, 5px);
  top: -7px;
}

.menu-toggle.open .hamburger::after {
  transform: rotate(-45deg) translate(5px, -5px);
  top: 7px;
}

/* ==========================================================
   📱 MENÚ RESPONSIVE (mòbil)
   Es mostra com a columna desplegable quan .main-nav té la classe .open
   ========================================================== */

@media (max-width: 768px) {
  /* 🖼️ LOGO AMB MIDA PETITA */
  .logo-container {
    display: flex;
    justify-content: center;
    width: 100%;
  }
  .logo {
    margin: 0 auto;
    padding: 0;
  }

  /* 🔘 Mostrar icona del menú hamburguesa */
  .menu-toggle {
    display: block;
  }

  /* 🧊 MENÚ HAMBURGUESA: estructura general */
  .main-nav ul {
    display: none;
    flex-direction: column;
    gap: 1rem;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 1rem;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 999;
  }

  .main-nav.open ul {
    display: flex;
  }

  .main-nav li {
    width: 100%;
  }

  .main-nav a {
    display: block;
    padding: 1rem 0;
    font-size: 1.25rem; /* més gran */
    font-weight: 600;
  }
}

/* ==========================================================  
   🦸 SECCIÓ HERO  
   Adaptació per a JEAL – Estil compacte i fidel al disseny  
   ========================================================== */

.hero {
  max-width: 1900px;
  margin: 0 auto;
  padding: 1.5rem 0rem 1.5rem 1.5rem;
  background-color: var(--color-fons);
  text-align: center;
}

.hero-container {
  max-width: 1440px;
  margin: 0 auto;
}

.hero-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 4.2rem;
  margin: 0;
  padding: 0;
}

.text-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* 🔥 Distribueix contingut: text a dalt, botons a baix */
  height: 100%; /* ocupa tot l’alçada disponible */
  padding-left: 6%;
  padding-top: 6%;
}

.image-card {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 🔧 Manté proporcions i evita deformació */
  max-height: 100%;
  max-height: 100%;
}

/* 🔁 A partir de 2040px, eliminem el padding */
@media (min-width: 2040px) {
  .text-card {
    padding-left: 0;
  }

  .hero {
    padding: 1.5rem 0rem 1.5rem 0rem;
  }
}

.hero-title {
  text-align: left;
  font-weight: 800;
  font-size: clamp(2rem, 1.5rem + 1vw, 2.5rem);
  line-height: 1.2;
  margin: 0;
}

.hero-divider {
  align-self: left;
  width: 100%;
  height: 3px;
  background-color: var(--color-text);
  border: none;
  margin: 0.5rem 0;
}

.hero-subtitle {
  font-weight: 400;
  font-size: clamp(1.6rem, 1.5rem + 0.4vw, 1.9rem);
  line-height: 1.2;
  text-align: left;
  margin: 0 0 0.5rem; /* Espai mínim entre subtítol i text destacat */
}

.hero-highlight {
  font-weight: 600;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.1rem);
  line-height: 1.2;
  text-align: left;
  margin: 0;
}

.hero-paragraph {
  font-weight: 400;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.1rem);
  line-height: 1.4;
  text-align: justify;
  margin: 0;
}

@media (min-width: 1440px) {
  .hero-cards {
    gap: 10rem;
  }
  .hero-title {
    font-size: clamp(2.4rem, 2vw, 3.2rem);
  }

  .hero-subtitle {
    font-size: clamp(1.8rem, 1.5vw, 2.3rem);
  }

  .hero-highlight,
  .hero-paragraph {
    font-size: clamp(1.05rem, 1vw, 1.35rem);
    line-height: 1.6;
    max-width: 70ch; /* ⬅️ opcional per limitar amplada de lectura */
  }

  .cta-button.jeal,
  .cta-phone.jeal {
    font-size: 1.2rem;
    padding: 12px 40px;
  }

  .cta-phone.jeal .cta-icon {
    width: 28px;
    height: 28px;
  }
}

/* BOTO I TELÈFON */
.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-top: 3rem;
  justify-content: center;
}

/* BOTÓ D'ESCRIURE */
.cta-button.jeal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primari);
  color: var(--color-text);
  border-radius: 30px;
  font-weight: bold;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.3s ease;
  width: 190px;
  height: 45px;
  white-space: nowrap;
}

.cta-button.jeal:hover {
  background-color: var(--color-text);
  color: var(--color-primari);
}

.cta-phone.jeal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-primari);
  border-radius: 30px;
  color: var(--color-primari);
  font-weight: bold;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.3s ease;
  width: 190px;
  height: 45px;
  white-space: nowrap;
}

.cta-phone.jeal:hover {
  background-color: var(--color-primari);
  color: var(--color-fons);
}

.cta-phone.jeal .cta-icon {
  width: 25px;
  height: 25px;
  margin-right: 8px;
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.cta-phone.jeal:hover .cta-icon {
  content: url("/images/hero/whatsapp_n.svg");
}

/* Targeta d'imatge */
.image-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

@media (max-width: 1212px) and (min-width: 860px) {
  .image-card {
    overflow: hidden;
  }

  .image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: none;
  }
}

@media (max-width: 860px) {
  .hero-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .image-card {
    order: 2;
    margin-top: 1rem;
  }

  .text-card {
    order: 1;
    padding: 1.5rem 1.8rem 1.5rem 0rem;
  }
}

/* ==========================================================
       🖼️ SECCIÓ PROJECTES
       Galeria de projectes realitzats amb títol i descripció
       ========================================================== */

.projects {
  max-width: 1900px;
  margin: 0 auto;
  padding: 3rem 0 0;
  background-color: var(--color-fons);
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.projects-gallery {
  max-width: 1900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0;
}

/* Cada imatge es comporta com una targeta plana i proporcional */
.project-item {
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.project-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 🔁 MEDIA QUERIES RESPONSIVES */

@media (max-width: 860px) {
  .projects {
    padding: 0;
  }
}

@media (min-width: 768px) {
  .projects-gallery {
    grid-template-columns: repeat(3, 1fr); /* tablets: 3 columnes */
  }
}

@media (min-width: 1024px) {
  .projects-gallery {
    grid-template-columns: repeat(4, 1fr); /* escriptori: 4 columnes fixes */
  }
}

/* ==========================================================
       🛠️ SECCIÓ SERVEIS
       Targetes amb icona, títol i descripció
       ========================================================== */

.services {
  max-width: 1900px;
  margin: 0 auto;
  padding: 4rem 1rem;
  background-color: var(--color-fons);
  color: var(--color-primari);
  text-align: center;
}

.services-container {
  max-width: 1200px;
  margin: 0 auto;
}

.service-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.card {
  padding: 1.5rem;
  border: 2px solid var(--color-primari);
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-icon {
  width: 100px;
  height: 100px;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.card-description {
  font-size: 1rem;
  line-height: 1.5;
}

/* ==========================================================
       👥 SECCIÓ MAP
       Direcció de Google Maps
       ========================================================== */

.map {
  max-width: 1900px;
  margin: 0 auto;
  padding: 0 1rem 4rem;
  background-color: var(--color-fons);
}

.map-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  align-items: center;
  max-width: 1200px;
  margin: 2rem auto 0;
}

.map-box {
  overflow: hidden;
}

.map-iframe {
  width: 100%;
  height: 320px;
  border-radius: 8px;
  border: none;
}

address {
  font-style: normal;
}

.info-box {
  border: 2px solid var(--color-primari);
  border-radius: 8px;
  padding: 3rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: space-between;
  justify-content: center;
  gap: 3rem;
  height: 320px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.info-icon {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  margin-top: 4px;
}

.info-text {
  color: var(--color-text);
  font-size: 1.25rem;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .info-box {
    padding: 2rem; /* menys espai interior */
    gap: 2rem; /* separació més compacta */
    height: auto; /* 🔄 per evitar espai buit fixat */
  }

  .info-icon {
    width: 36px; /* 🔽 icona més petita */
    height: 36px;
    margin-top: 2px;
  }

  .info-text {
    font-size: 1.05rem; /* 🔽 lletra una mica més petita */
    line-height: 1.3;
  }

  .map-iframe {
    height: 250px; /* opcional: ajustar alçada mapa */
  }
}

/* ==========================================================
       👥 SECCIÓ EQUIP
       Perfils amb avatar, nom, rol i descripció
       ========================================================== */

.team {
  max-width: 1900px;
  margin: 0 auto;
  padding: 0 1rem;
  background-color: var(--color-fons);
  text-align: left;
}

.team-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.section-subtitle {
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.25rem); /* 🎯 Responsive */
  line-height: 1.6;
  color: var(--color-text);
  text-align: justify;
}

/* ==========================================================
       ❓ SECCIÓ FAQ (Preguntes Freqüents)
       Amb <details> per accessibilitat i usabilitat millorada
       ========================================================== */

.faq {
  max-width: 1900px;
  margin: 0 auto;
  padding: 4rem 1rem;
  background-color: var(--color-fons);
}

.faq-container-outer {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 2rem;
  background-color: var(--color-fons);
  border: 2px solid var(--color-primari);
  border-radius: 8px;
}

.faq-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

#faq-title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.faq-item {
  background-color: var(--color-fons);
  color: var(--color-primari);
  border-bottom: 1px solid var(--color-fons-secundari);
  padding: 1rem 0;
  transition: background-color 0.3s ease;
}

.faq-item summary {
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  padding-left: 2rem;
  position: relative;
  list-style: none;
  margin-bottom: 0.3rem;
}

.faq-item[open] {
  background-color: var(--color-fons);
}

.faq-item summary::marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.2rem; /* o prova 1.6rem si ho vols més gran */
  line-height: 1;
  transition: transform 0.3s ease;
}

.faq-item[open] summary::after {
  content: "–";
  transform: translateY(-50%) rotate(180deg);
}

.faq-answer {
  font-size: 1rem;
  color: var(--color-text);
  padding-left: 1.5rem;
  line-height: 1.6;
}

/* ==========================================================
     🦶 FOOTER
     Informació de contacte, enllaços ràpids, xarxes socials
     ========================================================== */

.main-footer {
  margin: 0 auto;
  padding: 25px 3.5% 25px;
  background: linear-gradient(
    90deg,
    #000000 0%,
    #1a1a1a 35%,
    /* gris fumat suau */ #4b2c1d 60%,
    /* transició cap al taronja */ #dd784c 100% /* color corporatiu */
  );
  color: var(--color-text);
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 25px;
  max-width: 1200px;
}

.footer-column {
  flex: 1 1 1;
  min-width: 250px;
}

.footer-title {
  margin-bottom: 15px;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 3;
  color: var(--color-text);
  position: relative;
  display: inline-block;
}

.footer-title::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 25px;
  transform: translateX(-50%);
  width: 50px;
  height: 4px;
  background-color: var(--color-text);
}

.footer-mail {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 1rem;
  line-height: 2;
}

.footer-mail img {
  width: 20px;
  height: 20px;
}

.footer-whatsapp {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 1rem;
  line-height: 2;
}

.footer-whatsapp img {
  width: 20px;
  height: 20px;
}

.footer-phone {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 1rem;
  line-height: 2;
}

.footer-phone img {
  width: 20px;
  height: 20px;
}

.footer-encuentranos a {
  cursor: pointer;
}

.footer-encuentranos a {
  font-weight: 400; /* per defecte */
  transition: font-weight 0.2s ease;
}

.footer-encuentranos a:hover {
  font-weight: 700; /* en hover */
}

.footer-column p {
  line-height: 3;
}

.footer-column a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: normal;
  transition: color 0.3s ease, font-weight 0.3s ease;
}

.footer-column a:hover {
  color: var(--color-text);
  font-weight: bold;
}

.footer-bottom {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  border-top: 2px solid var(--color-primari);
}

.footer-credit {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.3s ease;
}

.footer-credit:hover {
  color: var(--color-primari);
  text-decoration: underline;
}

/* Fi del fitxer */
