/* =========================================
   GARANTIA.ME — Design System & Styles
   Redisseny 2026
   ========================================= */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=Nunito:wght@300;400;500;600;700;800;900&display=swap');

/* --- CSS Custom Properties (Tokens) --- */
:root {
  /* Brand Colors — from logo */
  --color-green:        #3D8B5A;
  --color-green-mid:    #2E7048;
  --color-green-light:  #5EAA78;
  --color-green-xlight: #EBF5EF;
  --color-green-soft:   #CFE6D6; /* More saturated green as requested */
  --color-green-glow:   rgba(61, 139, 90, 0.22);
  --color-blue:         #1655C2;
  --color-blue-mid:     #0C388B;
  --color-blue-light:   #205ECC;
  --color-blue-glow:    rgba(30, 111, 245, 0.18);

  /* Neutrals */
  --color-white:        #FFFFFF;
  --color-off-white:    #F8FAF9;
  --color-bg:           #CFE6D6;
  --color-bg-alt:       #BDDDC7;
  --color-grey-100:     #EEF3F0;
  --color-grey-200:     #D5E3DC;
  --color-grey-400:     #7A9788;
  --color-grey-600:     #4A6358;
  --color-dark:         #0F1F17;
  --color-anthracite:   #1A2E22;

  /* Heading / Body semantics */
  --color-heading:  var(--color-anthracite);
  --color-body:     var(--color-grey-600);

  /* Typography */
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Nunito', sans-serif;

  /* Spacing */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2.5rem;
  --space-xl:  4rem;
  --space-2xl: 6rem;
  --space-3xl: 9rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 48px;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --transition-fast: 0.2s var(--ease-smooth);
  --transition-med:  0.4s var(--ease-smooth);
  --transition-slow: 0.7s var(--ease-smooth);

  /* Shadows */
  --shadow-card:  0 4px 32px rgba(0,0,0,0.07);
  --shadow-green: 0 0 40px rgba(61, 139, 90, 0.25);
  --shadow-hover: 0 16px 60px rgba(0,0,0,0.14);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (hover: none) and (pointer: coarse) {
  body { cursor: auto; }
}

img, video { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

/* --- Neon Cursor Canvas (global overlay) --- */
#neon-cursor-canvas {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  width: 100% !important;
  height: 100% !important;
}

/* =========================================
   NAVIGATION — Floating over hero, glassmorphism
   ========================================= */
header[role="banner"] {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  /* Important: no sticky, be fixed so it overlaps fullscreen hero */
}

.nav {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 3rem;
  background: transparent;
  transition: background 0.5s var(--ease-smooth),
              box-shadow 0.5s var(--ease-smooth),
              backdrop-filter 0.5s var(--ease-smooth),
              padding 0.4s var(--ease-smooth);
}

/* When scrolled past the hero — switch to soft green bg */
.nav.scrolled {
  background: rgba(207, 230, 214, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 30px rgba(61, 139, 90, 0.18);
  padding: 0.4rem 3rem;
}

/* Logo */
.nav__logo {
  height: 110px;
  width: auto;
  object-fit: contain;
  /* White version over the hero video */
  filter: brightness(0) invert(1) drop-shadow(0 2px 12px rgba(0,0,0,0.4));
  transition: transform var(--transition-fast),
              height 0.5s var(--ease-smooth),
              filter 0.5s ease;
}
.nav.scrolled .nav__logo,
.nav.menu-open .nav__logo {
  height: 75px; /* Abans 64px, ara una mica més gran com demanaves */
  filter: none; /* Logo amb colors normals en scroll o menú obert */
}
.nav__logo:hover { transform: scale(1.05); }

/* Nav links */
.nav__links {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  position: relative;
}

.nav__link {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  position: relative;
  padding: 0.55rem 1rem;
  border-radius: 50px;
  transition: color 0.3s ease, background 0.3s ease;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
  z-index: 1;
}

/* After scroll: green text */
.nav.scrolled .nav__link {
  color: var(--color-green-mid);
  text-shadow: none;
}

/* Hover pill effect */
.nav__link:hover {
  color: #fff;
  background: rgba(61, 139, 90, 0.75);
  backdrop-filter: blur(8px);
  text-shadow: none;
}

.nav.scrolled .nav__link:hover {
  color: var(--color-white);
  background: var(--color-green);
  text-shadow: none;
}

/* Audio Button */
@keyframes pulse-audio {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.audio-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  cursor: pointer;
  color: var(--color-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background 0.3s ease;
  margin-left: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  animation: pulse-audio 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

.audio-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.05);
}

.audio-btn.playing {
  animation: none; /* Deixa de parpadejar quan està sonant */
  background: rgba(255, 255, 255, 0.95);
}

.nav.scrolled .audio-btn,
.nav.menu-open .audio-btn {
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-primary);
}

/* Tooltip for Audio Button */
.audio-tooltip {
  position: absolute;
  top: 140%;
  right: -5px;
  width: max-content;
  max-width: 220px;
  background-color: var(--color-anthracite);
  color: #fff;
  font-size: 0.8rem;
  font-family: var(--font-body);
  font-weight: 400;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  pointer-events: none;
  text-align: left;
  line-height: 1.4;
  z-index: 100;
}

.audio-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 20px;
  border-width: 0 6px 6px 6px;
  border-style: solid;
  border-color: transparent transparent var(--color-anthracite) transparent;
}

