/* ==========================================================
   BANNER ZONE
   ========================================================== */

/* Zona base sense alçada reservada */
.banner-zone {
  position: relative;
  overflow: hidden;
}

/* Reserva 250px només si hi ha contingut */
.banner-zone:has(> *) {
  min-height: 250px;
}

/* clearfix per a floats */
.banner-zone::after {
  content: "";
  display: block;
  clear: both;
}

/* Mòbil: amaga del tot el banner */
@media (max-width: 767px) {
  .banner-zone { display: none; }
}



/* ==========================================================
   FITXA PERSONA
   ========================================================== */
.expert-card {
  display: flex;
  align-items: center;
  gap: 12px;

  background-color: #f0f0f0;
  padding: 15px;
  border-radius: 8px;

  width: 450px; /* ample fix */
  box-sizing: border-box;

  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  will-change: transform, box-shadow;
}

@media (hover: hover) {
  .expert-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 30px rgba(0,0,0,.18), 0 6px 12px rgba(0,0,0,.10);
  }

  .expert-photo,
  .expert-info {
    transition: transform 0.28s ease;
  }

  .expert-card:hover .expert-photo {
    transform: translateX(-2px) scale(1.02);
  }

  .expert-card:hover .expert-info {
    transform: translateX(2px);
  }
}

.expert-photo {
  flex: 0 0 120px;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  max-width: none; /* evita regles globals */
}

.expert-info {
  flex: 1;
  min-width: 0;
}

.expert-contact a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .expert-card { max-width: 100%; }
  .expert-photo {
    flex-basis: 96px;
    width: 96px;
    height: 96px;
  }
}



/* ==========================================================
   FACTORS D’EQUIPS
   ========================================================== */
.factors-flexline {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  max-width: 1050px;
  margin: 20px auto;
}

.factor-flex {
  display: flex;
  flex-direction: column;
  align-items: center;

  width: 130px;
  padding: 12px;

  background-color: #fff;
  border: 1px solid #ddd;

  text-decoration: none;
  color: inherit;

  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.factor-flex:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  transform: translateY(-2px);
}

.factor-flex img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin-bottom: 8px;
}

.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;
  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;
}



/* ==========================================================
   CONTENIDOR HOVER (doble imatge)
   ========================================================== */
.contenedor {
  position: relative;
  width: 100%;
  max-width: 180px;
  max-height: 200px;
  overflow: hidden;

  border-radius: 12px;
  background: #fff;

  display: flex;
  justify-content: center;
  align-items: center;

  transition: box-shadow 0.3s ease;
  aspect-ratio: unset !important;
}

.contenedor:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.contenedor img {
  width: 100%;
  height: auto;
  object-fit: contain;
  position: relative;
  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; }



/* ==========================================================
   PRODUCTES GRID (5 columnes)
   ========================================================== */
.productes-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px 30px;
  justify-content: center;

  max-width: 1050px;
  margin: 0 auto;
  padding: 20px 10px;

  box-sizing: border-box;
}

.producte {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 200px;
}

.producte .titol-Porducte10 {
  font-size: 16px;
  font-weight: bold;
  color: #000;
  margin: 8px 0 4px;
}

.producte .normal {
  font-size: 13px;
  color: #333;
  line-height: 1.4;
}



/* ==========================================================
   INTRO 4 SECTORS
   ========================================================== */
.instop-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: 1050px;
  margin: 0 auto;
}

.instop-grid > * {
  box-sizing: border-box;
  min-width: 0;
  overflow-x: auto;
}

