.cbc-audax-video-mask-section {
  --cbc-section-bg: #ffffff;
  --cbc-text-color: #2d2f2f;
  --cbc-body-color: #333333;

  --cbc-max-width: 1160px;
  --cbc-section-padding-y: clamp(46px, 5vw, 72px);
  --cbc-section-padding-x: clamp(20px, 4vw, 32px);
  --cbc-column-gap: clamp(56px, 6vw, 84px);
  --cbc-content-width: 480px;

  --cbc-shape-width: 520px;
  --cbc-shape-height: 448px;
  --cbc-shape-radius: 14px;
  --cbc-left-width: 54%;

  background: var(--cbc-section-bg);
  color: var(--cbc-text-color);
  width: 100%;
}

.cbc-audax-video-mask-section * {
  box-sizing: border-box;
}

.cbc-audax-video-mask-section .audax-mask-section__inner {
  width: min(100%, var(--cbc-max-width));
  margin: 0 auto;
  padding: var(--cbc-section-padding-y) var(--cbc-section-padding-x);
  display: grid;
  grid-template-columns: var(--cbc-left-width) 1fr;
  align-items: center;
  gap: var(--cbc-column-gap);
}

.cbc-audax-video-mask-section .audax-mask-section__visual {
  position: relative;
  width: var(--cbc-shape-width);
  height: var(--cbc-shape-height);
  max-width: 100%;
  justify-self: start;
  isolation: isolate;
}

.cbc-audax-video-mask-section .audax-mask-section__shape {
  position: absolute;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  pointer-events: none;
  clip-path: none;

  -webkit-mask-image: var(--audax-mask-image);
  mask-image: var(--audax-mask-image);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* Capas internas para animación */
.cbc-audax-video-mask-section .audax-mask-section__fill,
.cbc-audax-video-mask-section .audax-mask-section__video-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Contorno amarillo inicial */
.cbc-audax-video-mask-section .audax-mask-section__fill {
  z-index: 1;
  background: transparent;
}

.cbc-audax-video-mask-section .audax-mask-section__fill::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}

/* Vídeo encima */
.cbc-audax-video-mask-section .audax-mask-section__video-layer {
  z-index: 2;
  overflow: hidden;
}

.cbc-audax-video-mask-section .audax-mask-section__video-layer video,
.cbc-audax-video-mask-section .audax-mask-section__video-layer img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.02);
}

/* Pieza grande izquierda */
.cbc-audax-video-mask-section .audax-mask-section__shape--left {
  left: 0;
  top: 0;
  width: 59%;
  height: 100%;
  --audax-mask-image: url("data:image/svg+xml,%3Csvg width='368' height='540' viewBox='0 0 368 540' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.0488 1H121.439C128.967 1 136.17 4.1605 141.281 9.69336L141.77 10.2363L362.162 262.067V262.068C368.019 268.748 368.019 278.734 362.162 285.414V285.415L297.439 359.409L148.353 529.757C143.217 535.626 135.829 538.993 128.023 538.993H20.6328C9.44232 538.993 3.4584 525.785 10.8438 517.356L10.8447 517.355L223.466 274.418L224.042 273.76L223.466 273.101L4.26074 22.6377H4.25977C-3.12588 14.209 2.85836 1.00024 14.0488 1Z' fill='black'/%3E%3C/svg%3E");
}