.audio-btn:hover .audio-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Language Toggle — Oval pill, white bg, green text */
.nav__lang {
  display: flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-green-mid);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50px;
  padding: 0.3rem 0.75rem;
  margin-left: 0.6rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
.nav.scrolled .nav__lang,
.nav.menu-open .nav__lang {
  color: var(--color-green-mid);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(61, 139, 90, 0.15);
}
.lang-link {
  color: var(--color-green-mid);
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}
.lang-link:hover {
  opacity: 1;
  color: var(--color-green);
}
.lang-active {
  color: var(--color-green);
  opacity: 1;
}
.lang-sep {
  margin: 0 0.35rem;
  opacity: 0.3;
  font-weight: 400;
  color: var(--color-green-mid);
}

.speaker-icon {
  width: 22px;
  height: 22px;
}

/* Animations for waves when playing */
.audio-btn.playing .wave-1 {
  animation: pulse-wave 1.5s infinite;
}
.audio-btn.playing .wave-2 {
  animation: pulse-wave 1.5s infinite 0.3s;
}

@keyframes pulse-wave {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

/* Hide waves completely when paused */
.audio-btn:not(.playing) .wave {
  display: none;
}

/* Remove old ::after underline */
.nav__link::after { display: none; }

/* Universal Primary Button */
.nav__cta, .btn-magnetic, .form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-green) 0%, var(--color-blue) 100%);
  padding: 1rem 2rem;
  border-radius: var(--radius-xl);
  border: none;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 1;
  cursor: pointer;
}

.nav__cta {
  padding: 0.6rem 1.4rem;
  font-size: 0.82rem;
  text-transform: uppercase;
}
.form-submit {
  width: 100%;
  margin-top: var(--space-md);
  font-size: 1rem;
  padding: 1.1rem 2rem;
}
.btn-magnetic { width: fit-content; }

.nav__cta:hover, .btn-magnetic:hover, .form-submit:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(61, 139, 90, 0.45), 0 0 18px rgba(61, 139, 90, 0.3);
  background: linear-gradient(135deg, var(--color-green-light) 0%, var(--color-blue-light) 100%);
  color: #fff;
}
.nav__cta:hover svg, .btn-magnetic:hover svg, .form-submit:hover svg {
  transform: translateX(4px);
}
.nav__cta svg, .btn-magnetic svg, .form-submit svg {
  width: 20px; height: 20px;
  transition: transform var(--transition-fast);
}
.nav__cta:active, .btn-magnetic:active, .form-submit:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(61, 139, 90, 0.3);
}

/* Internal sweeping shimmer */
.nav__cta::after, .btn-magnetic::after, .form-submit::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  z-index: -1;
  transition: left 0.7s ease;
}
.nav__cta:hover::after, .btn-magnetic:hover::after, .form-submit:hover::after {
  left: 200%;
}

