/* Zona base sense alçada reservada */
.banner-zone {
  position: relative;    /* referència per a fills absoluts */
  overflow: hidden;      /* per contenir floats i fills absoluts */
}

/* Si conté qualsevol fill directe (imatge, div, etc.), reserva 250px */
.banner-zone:has(> *) {
  min-height: 250px;     /* espai reservat en escriptori només si hi ha contingut */
}

/* clearfix per a floats */
.banner-zone::after {
  content: "";
  display: block;
  clear: both;
}

/* -- MÒBIL: per a pantalles estretes, amaga del tot el banner -- */
@media (max-width: 767px) {
  .banner-zone {
    display: none;       /* elimina tant contingut com espai */
  }
}





/* ========== FACTORS D’EQUIPS (no interfereix amb .producte-flex) ========== */

/* contenidor horitzontal — copy de .productes-flexline però separat */
.factors-flexline {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;      /* o flex-start si ho prefereixes */
  margin: 20px 0;
  max-width: 1050px;
  margin-left: auto;
  margin-right: auto;
}

/* targeta individual: parteix de producte-flex però amb fons blanc + filet */
.factor-flex {
  display: flex;
  flex-direction: column;       /* imatge a sobre, text sota */
  align-items: center;
  width: 130px;                 /* mateix ample que la taula antiga */
  padding: 12px;
  background-color: #fff;       /* fons blanc */
  border: 1px solid #ddd;       /* filet gris fi */
  text-decoration: none;
  color: inherit;
  transition: box-shadow .3s ease, transform .3s ease;
}

.factor-flex:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.15);  /* ombra suau */
  transform: translateY(-2px);             /* lleu elevació */
}

/* imatge dins factor */
.factor-flex img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin-bottom: 8px;
}

/* text (ja ve amb .normal) — centre per coherència */
.factor-flex .normal {
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
}


/* ========== CASOS ESTUDI ========== */
.factors-grid-casos {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: flex-start; /* ?? abans: center */
  max-width: 1100px;
  margin: 20px auto;
}

.caso-flex {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 250px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.caso-flex:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.caso-flex img {
  width: 250px;
  height: auto;
  border: 1px solid #ccc;
  margin-bottom: 8px;
}

.caso-flex p {
  margin: 0;
  padding: 0 8px;
}

/* ——— Breakpoints ——— */
@media (max-width: 768px) {
  .factor-flex { width: 45%; }
}
@media (max-width: 480px) {
  .factor-flex { width: 100%; }
}

/* Contenidor de la imatge amb efecte hover */
.contenedor {
  position: relative;
  max-width: 180px;
  width: 100%;
  max-height: 200px; /* ? limita alçada total */
  overflow: hidden;
  border-radius: 12px;
  transition: box-shadow 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  aspect-ratio: unset !important; /* ? desactiva proporció si s'està aplicant */
}


.contenedor:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.contenedor img {
  width: 100%;
  height: auto;
  object-fit: contain;
  position: relative; /* ? treiem position absolute */
  transition: opacity 0.3s ease;
  border-radius: 12px;
}

.contenedor img.img-hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

.contenedor:hover img.img-hover {
  opacity: 1;
}

.contenedor:hover img.img-default {
  opacity: 0;
}

/* Disseny responsive del grid de productes */
.productes-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px 30px;
  justify-content: center;
  max-width: 1050px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 20px 10px;
}

.producte {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 200px;
}

.producte .titol-Porducte10 {
  font-size: 16px;
  font-weight: bold;
  color: #000;
  margin-top: 8px;
  margin-bottom: 4px;
}

.producte .normal {
  font-size: 13px;
  color: #333;
  line-height: 1.4;
}


/* INTRO DELS 4 SECTORS PRINCIPALS */

.instop-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* centra els blocs */
  gap: 20px;
  max-width: 1050px;
  margin: 0 auto;
}

/*.instop-grid img,
.instop-grid iframe,
.instop-grid table {
  max-width: 100%;
  height: auto;
  display: block;
}*/

.instop-grid > * {
  box-sizing: border-box;
  min-width: 0;
  overflow-x: auto;
}


/* âœ… Contenidor amb cantonades nomÃ©s a la dreta i efecte hover */
.instop-item {
  display: flex;
  flex-direction: row;
  background: #f5f5f5;
  border-radius: 0 16px 16px 0; /* âœ… NomÃ©s cantonades dretes */
  overflow: hidden;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
  width: calc(50% - 10px);
  min-height: 150px;
  transition: box-shadow 0.3s ease, transform 0.3s ease; /* âœ… animaciÃ³ suau */
}