.cbc-audax-video-mask-section .audax-mask-section__shape--left .audax-mask-section__fill::before {
  background-image: url("data:image/svg+xml,%3Csvg width='368' height='540' viewBox='0 0 368 540' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.0488 1H121.439C128.967 1 136.17 4.1605 141.281 9.69336L141.77 10.2363L362.162 262.067V262.068C368.019 268.748 368.019 278.734 362.162 285.414V285.415L297.439 359.409L148.353 529.757C143.217 535.626 135.829 538.993 128.023 538.993H20.6328C9.44232 538.993 3.4584 525.785 10.8438 517.356L10.8447 517.355L223.466 274.418L224.042 273.76L223.466 273.101L4.26074 22.6377H4.25977C-3.12588 14.209 2.85836 1.00024 14.0488 1Z' fill='none' stroke='%23f6bd43' stroke-width='8' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Pieza superior derecha */
.cbc-audax-video-mask-section .audax-mask-section__shape--top {
  right: 0;
  top: 0;
  width: 41%;
  height: 42%;
  --audax-mask-image: url("data:image/svg+xml,%3Csvg width='255' height='226' viewBox='0 0 255 226' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M133.795 1.03613H241.947C252.459 1.79376 257.869 14.4764 250.718 22.666L250.717 22.667L75.3516 223.751L1.32715 138.862L113.512 10.2822C118.636 4.40642 126.009 1.03613 133.795 1.03613Z' fill='black'/%3E%3C/svg%3E");
}

.cbc-audax-video-mask-section .audax-mask-section__shape--top .audax-mask-section__fill::before {
  background-image: url("data:image/svg+xml,%3Csvg width='255' height='226' viewBox='0 0 255 226' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M133.795 1.03613H241.947C252.459 1.79376 257.869 14.4764 250.718 22.666L250.717 22.667L75.3516 223.751L1.32715 138.862L113.512 10.2822C118.636 4.40642 126.009 1.03613 133.795 1.03613Z' fill='none' stroke='%23f6bd43' stroke-width='7' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Pieza inferior derecha */
.cbc-audax-video-mask-section .audax-mask-section__shape--bottom {
  right: 0;
  bottom: 0;
  width: 40%;
  height: 41%;
  --audax-mask-image: url("data:image/svg+xml,%3Csvg width='249' height='219' viewBox='0 0 249 219' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M244.094 195.878V195.879C251.474 204.369 245.481 217.647 234.333 217.647H127.197C119.692 217.647 112.507 214.471 107.407 208.907L106.921 208.361L1.32617 86.7461L75.334 1.52441L244.094 195.878Z' fill='black'/%3E%3C/svg%3E");
}

.cbc-audax-video-mask-section .audax-mask-section__shape--bottom .audax-mask-section__fill::before {
  background-image: url("data:image/svg+xml,%3Csvg width='249' height='219' viewBox='0 0 249 219' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M244.094 195.878V195.879C251.474 204.369 245.481 217.647 234.333 217.647H127.197C119.692 217.647 112.507 214.471 107.407 208.907L106.921 208.361L1.32617 86.7461L75.334 1.52441L244.094 195.878Z' fill='none' stroke='%23f6bd43' stroke-width='7' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* SVG override desde Bricks, si se usa */
.cbc-audax-video-mask-section .audax-mask-section__shape.has-custom-mask {
  --audax-mask-image: var(--cbc-custom-mask);
}

.cbc-audax-video-mask-section .audax-mask-section__content {
  max-width: var(--cbc-content-width);
}

.cbc-audax-video-mask-section .audax-mask-section__title {
  margin: 0 0 18px;
  color: var(--cbc-text-color);
  font-size: var(--h1, 54px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.cbc-audax-video-mask-section .audax-mask-section__text {
  margin: 0;
  color: var(--cbc-body-color);
  font-size: 20px;
  line-height: 1.45;
  font-weight: 400;
}

/* Separación del botón dentro de esta sección.
El diseño visual lo hereda de Bricks:
.brxe-button.bricks-button
*/
.cbc-audax-video-mask-section .audax-mask-section__button {
  margin-top: 32px;
}

/* Estado inicial animación */
.cbc-audax-video-mask-section .audax-mask-section__shape,
.cbc-audax-video-mask-section .audax-mask-section__video-layer,
.cbc-audax-video-mask-section .audax-mask-section__content {
  opacity: 0;
}

.cbc-audax-video-mask-section.is-animated .audax-mask-section__shape,
.cbc-audax-video-mask-section.is-animated .audax-mask-section__video-layer,
.cbc-audax-video-mask-section.is-animated .audax-mask-section__content {
  opacity: 1;
}

@media (max-width: 991px) {
  .cbc-audax-video-mask-section .audax-mask-section__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .cbc-audax-video-mask-section .audax-mask-section__visual {
    justify-self: center;
    width: min(100%, var(--cbc-shape-width));
    height: clamp(300px, 78vw, var(--cbc-shape-height));
  }

  .cbc-audax-video-mask-section .audax-mask-section__content {
    max-width: 620px;
    justify-self: center;
  }
}

@media (max-width: 575px) {
  .cbc-audax-video-mask-section {
    --cbc-section-padding-y: 48px;
    --cbc-section-padding-x: 20px;
  }

  .cbc-audax-video-mask-section .audax-mask-section__visual {
    height: clamp(250px, 78vw, 340px);
  }
}

/* Bricks Builder preview
En el editor de Bricks mostramos la sección en estado final,
sin depender de GSAP ni ScrollTrigger.
Detectamos el builder con atributos reales del body:
data-builder-window y data-builder-mode.
*/
body[data-builder-window] .cbc-audax-video-mask-section .audax-mask-section__shape,
body[data-builder-window] .cbc-audax-video-mask-section .audax-mask-section__video-layer,
body[data-builder-window] .cbc-audax-video-mask-section .audax-mask-section__content,
body[data-builder-mode] .cbc-audax-video-mask-section .audax-mask-section__shape,
body[data-builder-mode] .cbc-audax-video-mask-section .audax-mask-section__video-layer,
body[data-builder-mode] .cbc-audax-video-mask-section .audax-mask-section__content {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* En el builder ocultamos el contorno amarillo de animación */
body[data-builder-window] .cbc-audax-video-mask-section .audax-mask-section__fill,
body[data-builder-mode] .cbc-audax-video-mask-section .audax-mask-section__fill {
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Si el JS llegara a crear clones en el builder, los ocultamos */
body[data-builder-window] .cbc-audax-video-mask-section .audax-mask-section__shape--video-clone,
body[data-builder-mode] .cbc-audax-video-mask-section .audax-mask-section__shape--video-clone {
  display: none !important;
}