/* Mobile Actions Wrapper */
.nav__mobile-actions {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.mobile-lang {
  margin-left: 0;
  margin-right: 0;
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 4px;
  background: transparent;
  border: none;
  z-index: 200;
}
.nav__hamburger span {
  display: block;
  width: 28px; height: 3px;
  background: #fff;
  border-radius: 3px;
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
  transform-origin: center;
}
.nav.scrolled .nav__hamburger span,
.nav.menu-open .nav__hamburger span {
  background: var(--color-green-mid);
}
.nav__hamburger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; }
.nav__hamburger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* =========================================
   MOBILE NAV
   ========================================= */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 998;
  background: rgba(240, 247, 242, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-direction: column;
  padding: 6rem 2rem 2rem;
  gap: 0.5rem;
  transform: translateY(-100%);
  transition: transform 0.4s var(--ease-in-out);
  box-shadow: 0 8px 30px rgba(61,139,90,0.15);
}
.mobile-nav.open {
  transform: translateY(0);
  display: flex;
}
.mobile-nav__link {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-green-mid);
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.2s ease, color 0.2s ease;
}
.mobile-nav__link:hover {
  background: var(--color-green);
  color: #fff;
}

/* =========================================
   HERO SECTION — Fullscreen YouTube Video
   ========================================= */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: flex-start; /* Ensure top margin is absolute */
  justify-content: flex-start; /* Content aligned LEFT */
  background: var(--color-anthracite);
}

/* Video background — covers 100% */
.hero__video-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #000;
  will-change: transform;
}

.hero__video-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Dark gradient overlay — stronger on left, fades right */
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to top, rgba(10, 30, 18, 0.7) 0%, rgba(10, 30, 18, 0.25) 55%, rgba(10, 30, 18, 0.1) 100%),
    linear-gradient(to right, rgba(10, 30, 18, 0.6) 0%, rgba(10, 30, 18, 0.4) 40%, rgba(10, 30, 18, 0.05) 70%, transparent 100%);
  pointer-events: none;
}

/* Hero content — left-aligned */
.hero__content {
  position: relative;
  z-index: 2;
  text-align: left;
  padding: 2rem 3rem;
  max-width: 620px;
  width: 55%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  margin-left: max(3rem, 7vw);
  margin-right: auto;
  margin-top: clamp(140px, 22vh, 220px);
}

.hero__antetitle {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-green-light);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  opacity: 0;
  transform: translateY(20px);
}
.hero__antetitle::after {
  content: '';
  display: inline-block;
  width: 36px; height: 1px;
  background: var(--color-green-light);
  border-radius: 2px;
  opacity: 0.8;
  flex-shrink: 0;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: #ffffff;
  opacity: 0;
  transform: translateY(30px);
  text-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.hero__title em {
  font-style: italic;
  color: var(--color-green-light);
  font-weight: 300;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: clamp(0.92rem, 1.5vw, 1.08rem);
  font-weight: 300;
  line-height: 1.5;
  color: rgba(255,255,255,0.78);
  max-width: 52ch;
  opacity: 0;
  transform: translateY(20px);
}

.hero__cta-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  opacity: 0;
  transform: translateY(20px);
}

.hero__microcopy {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.01em;
}

/* Scroll indicator */
.hero__scroll-indicator {
  position: absolute;
  bottom: 4rem;
  right: clamp(120px, 15vw, 250px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.5);
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: scrollBounceRight 2s infinite ease-in-out;
}
.hero__scroll-indicator svg {
  width: 20px; height: 20px;
  opacity: 0.6;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}
@keyframes scrollBounceRight {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* =========================================
   SECTION COMMON STYLES
   ========================================= */
section {
  position: relative;
}

/* Section decorative label */
.section-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-green);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: var(--space-sm);
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 32px; height: 2px;
  background: linear-gradient(to right, var(--color-green), var(--color-green-light));
  border-radius: 2px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-anthracite);
  margin-bottom: var(--space-md);
}

.section-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--color-green);
}

/* =========================================
   TRUST / SKILLS STRIP
   ========================================= */
.trust-strip {
  padding: 5rem 3rem;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-grey-100);
}

.trust-strip__inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.trust-badge {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: var(--color-green-soft);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(61,139,90,0.1);
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.trust-badge:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(61,139,90,0.15);
  background: #fff;
}

