/* ========== 1. IMPORTS I FONTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');

/* ========== 2. VARIABLES I RESET ========== */
:root {
  --blue: #334e8a;
  --blue-dark: #1f315c;
  --green: #4f7b63;
  --green-dark: #2c4b3d;
  --light: #f5f7f5;
  --white: #ffffff;
  --text: #1d2430;
  --glass: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--light);
  color: var(--text);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ========== 3. CONTENIDOR GENERAL ========== */
.container {
  width: min(1200px, 92%);
  margin: auto;
}

/* ========== 4. NAVBAR AMB MENÚ HAMBURGUESA ========== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(14px);
  background: rgba(51, 78, 138, 0.95);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 1rem 0;
  position: relative;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.nav-partners {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-partners img {
  height: 46px;
  width: auto;
  max-width: 70px;
  object-fit: contain;
  background: white;
  border-radius: 8px;
  padding: 3px 5px;
}

.logo img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  background: white;
  padding: 4px;
}

.logo-text h1 {
  font-family: 'Bebas Neue', sans-serif;
  color: white;
  letter-spacing: 2px;
  font-size: clamp(1.4rem, 5vw, 2rem);
}

.logo-text span {
  color: #d9e2ff;
  font-size: 0.75rem;
}

/* Botó hamburguesa */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1000;
}

.menu-toggle i {
  font-size: 1.8rem;
  color: white;
  transition: transform 0.3s ease;
}

/* Checkbox ocult */
#menu-checkbox {
  display: none;
}

/* Enllaços de navegació */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  list-style: none;
  transition: all 0.3s ease;
}

.nav-links a {
  color: white;
  padding: 0.5rem 0.7rem;
  border-radius: 12px;
  transition: 0.3s;
  font-size: 0.85rem;
  white-space: nowrap;
}

.nav-links a:hover {
  background: rgba(255,255,255,0.15);
}

.nav-cta {
  background: var(--green);
  font-weight: 700;
}

/* Ajust per a pantalles mitjanes */
@media (max-width: 1150px) and (min-width: 901px) {
  .logo {
    gap: 0.5rem;
  }

  .logo img {
    width: 48px;
    height: 48px;
  }

  .nav-partners {
    gap: 0.25rem;
  }

  .nav-partners img {
    height: 34px;
    max-width: 46px;
    padding: 2px 3px;
  }

  .logo-text h1 {
    font-size: 1.15rem;
    letter-spacing: 1px;
  }

  .logo-text span {
    font-size: 0.6rem;
  }

  .nav-links {
    gap: 0.1rem;
  }

  .nav-links a {
    padding: 0.45rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* ========== ESTILS PER A MÒBIL (menys de 900px) ========== */
@media (max-width: 900px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    margin-top: 1rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,0.2);
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    text-align: center;
    white-space: normal;
    padding: 0.8rem 1rem;
    display: block;
    width: 100%;
  }

  /* Separem millor el botó d'inscripcions */
  .nav-links li:last-child {
    margin-top: 0.3rem;
  }

  .nav-links li:last-child a {
    background: var(--green);
  }

  #menu-checkbox:checked ~ .nav-links {
    display: flex;
  }

  .logo-text h1 {
    font-size: 1.2rem;
  }
  
  .logo-text span {
    font-size: 0.65rem;
  }
  
  .logo img {
    width: 45px;
    height: 45px;
  }

  .nav-brand {
    gap: 0.7rem;
  }

  .nav-partners {
    gap: 0.4rem;
  }

  .nav-partners img {
    height: 36px;
    max-width: 52px;
  }
}

/* Pantalla gran */
@media (min-width: 901px) {
  .nav-links {
    display: flex !important;
  }
}

@media (max-width: 480px) {
  .logo-text h1 {
    font-size: 1rem;
  }
  
  .logo-text span {
    font-size: 0.6rem;
  }
  
  .logo img {
    width: 40px;
    height: 40px;
  }
  
  .menu-toggle i {
    font-size: 1.5rem;
  }
}