.instop-item:hover {
  box-shadow: 0 10px 24px rgba(0,0,0,0.2); /* âœ… ombra mÃ©s destacada */
  transform: translateY(-2px); /* âœ… lleu elevaciÃ³ al passar el cursor */
}


.instop-item140 {
  display: flex;
  flex-direction: row;
  background: #f5f5f5;
  border-radius: 0 16px 16px 0;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
  width: calc(50% - 10px);
  min-height: 140px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  align-items: stretch; /* Ara correctament fora del selector duplicat */
}


.instop-item140:hover {
  box-shadow: 0 10px 24px rgba(0,0,0,0.2); /* âœ… ombra mÃ©s destacada */
  transform: translateY(-2px); /* âœ… lleu elevaciÃ³ al passar el cursor */
}

.instop-img125 {
  width: 132px; /* abans 125px */
  height: 125px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f5f5f5; /* asseguraâ€™t que el fons gris sâ€™aplica aquÃ­ */
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
  height: 100%; /* ocupa tota lâ€™alÃ§ada del contenidor pare */
}

.instop-img125 img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* o 'cover' si vols omplir totalment */
  display: block;
  overflow: visible;
}

.instop-item140:hover .instop-img125 {
  background-color: #e0e0e0;
  transition: background-color 0.3s ease;
}

.instop-item140.sense-arrodonit-esquerra .instop-img125 {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.instop-img {
  flex: 0 0 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.instop-img img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0; /* âœ… imatge totalment rectangular */
}

.instop-text {
  padding: 16px;
  flex: 1;
  background-color: #fff;
}

.instop-text.dreta {
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

/* âœ… Responsive per mÃ²bil */
@media (max-width: 768px) {
  .instop-item,
  .instop-item140 { /* ?? afegit per controlar també els 140 */
    flex-direction: column;
    width: 100%;
    border-radius: 16px; /* arrodonit per tot en columnes apilades */
  }

  .productes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .instop-img {
    width: 100%;
  }

  .instop-text.dreta {
    border-radius: 0 0 16px 16px;
  }

  .instop-img125 {
    height: auto;
    width: 100%; /* perquè ocupi tot l’ample del contenidor */
  }
}







/* TAULES GRISES 2025 */


/* Contenidor genèric per a 1 o 2 per fila */
.productes-flexline,
.grup-productes-dos {
  display: flex;
  flex-wrap: wrap;
  gap: 16px; /* pots provar també 16px o 12px si et cal més espai */
  justify-content: space-between;
  margin: 20px 0;
}

/* Bloc de producte reutilitzable */
.producte-flex {
  display: flex;
  flex-direction: row;
  align-items: center;
  background-color: #EEEEEE;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.productes-flexline {
  justify-content: flex-start; /* en lloc de space-between */
}


/* Ample per a 3 per línia o 2 per línia */
.productes-flexline .producte-flex {
  flex: 1 1 calc(30%); /* Lleugerament més petit per evitar desbordament */
  min-width: 280px;
}

.grup-productes-dos .producte-flex {
  flex: 1 1 44%; /* per 2 per línia amb espai entre */
  min-width: 280px;
}

/* Efecte hover */
.producte-flex:hover {
  background-color: #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Imatge */
.producte-flex img {
  width: 125px;
  height: 125px;
  object-fit: contain;
  margin-right: 16px;
  flex-shrink: 0;
}

/* === Variació per imatge quadrada petita === */
.producte-flex img.standard {
  width: 125px;
  height: 125px;
}

/* === Variació per imatge gran rectangular === */
.producte-flex img.wide {
  width: 250px;
  height: 123px;
}


/* Text */
.producte-flex .info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}


/*.contenidor-1050 {
  width: 100%;
  max-width: 1050px;
  margin: 0 auto;
  padding: 0 15px;
  background-color: #fff;
  
  display: flex;
  flex-wrap: wrap;
}*/




.contenidor-1050 {
  width: 100%;
  max-width: 1050px;
  margin: 0 auto;
  padding: 0 15px;
  background-color: #fff;

  display: flex;
  flex-wrap: wrap;

  /* ? Evita que continguts interns facin desbordament horitzontal */
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ? Tots els elements interns respecten el contenidor */
.contenidor-1050 *,
.contenidor-1050 *::before,
.contenidor-1050 *::after {
  box-sizing: border-box;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ? Assegura que imatges, taules i iframes no trenquin el layout */
.contenidor-1050 img,
.contenidor-1050 table,
.contenidor-1050 iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ? Ajust responsiu */
@media (max-width: 768px) {
  body, html {
    overflow-x: hidden; /* doble protecció en mòbil */
  }

  .contenidor-1050 {
    width: 100% !important;
    padding: 10px !important;
  }
}




.barra-intro {
  height: 27px;
  background-color: #fff;
}

  .intro17, .intro17 * {
    max-width: 100% !important;
    overflow-wrap: break-word;
}



/* 2. El contenidor central ha de tenir padding/marge inferior */
#contingut2,
#contingut {
  padding-bottom: 10px;
  position: relative;
  z-index: 1;
}

#contingut2 {
  width: 100%;
  background-color: #FFF;
  margin-top: 0;
}

#contingut {
  margin: 0 auto;
  width: 1046px;
  height: auto;
}

/* 3. Assegura't que el site conté tot correctament */
#site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (max-width: 768px) {
  .instop-grid {
    display: flex;
	flex-direction: column;
	gap: 16px;
  }
	
  .grup-productes-dos,
  .productes-flexline {
    flex-direction: column;
  }

  .grup-productes-dos .producte-flex,
  .productes-flexline .producte-flex {
    flex: 1 1 100%;
    width: 100%;
  }
  

    .instop-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    border-radius: 16px;
    overflow: hidden;;
  }

  .instop-img {
    width: 100%;
    height: auto;
  }
  
    .instop-img img {
    width: 100%;
    height: auto;
    display: block;
  }

  .instop-text {
    padding: 16px;
  }
}