.trust-badge__icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--color-green) 0%, var(--color-green-light) 100%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(61,139,90,0.3);
}
.trust-badge__icon svg {
  width: 24px; height: 24px;
  color: #fff;
}

/* =========================================
   INSURANCE CARDS SECTION (SPECTACULAR 3D TILT)
   ========================================= */
.services {
  padding: 5rem 3rem var(--space-3xl);
  background: var(--color-bg);
  overflow: hidden;
}

.services__header {
  max-width: 700px;
  margin: 0 auto 3.5rem;
  text-align: center;
}

/* Cards Grid — 5 per row on desktop */
.insurance-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* Vue card-wrap — perspective container */
.card-wrap {
  margin: 0;
  perspective: 1200px; /* Strong depth */
  transform-style: preserve-3d;
  cursor: pointer;
}

/* The tilting card */
.card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.25; /* Taller to fit more text */
  background-color: var(--color-anthracite);
  overflow: hidden;
  border-radius: 20px;
  box-shadow: rgba(0, 0, 0, 0.4) 0 20px 50px 0, inset rgba(255,255,255,0.05) 0 0 0 1px;
  /* La clau de la inèrcia: transició de 1s al cardStyle */
  transition: 1s cubic-bezier(0.445, 0.05, 0.55, 0.95), box-shadow 0.6s ease;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
}

/* Nou overlay d'enfosquiment progressiu */
.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0); /* Transparent per defecte */
  transition: background 0.6s cubic-bezier(0.445, 0.05, 0.55, 0.95);
  z-index: 1;
  pointer-events: none;
}

.card-wrap:hover .card-overlay {
  background: rgba(0, 20, 10, 0.72); /* Enfosquiment potent per llegir bé el text */
}

.card-wrap:hover .card {
  transition: 0.1s ease-out; /* Instant reaction on hover */
  box-shadow: rgba(61, 139, 90, 0.4) 0 0 50px 5px, rgba(0, 0, 0, 0.6) 0 40px 80px 0;
  z-index: 10;
}

/* Card images with parallax */
.card-bg {
  opacity: 1; 
  filter: brightness(0.9) contrast(1.1); /* Reduïm brillo base per llegir millor el blanc */
  position: absolute;
  top: -20px; left: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  transition: 1s cubic-bezier(0.445, 0.05, 0.55, 0.95);
  pointer-events: none;
}

/* Ajust i zoom per la camper */
.insurance-cards-grid .card-wrap:nth-child(1) .card-bg {
  background-size: 140%; /* Ampliem la foto */
  background-position: center 95%; /* Més avall per retallar cel i veure furgo */
}

/* Enfocament específic per targetes molt clares */
.insurance-cards-grid .card-wrap:nth-child(7) .card-bg, /* Patinets */
.insurance-cards-grid .card-wrap:nth-child(8) .card-bg { /* Salut */
  filter: brightness(0.75) contrast(1.1); /* Més fosques perquè el text ressalti */
}

.card-wrap:hover .card-bg {
  opacity: 0.9; /* Baixem un pèl l'opacitat en hover per ajudar a l'enfosquiment */
  filter: brightness(0.8); /* Enfosquim una mica en hover per llegir bé */
}

/* Information Overlay */
.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 1.5rem; /* Less padding to give text more room */
  z-index: 3;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.card-info h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 1.6vw, 1.4rem); /* Slightly smaller to fit long words like Autocaravanas */
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-shadow: 0 4px 12px rgba(0,0,0,0.6);
  transform: translateZ(50px) translateY(0);
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-wrap:hover .card-info h3 {
  transform: translateZ(50px) translateY(-5px);
}

.card-info p {
  opacity: 0;
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem; /* Slightly smaller */
  line-height: 1.4; /* Slightly tighter */
  color: rgba(255,255,255,0.9);
  transform: translateZ(30px) translateY(20px);
  transition: all 0.5s ease;
  max-width: 100%;
  margin: 0;
  max-height: 0;
  overflow: hidden;
}

.card-wrap:hover .card-info p {
  opacity: 1;
  transform: translateZ(30px) translateY(0);
  max-height: 250px;
  margin-top: 0.8rem;
}

/* Removing old CTA styles */

