/* ==========================================================
   BANNER / SLIDER RAW INSTOP - CSS ÚNIC
   Fitxer recomanat: /css/2026-raw-banner-rjs.css

   Inclou:
   - Slider RAW
   - Textos sobre imatge
   - Logos SVG
   - Fletxes
   - Suport vídeo
   ========================================================== */

/* Contenidor */
.rjs-banner,
.raw-banner-conjunt {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  background: #f2f2f2;
}

/* Slide */
.rjs-frame,
.raw-banner-frame {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
  z-index: 1;
}

.rjs-frame.rjs-on,
.raw-banner-frame.rjs-on,
.raw-banner-frame.raw-video-on {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

/* Imatge */
.rjs-img,
.raw-banner-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Vídeo RAW */
.raw-banner-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 1;
}

/* Quan un conjunt només mostra un element o és una seqüència de vídeo, amaguem fletxes */
.raw-banner-single .rjs-prev,
.raw-banner-single .rjs-next,
.raw-banner-video-sequence .rjs-prev,
.raw-banner-video-sequence .rjs-next {
  display: none !important;
}

.raw-banner-video-sequence .raw-banner-frame {
  opacity: 0;
  pointer-events: none;
}

.raw-banner-video-sequence .raw-banner-frame.raw-video-on {
  opacity: 1;
  pointer-events: auto;
}

/* Alternativa si algun banner arriba amb background CSS */
.rjs-frame[style*="--bg"] {
  background: center / cover no-repeat var(--bg);
}

/* Caption centrat sobre la imatge o vídeo */
.rjs-caption,
.rjs-content,
.raw-banner-text {
  pointer-events: none;
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8em;
  max-width: 90%;
  margin-inline: auto;
  padding: 20px 40px;
  text-align: center;
  color: #fff;
  line-height: 1.15;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.5);
  transform: translateZ(0);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* Títol */
.rjs-title,
.raw-banner-title {
  display: block;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: var(--raw-title-size, clamp(26px, 5vw, 56px));
  white-space: pre-line;
}

/* Subtítol */
.rjs-sub,
.raw-banner-subtitle {
  display: block;
  font-weight: 600;
  opacity: 0.95;
  letter-spacing: 0.03em;
  font-size: var(--raw-subtitle-size, clamp(18px, 2.8vw, 28px));
  white-space: pre-line;
  margin-top: 0.6em;
}



/* Posicio configurable del text */
.raw-banner-frame.raw-text-top-left{place-items:start start}.raw-banner-frame.raw-text-top-center{place-items:start center}.raw-banner-frame.raw-text-top-right{place-items:start end}.raw-banner-frame.raw-text-center-left{place-items:center start}.raw-banner-frame.raw-text-center-center{place-items:center center}.raw-banner-frame.raw-text-center-right{place-items:center end}.raw-banner-frame.raw-text-bottom-left{place-items:end start}.raw-banner-frame.raw-text-bottom-center{place-items:end center}.raw-banner-frame.raw-text-bottom-right{place-items:end end}
.raw-banner-frame.raw-text-top-left .raw-banner-text,.raw-banner-frame.raw-text-center-left .raw-banner-text,.raw-banner-frame.raw-text-bottom-left .raw-banner-text{align-items:flex-start;text-align:left;margin:0}.raw-banner-frame.raw-text-top-center .raw-banner-text,.raw-banner-frame.raw-text-center-center .raw-banner-text,.raw-banner-frame.raw-text-bottom-center .raw-banner-text{align-items:center;text-align:center;margin:0}.raw-banner-frame.raw-text-top-right .raw-banner-text,.raw-banner-frame.raw-text-center-right .raw-banner-text,.raw-banner-frame.raw-text-bottom-right .raw-banner-text{align-items:flex-end;text-align:right;margin:0}