/* Items */
.instop-item,
.instop-item140 {
  display: flex;
  flex-direction: row;
  width: calc(50% - 10px);

  background: #f5f5f5;
  overflow: hidden;

  box-shadow: 0 0 8px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.instop-item { 
  border-radius: 0 16px 16px 0;
  min-height: 150px;
}

.instop-item140 {
  border-radius: 0 16px 16px 0;
  min-height: 140px;
  align-items: stretch;
}

.instop-item:hover,
.instop-item140:hover {
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

.instop-img125 {
  width: 132px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
  background: #f5f5f5;

  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}

.instop-img125 img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.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;
}

.instop-text {
  padding: 16px;
  flex: 1;
  background-color: #fff;
}

.instop-text.dreta {
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}



/* ==========================================================
   TAULES GRISES 2025 (productes-flexline / grup-productes-dos)
   ========================================================== */
.productes-flexline,
.grup-productes-dos {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin: 20px 0;
}

.productes-flexline {
  justify-content: flex-start;
}

.producte-flex {
  display: flex;
  flex-direction: row;
  align-items: center;

  background-color: #eee;
  padding: 12px;

  text-decoration: none;
  color: inherit;

  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.producte-flex:hover {
  background-color: #e0e0e0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.producte-flex img {
  width: 125px;
  height: 125px;
  object-fit: cover;
  object-position: center;
  margin-right: 16px;
  flex-shrink: 0;
}

.producte-flex img.standard { width: 125px; height: 125px; }
.producte-flex img.wide { width: 250px; height: 123px; }

.producte-flex .info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Amples */
.productes-flexline .producte-flex {
  flex: 1 1 30%;
  min-width: 280px;
}

.grup-productes-dos .producte-flex {
  flex: 1 1 44%;
  min-width: 280px;
}



/* ==========================================================
   CONTENIDOR 1050 (anti overflow)
   ========================================================== */
.contenidor-1050 {
  width: 100%;
  max-width: 1050px;
  margin: 0 auto;
  padding: 0 15px;
  background-color: #fff;

  display: flex;
  flex-wrap: wrap;

  box-sizing: border-box;
  overflow-x: hidden;
}

.contenidor-1050 *,
.contenidor-1050 *::before,
.contenidor-1050 *::after {
  box-sizing: border-box;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.contenidor-1050 img,
.contenidor-1050 table,
.contenidor-1050 iframe {
  max-width: 100%;
  height: auto;
  display: block;
}



/* ==========================================================
   CONTINGUT / SITE
   ========================================================== */
.barra-intro {
  height: 27px;
  background-color: #fff;
}

.intro17,
.intro17 * {
  max-width: 100% !important;
  overflow-wrap: break-word;
}

#contingut2,
#contingut {
  padding-bottom: 10px;
  position: relative;
  z-index: 1;
}

#contingut2 {
  width: 100%;
  margin-top: 0;
}

#contingut {
  margin: 0 auto;
  width: 1046px;
  height: auto;
}

#site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}



/* ==========================================================
   GRID ACCESSORIS
   ========================================================== */
.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;
}



/* ==========================================================
   CARRETÓ OFF-CANVAS
   ========================================================== */
@media (max-width: 768px) {
  #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);
  }

  .cart-toggle-icon {
    display: block !important;
    position: fixed;
    top: 80px !important;
    bottom: auto !important;
    right: 10px;
    width: 38px;
    height: 38px;
    background-color: #d60000;
    background-image: url("/ic/carro.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    z-index: 2100;
    border-radius: 50%;
  }

  .close-cart {
    display: block;
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5em;
    text-decoration: none;
    color: #333;
    z-index: 2200;
  }
}

@media (min-width: 769px) {
  .cart-toggle-icon,
  .close-cart {
    display: none !important;
  }

  #cart-panel {
    position: static !important;
    transform: none !important;
    width: auto !important;
    height: auto !important;
    box-shadow: none !important;
  }
}



/* ==========================================================
   RESPONSIVE GLOBAL (agrupat)
   ========================================================== */
@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);
  }
}

@media (max-width: 768px) {
  body,
  html {
    overflow-x: hidden;
  }

  .contenidor-1050 {
    width: 100% !important;
    padding: 10px !important;
  }

  .instop-grid {
    flex-direction: column;
    gap: 16px;
  }

  .instop-item,
  .instop-item140 {
    flex-direction: column;
    width: 100%;
    border-radius: 16px;
  }

  .instop-img {
    width: 100%;
  }

  .instop-text.dreta {
    border-radius: 0 0 16px 16px;
  }

  .instop-img125 {
    height: auto;
    width: 100%;
  }

  .productes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grup-productes-dos,
  .productes-flexline {
    flex-direction: column;
  }

  .grup-productes-dos .producte-flex,
  .productes-flexline .producte-flex {
    flex: 1 1 100%;
    width: 100%;
  }

  .factor-flex { width: 45%; }

  .intro17 {
    width: 100% !important;
    padding: 10px !important;
    box-sizing: border-box;
  }

  .intro17 p,
  .intro17 li,
  .intro17 ul {
    word-break: break-word;
  }

  .subtext,
  .titol_Producte_28_ROIG {
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
  }

  img {
    max-width: 100%;
    height: auto !important;
  }

  .interes {
    display: block;
    max-width: 100%;
    text-align: center;
    margin: 0 auto 10px;
  }
}

@media (max-width: 480px) {
  .productes-grid { grid-template-columns: 1fr; }
  .factor-flex { width: 100%; }
}