/* Responsive adjustments */
@media (max-width: 1200px) {
  .insurance-cards-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .insurance-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

  /* Contenidor d'info: títol a la part baixa */
  .card-info {
    padding: 1rem;
    transform: none;
    justify-content: flex-end;
  }

  /* Títol: a la part inferior, amb transició d'opacitat */
  .card-info h3 {
    font-size: 1rem;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  /* Descripció: oculta per defecte, posició absoluta a baix */
  .card-info p {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    top: auto;
    opacity: 0;
    font-size: 0.78rem;
    line-height: 1.55;
    max-width: 100%;
    margin: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  /* ===== HOVER / ACTIU A MÒBIL ===== */
  /* iOS Safari de vegades aplica :hover al tocar, el combinem amb .active per seguretat */
  .card-wrap:hover .card-info h3,
  .card-wrap.active .card-info h3 {
    opacity: 0 !important;
    transform: translateY(-10px) !important;
  }

  .card-wrap:hover .card-info p,
  .card-wrap.active .card-info p {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }

  .card-wrap:hover .card-overlay,
  .card-wrap.active .card-overlay {
    background: rgba(0, 20, 10, 0.75) !important;
  }

  /* Overlay per defecte: gradient per llegir el títol */
  .card-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 40%, transparent 70%) !important;
    transition: background 0.3s ease !important;
  }
}

@media (max-width: 480px) {
  .insurance-cards-grid { grid-template-columns: 1fr; }
}

/* =========================================
   GARANTIES SECTION
   ========================================= */
.garanties {
  padding: var(--space-3xl) 3rem;
  background: var(--color-white);
}

.garanties__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.garanties__header {
  text-align: center;
  margin-bottom: 4rem;
}

.garanties__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.garantia-card {
  background: var(--color-bg);
  padding: 2.2rem 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(61,139,90,0.12);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
.garantia-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 4px;
  background: linear-gradient(to right, var(--color-green), var(--color-blue));
  border-radius: 4px 4px 0 0;
}
.garantia-card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 25px 50px rgba(61,139,90,0.18);
  background: #fff;
}
.garantia-card h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-green-mid);
  margin-bottom: 1rem;
}
.garantia-card p {
  color: var(--color-body);
  line-height: 1.7;
  font-size: 0.95rem;
}

/* =========================================
   ABOUT / STORY SECTION
   ========================================= */
.about {
  padding: var(--space-3xl) 3rem;
  background: var(--color-bg);
}

.about__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.about__visual {
  position: relative;
}

.about__image-main {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
}

/* Timeline */
.about__timeline {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 2rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 60px 2px 1fr;
  gap: 0 1.5rem;
  align-items: start;
}

.timeline-item__year {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-green);
  line-height: 1;
  text-align: right;
}

.timeline-item__line {
  width: 2px;
  height: 100%;
  min-height: 60px;
  background: linear-gradient(to bottom, var(--color-green), rgba(61,139,90,0.1));
  border-radius: 2px;
  justify-self: center;
}

.timeline-item__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-anthracite);
  margin-bottom: 0.4rem;
}

.timeline-item__text {
  font-size: 0.9rem;
  color: var(--color-body);
  line-height: 1.6;
}