@media (max-width: 1024px) {
  .productes-flexline .producte-flex,
  .grup-productes-dos .producte-flex {
    flex: 1 1 48%;
  }
  
  .productes-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  
/* Evita desbordament lateral en mòbil */
@media (max-width: 768px) {
  body, html {
    overflow-x: hidden;
  }

  .intro17 {
    width: 100% !important;
    padding: 10px !important;
    box-sizing: border-box;
  }

  .intro17 p, .intro17 li, .intro17 ul {
    word-break: break-word; /* evita paraules llargues que desborden */
  }

  .subtext, .titol_Producte_28_ROIG {
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
  }

  img {
    max-width: 100%;
    height: auto !important;
  }

  /* botó vermell del formulari */
  .interes {
    display: block;
    max-width: 100%;
    text-align: center;
    margin: 0 auto 10px auto;
  }
}
  
  
}

@media (max-width: 480px) {
  .productes-grid {
    grid-template-columns: 1fr;
  }
}


.grid-accessoris {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  max-width: 1050px;
  margin: auto;
}

.bloc-accessori {
  width: 230px;
  flex: 1 1 230px;
  text-align: center;
}



/* === MÒBIL: Icona de Carretó Flotant === */


@media screen and (max-width: 768px) {
  /* Panell off-canvas */
  #cart-panel {
    position: fixed;
    top: 0; right: 0;
    width: 80%; max-width: 300px;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 8px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 2000;
  }
  #cart-panel:target {
    transform: translateX(0);
  }

  /* Icona flotant (és el primer element dins #cart-wrapper) */
  .cart-toggle-icon {
    display: block !important;
    position: fixed;
	top: 80px !important;
    bottom: auto !important;
    right: 10px;
    width: 38px;
    height: 38px;
    background-color: #d60000; /* fons de prova */
    background-image: url('/ic/carro.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    z-index: 2100;
    border-radius: 50%;
  }

  /* Botó de tancament dins el panell */
  .close-cart {
    display: block;
    position: absolute;
    top: 10px; right: 10px;
    font-size: 1.5em;
    text-decoration: none;
    color: #333;
    z-index: 2200;
  }
}

/* === DESKTOP: ocultem la icona i restablim el panell === */
@media screen and (min-width: 769px) {
  .cart-toggle-icon,
  .close-cart {
    display: none !important;
  }
  #cart-panel {
    /* restablir l’estil original si cal */
    position: static !important;
    transform: none !important;
    width: auto !important;
    height: auto !important;
    box-shadow: none !important;
  }
}