/* Pausa/reproduccio per als conjunts de video */
.raw-video-toggle{position:absolute;right:16px;bottom:16px;z-index:12;display:flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:1px solid rgba(255,255,255,.8);border-radius:999px;background:rgba(0,0,0,.48);color:#fff;font:800 18px/1 Arial;cursor:pointer;box-shadow:0 3px 12px rgba(0,0,0,.28)}.raw-video-toggle:hover{background:rgba(0,0,0,.7)}.raw-video-toggle:focus-visible{outline:2px solid #fff;outline-offset:2px}

/* Logo dins del caption, si alguna versió antiga el fa servir */
.rjs-logo {
  display: block;
  margin-top: 10px;
  text-align: left;
}

.rjs-logo img {
  width: 325px;
  height: auto;
  opacity: 0.9;
}

/* Logo flotant del mòdul RAW */
.raw-banner-logo {
  position: absolute;
  right: 42px;
  top: 42px;
  z-index: 6;
  display: block;
  width: 180px;
  max-width: 22vw;
  height: auto;
  opacity: 0.95;
}

/* Controls / fletxes */
.rjs-arrow,
.rjs-prev,
.rjs-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 8;
}

.rjs-prev {
  left: 12px;
}

.rjs-next {
  right: 12px;
}

.rjs-arrow:hover,
.rjs-prev:hover,
.rjs-next:hover {
  background: rgba(0, 0, 0, 0.55);
}

.rjs-arrow:focus-visible,
.rjs-prev:focus-visible,
.rjs-next:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.rjs-banner:hover .rjs-frame {
  transition: opacity 0.7s ease;
}

/* ==========================================================
   POSICIONS OPCIONALS DEL LOGO SVG
   Pots aplicar-les per codi de banner.
   Exemple:
   .raw-banner-disto-x6 .raw-banner-logo { ... }
   ========================================================== */

/* Logo a baix centrat */
.raw-banner-logo-bottom-center .raw-banner-logo {
  top: auto;
  right: auto;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: 320px;
  max-width: 70vw;
}

/* Logo a baix esquerra */
.raw-banner-logo-bottom-left .raw-banner-logo {
  top: auto;
  right: auto;
  left: 40px;
  bottom: 24px;
  transform: none;
  width: 260px;
  max-width: 60vw;
}

/* Logo a baix dreta */
.raw-banner-logo-bottom-right .raw-banner-logo {
  top: auto;
  left: auto;
  right: 40px;
  bottom: 24px;
  transform: none;
  width: 260px;
  max-width: 60vw;
}