.about__quote {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 300;
  color: var(--color-grey-600);
  line-height: 1.7;
  padding: 1.5rem 1.8rem;
  border-left: 3px solid var(--color-green);
  background: var(--color-green-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0 2rem;
}

/* Stat badge */
.stat-badge {
  position: absolute;
  bottom: -1.5rem; right: -1.5rem;
  background: white;
  border-radius: 20px;
  padding: 1.2rem 1.6rem;
  box-shadow: 0 16px 60px rgba(0,0,0,0.14);
  border: 1px solid var(--color-grey-200);
  min-width: 180px;
}

/* =========================================
   CONTACT SECTION
   ========================================= */
.contact {
  background: linear-gradient(135deg, var(--color-anthracite) 0%, #0f2d1a 100%);
  padding: var(--space-3xl) 3rem;
  position: relative;
  overflow: hidden;
}

.contact::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61,139,90,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}

.contact__left { padding-right: 2rem; }

.contact__info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.contact-info-item__icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: rgba(61,139,90,0.2);
  border: 1px solid rgba(61,139,90,0.3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-info-item__icon svg {
  width: 22px; height: 22px;
  color: var(--color-green-light);
}

/* Form */
.contact__form {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group.full-width { grid-column: 1 / -1; }

.form-label {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: white;
  transition: all 0.3s ease;
  outline: none;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.2rem center;
  background-size: 1.2rem;
  cursor: pointer;
}

.form-select option {
  background: #1A2E22;
  color: white;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-green-light);
  box-shadow: 0 0 0 4px rgba(94, 170, 120, 0.15);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: rgba(255,255,255,0.25);
}

.form-textarea {
  min-height: 130px;
  resize: vertical;
}

.form-input-bar { display: none; }

.form-title-wrap {
  color: var(--color-green-light) !important;
}

/* =========================================
   REVEAL ANIMATIONS
   ========================================= */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* =========================================
   FOOTER
   ========================================= */
.footer {
  background: var(--color-dark);
  padding: 2rem 3rem;
  border-top: 1px solid rgba(61,139,90,0.15);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer__left, .footer__right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer__link {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  transition: color 0.2s ease;
}
.footer__link:hover { color: var(--color-green-light); }

.footer__center { text-align: center; }
.footer__copy {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
}

.creator-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.4);
  transition: color 0.3s ease;
  font-family: var(--font-body);
  font-size: 0.8rem;
}
.creator-link:hover { color: var(--color-green-light); }

.heart-pulse {
  width: 16px; height: 16px;
  color: var(--color-green);
  animation: heartbeat 1.5s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}
.creator-logo {
  height: 24px; width: auto;
  object-fit: contain;
  filter: brightness(0) invert(0.4);
}
.creator-link:hover .creator-logo {
  filter: brightness(0.8) sepia(1) saturate(2) hue-rotate(90deg);
}
.creator-text { white-space: nowrap; }

/* =========================================
   MODALS
   ========================================= */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
.modal[aria-hidden="false"] { display: flex; }
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,20,14,0.75);
  backdrop-filter: blur(4px);
}
.modal__container {
  position: relative;
  z-index: 1;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 3rem;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 40px 100px rgba(0,0,0,0.3);
}
.modal__close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  background: var(--color-grey-100);
  border: none;
  border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--color-grey-600);
  transition: background 0.2s ease;
}
.modal__close:hover { background: var(--color-green-xlight); color: var(--color-green); }
.modal__close svg { width: 20px; height: 20px; }
#modal-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-anthracite);
  margin-bottom: 1.5rem;
}
.modal-body-text {
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--color-body);
}

/* =========================================
   SCROLL TO TOP
   ========================================= */
.scroll-top {
  position: fixed;
  bottom: 6rem; right: 2rem;
  width: 46px; height: 46px;
  background: var(--color-green);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 980;
  box-shadow: 0 6px 20px rgba(61,139,90,0.35);
}
.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.scroll-top:hover {
  background: var(--color-green-mid);
  transform: translateY(-4px);
}

/* =========================================
   WHITESPACE PAGE PADDING (compensate fixed header)
   ========================================= */
body > main { padding-top: 0; } /* Hero starts at top since nav is fixed over it */

/* Sections after hero need padding for fixed nav */
#skills { scroll-margin-top: 80px; }
#productes { scroll-margin-top: 80px; }
#garanties { scroll-margin-top: 80px; }
#sobre-mi { scroll-margin-top: 80px; }
#contacte { scroll-margin-top: 80px; }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1200px) {
  .insurance-cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .nav__logo { height: 95px; }
  .nav.scrolled .nav__logo { height: 65px; }

  .audio-tooltip {
    display: none !important;
  }

  .hero__content {
    width: 70%;
    margin-left: max(2rem, 5vw);
    margin-right: auto;
    margin-top: clamp(120px, 20vh, 180px);
  }
  .hero__title {
    font-size: clamp(1.8rem, 4.2vw, 3rem);
    line-height: 0.9;
  }
}