/* ========== 5. HERO ========== */
.hero {
  min-height: 92vh;
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(rgba(14,22,35,.65), rgba(14,22,35,.72)),
              url('images/portada.webp') center/cover fixed;
}

.hero-serra {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  z-index: 2;
  pointer-events: none;
  filter: brightness(0.7) saturate(0.6);
}

.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero-particles span {
  position: absolute;
  display: block;
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  animation: floatParticle 8s infinite ease-in-out;
}

@keyframes floatParticle {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.3; }
  50% { transform: translateY(-35px) scale(1.4); opacity: 0.9; }
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(900px, 92%);
  margin: auto;
  text-align: center;
  color: white;
  animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(50px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-sub {
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(8px);
  display: inline-block;
  padding: 0.5rem 1.8rem;
  border-radius: 50px;
  font-weight: 600;
  letter-spacing: 6px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 11vw, 8rem);
  line-height: 0.9;
  letter-spacing: 4px;
}

.hero h1 span {
  background: linear-gradient(135deg, #8fc0a2, #c3e0cf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  max-width: 760px;
  margin: 1.5rem auto;
  line-height: 1.6;
  font-size: clamp(1rem, 4vw, 1.1rem);
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.hero-wave {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  z-index: 3;
  line-height: 0;
}

/* ========== 6. BOTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  font-weight: 700;
  transition: all 0.35s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 8px 25px rgba(79, 123, 99, 0.4);
}

.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(79, 123, 99, 0.6);
}

.btn-secondary {
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  color: white;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-4px);
}

/* ========== 7. SECCIONS I TÍTOLS ========== */
.section {
  padding: 4rem 7%;
}

@media (max-width: 768px) {
  .section {
    padding: 3rem 5%;
  }
}

.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  color: var(--blue-dark);
  margin-bottom: 1rem;
  letter-spacing: 2px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 65%;
  height: 5px;
  background: var(--blue);
  border-radius: 5px;
}

.section-desc {
  color: #5f6672;
  max-width: 720px;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* ========== 8. GRAELLES I TARGETES ========== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card {
  background: rgb(178, 194, 224);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.08);
  transition: all 0.4s ease;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 60px rgba(31, 49, 92, 0.2);
}

.card-image-wrapper {
  position: relative;
  overflow: hidden;
}

.card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.card:hover img {
  transform: scale(1.05);
}

.card-content {
  padding: 1.8rem;
}

.card-content h3 {
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
  color: var(--blue-dark);
}

/* ========== 9. ACCORDIÓ ========== */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.acc-item {
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0,0,0,0.07);
}

.acc-btn {
  width: 100%;
  border: none;
  background: var(--blue);
  color: white;
  padding: 1.2rem;
  text-align: left;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
}

.acc-content {
  background: #b3c2da;
  display: none;
  padding: 1.5rem;
}

.acc-item.active .acc-content {
  display: block;
}

.acc-content img {
  border: 3px solid var(--blue);
  border-radius: 20px;
  max-width: 100%;
  height: auto;
}

/* ========== 10. PAGE HEADER ========== */
.page-header {
  padding: 5rem 0 3rem;
  background: linear-gradient(rgba(18,28,40,0.8), rgba(18,28,40,0.8)), url('images/cooperativa1.webp') center/cover;
  color: white;
  text-align: center;
}

.page-header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 8vw, 5rem);
  letter-spacing: 3px;
}

/* ========== 11. INFO BANNER ========== */
.info-banner {
  background: var(--blue-dark);
  color: white;
  border-radius: 30px;
  padding: 2rem;
  margin-top: 2rem;
  text-align: center;
}

/* ========== 12. PREUS (responsiu - 1 per fila a mòbil) ========== */
.prices-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

/* En mòbil: 1 columna, 5 files */
@media (max-width: 768px) {
  .prices-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
}

.price-card {
  background: var(--light);
  padding: 1rem;
  border-radius: 16px;
  text-align: center;
  transition: transform 0.3s ease;
}