/* Responsive */
@media (max-width: 768px) {
  .rjs-banner,
  .raw-banner-conjunt {
    height: 300px;
  }

  .rjs-caption,
  .rjs-content,
  .raw-banner-text {
    max-width: 94%;
    padding: 18px 22px;
  }

  .rjs-logo img {
    width: min(325px, 80vw);
  }

  .rjs-logo {
    text-align: center;
  }

  .raw-banner-logo {
    right: 16px;
    top: 16px;
    width: 90px;
    max-width: 26vw;
  }

  .raw-banner-logo-bottom-center .raw-banner-logo {
    top: auto;
    right: auto;
    left: 50%;
    bottom: 14px;
    width: 220px;
    max-width: 75vw;
  }

  .raw-banner-logo-bottom-left .raw-banner-logo {
    top: auto;
    right: auto;
    left: 16px;
    bottom: 14px;
    width: 170px;
    max-width: 65vw;
  }

  .raw-banner-logo-bottom-right .raw-banner-logo {
    top: auto;
    left: auto;
    right: 16px;
    bottom: 14px;
    width: 170px;
    max-width: 65vw;
  }

  .rjs-arrow,
  .rjs-prev,
  .rjs-next {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .rjs-banner,
  .raw-banner-conjunt {
    height: 260px;
  }

  .rjs-title,
  .raw-banner-title {
    letter-spacing: 0.04em;
  }

  .rjs-sub,
  .raw-banner-subtitle {
    margin-top: 0.35em;
  }
}


/* ==========================================================
   FIX ROBUST V11 - SEQUENCIES DE VIDEO
   Manté compatibilitat amb scripts antics .rjs-frame,
   però en conjunts de vídeo només mana .raw-video-on.
   ========================================================== */

.raw-banner-video-sequence .raw-banner-frame {
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.raw-banner-video-sequence .raw-banner-frame.rjs-on {
  opacity: 0;
  pointer-events: none;
}

.raw-banner-video-sequence .raw-banner-frame.raw-video-on,
.raw-banner-video-sequence .raw-banner-frame.raw-video-on.rjs-on {
  opacity: 1 !important;
  pointer-events: auto;
  z-index: 2;
}

.raw-banner-video-sequence .rjs-prev,
.raw-banner-video-sequence .rjs-next {
  display: none !important;
}

/* ==========================================================
   FIX V13 - CARRO FLOTANT PER SOBRE DEL BANNER
   El problema real era el context d'apilament de #contingut2/#contingut.
   ========================================================== */

/* El banner queda en un nivell baix i controlat */
.banner-ample,
.rjs-banner,
.raw-banner-conjunt {
  position: relative;
  z-index: 1 !important;
}

/* Evitem que aquests contenidors atrapin el carro en un stacking context */
#contingut2,
#contingut {
  z-index: auto !important;
}

/* El contenidor real del carro flotant */
#divCarroPetit {
  position: fixed !important;
  top: 180px !important;
  right: 20px !important;
  z-index: 2147483000 !important;
  overflow: visible !important;
  isolation: auto !important;
}

/* El contingut interior no ha de crear un altre nivell conflictiu */
#divCarroPetit #cart {
  position: relative !important;
  z-index: auto !important;
}

/* Altres elements flotants */
.whatsapp-float,
.scrollup {
  z-index: 2147482000 !important;
}


/* Biblioteca de logotips RAW */
.raw-banner-brand-logo{position:absolute;left:50%;bottom:24px;z-index:7;display:block;width:auto;max-width:72%;max-height:96px;height:auto;transform:translateX(-50%);object-fit:contain;opacity:1;pointer-events:none;filter:drop-shadow(0 2px 8px rgba(0,0,0,.22))}
.raw-banner-has-brand-logo.raw-text-bottom-left .raw-banner-text,.raw-banner-has-brand-logo.raw-text-bottom-center .raw-banner-text,.raw-banner-has-brand-logo.raw-text-bottom-right .raw-banner-text{padding-bottom:130px}
@media(max-width:768px){.raw-banner-brand-logo{bottom:14px;max-width:76%;max-height:68px}.raw-banner-has-brand-logo.raw-text-bottom-left .raw-banner-text,.raw-banner-has-brand-logo.raw-text-bottom-center .raw-banner-text,.raw-banner-has-brand-logo.raw-text-bottom-right .raw-banner-text{padding-bottom:92px}}

/* Controls de so dels vídeos RAW. */
.raw-video-audio{position:absolute;left:16px;bottom:16px;z-index:12;display:flex;align-items:center;gap:7px;padding:4px 10px 4px 4px;border:1px solid rgba(255,255,255,.82);border-radius:999px;background:rgba(0,0,0,.5);box-shadow:0 3px 12px rgba(0,0,0,.3);transition:background .2s ease}.raw-video-audio:hover,.raw-video-audio:focus-within{background:rgba(0,0,0,.72)}.raw-video-sound{display:flex;align-items:center;justify-content:center;width:38px;height:38px;padding:0;border:0;border-radius:999px;background:transparent;color:#fff;font:700 19px/1 Arial;cursor:pointer}.raw-video-sound:focus-visible,.raw-video-volume:focus-visible{outline:2px solid #fff;outline-offset:2px}.raw-video-volume{width:105px;height:22px;margin:0;padding:0;accent-color:#fff;cursor:pointer}