@media (max-width: 900px) {
  .nav { padding: 0.8rem 1.5rem; }
  .nav__links { display: none; }
  .nav__mobile-actions { display: flex; align-items: center; }
  .nav__hamburger { display: flex; }
  .mobile-audio { display: flex; margin-right: 0.5rem; }
  .desktop-audio { display: none; }
  .nav__lang { display: flex; margin-right: 0.5rem; }

  .hero__video-bg video {
    object-position: 25% center;
  }

  .hero__overlay {
    background:
      linear-gradient(to top, rgba(10, 30, 18, 0.85) 0%, rgba(10, 30, 18, 0.4) 55%, rgba(10, 30, 18, 0.2) 100%),
      linear-gradient(to right, rgba(10, 30, 18, 0.4) 0%, rgba(10, 30, 18, 0.4) 100%);
  }

  .hero__content {
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    align-items: center;
    padding: 2rem 1rem;
    margin-top: clamp(100px, 18vh, 140px);
  }
  .hero__scroll-indicator {
    left: 50%;
    right: auto;
    bottom: 2rem;
    transform: translateX(-50%);
    animation: scrollBounce 2s infinite ease-in-out;
  }
  .hero__title { font-size: clamp(1.7rem, 6vw, 2.6rem); line-height: 0.9; }

  .trust-strip__inner { grid-template-columns: 1fr; }
  .trust-strip { padding: 3rem 1.5rem; }

  .insurance-cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .about__inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .contact__inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .contact__left { padding-right: 0; }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
  .footer__left, .footer__right { justify-content: center; }

  /* Animació periòdica del WhatsApp en mòbil */
  .whatsapp-float {
    animation: pulse-green 2s infinite, whatsapp-expand-mobile 10s infinite;
  }
  .whatsapp-float .cita-text {
    animation: text-expand-mobile 10s infinite;
  }
}

@media (max-width: 640px) {
  .hero__content {
    width: 95%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    align-items: center;
    padding: 1rem 0.5rem;
    margin-top: clamp(90px, 15vh, 120px);
  }
  .hero__title { font-size: clamp(1.5rem, 6.5vw, 2rem); line-height: 0.9; }
  .hero__subtitle { font-size: 0.95rem; line-height: 1.5; }

  .services { padding: var(--space-2xl) 1.2rem; }
  .garanties { padding: var(--space-2xl) 1.2rem; }
  .about { padding: var(--space-2xl) 1.2rem; }
  .contact { padding: var(--space-2xl) 1.2rem; }

  .insurance-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  /* Cards mòbil petit */
  .card { aspect-ratio: 1 / 1.45; }

  /* Títol mida reduïda */
  .card-info h3 {
    font-size: 0.95rem;
  }

  /* Descripció mida reduïda */
  .card-info p {
    bottom: 0.8rem;
    left: 0.8rem;
    right: 0.8rem;
    font-size: 0.72rem;
  }

  .card-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.0) 50%, transparent 100%) !important;
  }

  .form-grid { grid-template-columns: 1fr; }
  .contact__form { padding: 1.5rem; }
}

@media (max-width: 400px) {
  .insurance-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================
   WHATSAPP FLOAT
   ========================================= */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #3D8B5A;
  color: #FFF;
  width: 60px;
  height: 60px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 14px;
  overflow: hidden;
  text-decoration: none;
  transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.3s ease;
  box-shadow: 0 8px 30px rgba(61, 139, 90, 0.4);
  z-index: 999;
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(61, 139, 90, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(61, 139, 90, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(61, 139, 90, 0); }
}

.cita-text {
  white-space: nowrap;
  margin-left: 12px;
  font-weight: 600;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  font-family: 'Nunito', sans-serif;
}

@media (hover: hover) {
  .whatsapp-float:hover {
    width: 240px;
    background-color: #2e6b44;
  }

  .whatsapp-float:hover .cita-text {
    opacity: 1;
    transform: translateX(0);
  }
}

.whatsapp-float svg {
  min-width: 32px;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes whatsapp-expand-mobile {
  0%, 10% { width: 60px; }
  15%, 45% { width: 240px; background-color: #2e6b44; }
  50%, 100% { width: 60px; }
}

@keyframes text-expand-mobile {
  0%, 10% { opacity: 0; transform: translateX(20px); }
  15%, 45% { opacity: 1; transform: translateX(0); }
  50%, 100% { opacity: 0; transform: translateX(20px); }
}