.price-card:hover {
  transform: translateY(-5px);
}

.price-card i {
  font-size: 1.8rem;
  color: var(--blue);
  margin-bottom: 0.5rem;
}

.price-card h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.price-card p {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--green);
}

/* ========== 13. FOOTER ========== */
.footer-logos {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.footer-logos a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 10px;
  padding: 6px 10px;
}

.footer-logos img {
  height: 40px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

.footer-grid a:hover {
  color: #9fc3ad;
  text-decoration: underline;
}

footer {
  background: #101827;
  color: white;
  padding: 3rem 0 2rem;
  margin-top: 3rem;
}

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

.footer-grid h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.footer-grid ul {
  list-style: none;
}

.footer-grid li {
  margin-bottom: 0.6rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 2rem;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
}

/* ========== 14. RESPONSIVE EXTRA ========== */
@media (max-width: 768px) {
  .hero-buttons .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

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

  .card-content {
    padding: 1.2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-logos {
    justify-content: center;
  }

  .info-banner {
    padding: 1.5rem;
  }
  
  .hero-sub {
    letter-spacing: 4px;
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    letter-spacing: 2px;
  }
  
  .hero-sub {
    letter-spacing: 3px;
    font-size: 0.65rem;
    padding: 0.3rem 1rem;
  }
  
  .btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
  }
}

/* ========== 15. GRAELLA DE PATROCINADORS (4 columnes) ========== */
.sponsors-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columnes fixes */
  gap: 1.5rem;
  margin-top: 2rem;
}

/* A mòbil: 2 columnes */
@media (max-width: 900px) {
  .sponsors-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* A mòbil molt petit: 1 columna */
@media (max-width: 480px) {
  .sponsors-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== 16. TARGETA DE PATROCINADOR ========== */
.sponsor-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1; /* targeta quadrada, canvia-ho si vols */
  transition: all 0.35s ease;
  overflow: hidden;
}

/* Efecte hover (s'aprecia tant si és link com si no) */
.sponsor-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px rgba(31, 49, 92, 0.18);
}

/* La imatge del logo s'adapta sola dins la targeta */
.sponsor-card img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* clau: no deforma el logo */
  display: block;
  transition: transform 0.35s ease;
}

.sponsor-card:hover img {
  transform: scale(1.05);
}

/* Si la targeta és un enllaç, que no tingui subratllat ni color */
a.sponsor-card {
  text-decoration: none;
  color: inherit;
}


/* Quan és un link, el cursor és pointer (ja ho és per defecte a <a>) */

/* ========== 17. GALERIA (Botons destacats) ========== */

.galeria-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.galeria-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  /* Fons blau de la marca */
  background: var(--blue);
  border: 2px solid transparent;
  border-radius: 20px;
  /* Ombra més forta per separar-lo del fons clar de la pàgina */
  box-shadow: 0 10px 25px rgba(51, 78, 138, 0.25);
  transition: all 0.35s ease;
  /* Text blanc */
  color: var(--white);
  text-decoration: none;
}

.galeria-btn:hover {
  transform: translateY(-6px);
  background: var(--blue-dark);
  box-shadow: 0 20px 40px rgba(31, 49, 92, 0.35);
}

/* La icona de la càmera */
.galeria-btn > i:first-child {
  font-size: 1.8rem;
  color: var(--white);
  flex-shrink: 0;
  opacity: 0.9;
}

/* El text del botó */
.galeria-btn span {
  flex-grow: 1;
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
}

/* La icona de la fletxa externa */
.galeria-btn .icona-externa {
  font-size: 1rem;
  color: var(--white);
  opacity: 0.6;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.galeria-btn:hover .icona-externa {
  opacity: 1;
  transform: translate(2px, -2px); /* Petit efecte de moviment cap a fora */
}

/* Responsive */
@media (max-width: 768px) {
  .galeria-buttons {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .galeria-btn {
    padding: 1.2rem;
  }
  
  .galeria-btn span {
    font-size: 1rem;
  }
}