/* Estils generals i corporatius */
body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: #f4f4f4;
  color: #333;
}

/* Capçalera i logo */
header {
  background: #0d47a1;
  color: #fff;
  padding: 2rem;
}
.header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
/* 🔵 Banner corporatiu Verifactu */
.banner-verifactu {
  background: linear-gradient(90deg, #1565c0, #0d47a1);
  color: #fff;
  text-align: center;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  animation: fadeIn 1.2s ease;
}
.banner-content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.banner-btn {
  background: #fff;
  color: #0d47a1;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease;
}
.banner-btn:hover {
  background: #e3f2fd;
  color: #0d47a1;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.logo {
  max-height: 80px;
  height: auto;
  width: auto;
}
.header-text h1 {
  margin: 0;
  font-size: 2.2rem;
}
.header-text p {
  margin-top: .5rem;
  font-size: 1.1rem;
}

/* Navegació */
nav {
  background: #1565c0;
  display: flex;
  justify-content: center;
  padding: 0.5rem;
}
nav a {
  color: #fff;
  margin: 0 1rem;
  text-decoration: none;
  font-weight: 700;
}
nav a:hover {
  text-decoration: underline;
}

/* Seccions i contingut */
main {
  padding: 2rem;
  max-width: 1000px;
  margin: auto;
  background: #fff;
}
section {
  margin-bottom: 2rem;
}

/* Peu de pàgina */
footer {
  background: #0d47a1;
  color: #fff;
  text-align: center;
  padding: 1rem;
}
footer a {
  color: #fff;
  text-decoration: underline;
}

/* Selector d’idioma */
/* --- Selector d'idioma corporatiu --- */
.lang-switch {
  position: absolute;
  top: 10px;     /* una mica més amunt */
  right: 60px;   /* una mica més separat del logo */
  display: flex;
  background: #0d47a1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 100;
}

.lang-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 14px;
  transition: background 0.25s ease;
}

.lang-tab:hover {
  background: #1976d2;
}

.lang-tab.active {
  background: #1565c0;
}

.flag-icon {
  width: 22px;
  height: 15px;
  border-radius: 3px;
  box-shadow: 0 0 2px rgba(0,0,0,0.3);
}


/* Estils del formulari de contacte */
.formulari-contacte {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
  margin: auto;
}
.formulari-contacte label {
  font-weight: bold;
}
.formulari-contacte input,
.formulari-contacte textarea {
  padding: .6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  width: 100%;
}
.formulari-contacte button {
  border: 0;
  border-radius: 8px;
  padding: .75rem;
  background: #1565c0;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
.formulari-contacte button:hover {
  background: #0d47a1;
}

/* Missatges del formulari */
.error-box, .success-box {
  max-width: 600px;
  margin: 1rem auto;
  padding: 1rem;
  border-radius: 8px;
}
.error-box {
  background: #ffebee;
  border: 1px solid #c62828;
  color: #c62828;
}
.success-box {
  background: #e8f5e9;
  border: 1px solid #2e7d32;
  color: #2e7d32;
}

/* Notícies */
.noticia-flex {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}
.noticia-text {
  flex: 2;
}
.noticia-img {
  flex: 1;
}
.noticia-img img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,0,0,0.15);
}

/* Banner de cookies */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #f4f4f4;
  color: #333;
  border-top: 1px solid #e0e0e0;
}
.cookie-inner {
  max-width: 1000px;
  margin: auto;
  padding: .9rem 1rem;
  display: flex;
  gap: .8rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.cookie-text {
  flex: 1 1 520px;
  font-size: .95rem;
  line-height: 1.4;
}
.cookie-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.cookie-btn {
  border: 0;
  border-radius: 8px;
  padding: .5rem .9rem;
  background: #1565c0;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
.cookie-btn:hover {
  background: #0d47a1;
}
.cookie-link {
  color: #1565c0;
  text-decoration: underline;
  font-weight: 600;
}
.cookie-link:hover {
  text-decoration: none;
}
/* Punt vermell per a noves notícies */
.dot {
  height: 10px;
  width: 10px;
  background-color: red;
  border-radius: 50%;
  display: none;
  animation: blink 1s infinite;
  vertical-align: middle;
  margin-left: 5px;
}
@keyframes blink {
  50% { opacity: 0; }
}



/* Responsive */
@media (max-width: 768px) {
  .header-flex {
    flex-direction: column;
    align-items: flex-start;
  }
  nav {
    flex-direction: column;
    align-items: center;
  }
  nav a {
    margin: .4rem 0;
  }
  main {
    padding: 1rem;
  }
  .lang-switch {
    text-align: center;
    padding: .5rem;
  }
  .cookie-inner {
    padding: 1rem;
  }
  .noticia-flex {
    flex-direction: column;
  }
}

/* Botons generals corporatius */
.btn {
  border: 0;
  border-radius: 8px;
  padding: .75rem 1.5rem;
  background: #1565c0;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  transition: background .2s ease;
}

.btn:hover {
  background: #0d47a1;
}

.btn-blau {
  background: #1565c0;
}

.btn-blau:hover {
  background: #0d47a1;
}
/* --- Equipament professional --- */

.grid-productes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  padding: 20px 0 60px 0;
}

.producte {
  border: 1px solid #ddd;
  border-radius: 10px;
  text-align: center;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
}

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

.producte img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  border-bottom: 1px solid #eee;
  background-color: #fafafa;
}

.producte h2 {
  font-size: 1.1rem;
  color: #0047BA;
  margin: 10px 0;
}

.producte p {
  font-size: 0.95rem;
  margin: 0 10px 10px 10px;
}

.producte .preu {
  font-weight: bold;
  color: #0047BA;
  font-size: 1rem;
  margin-bottom: 15px;
}
/* --- Uniformitat d'alçada a les fitxes de producte --- */
.grid-productes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.producte {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 430px; /* pots ajustar-ho si vols */
  padding-bottom: 15px;
}

.producte a.btn {
  margin-top: auto;
  align-self: center;
}
/* --- Correccions formulari de contacte --- */
.formulari-contacte {
  max-width: 600px;
  margin: 40px auto;
}

.formulari-contacte button {
  width: 100%;
  margin-top: 15px;
  font-size: 1rem;
  padding: 0.9rem;
  border-radius: 8px;
  background: #1565c0;
  color: #fff;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.formulari-contacte button:hover {
  background: #0d47a1;
}

/* --- Ajust del footer per pantalla completa --- */
footer {
  width: 100%;
  margin: 0;
  padding: 1rem;
  background: #0d47a1;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
}