.elementor-widget-rotating_cube {
    display: block;
    width: 100%;
}

.rotating-cube-gallery {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

/* Outer container: respect column width & layout */
.rotating-cube-item {
  position: relative;
  width: calc(100vw - 20%);
  height: 200px;
  border-radius: 16px;
  background-color: #FFFCFA;
  display: block;
  /* keep faces clipped within bounds */
}

/* New layer that provides perspective — stays inside container */
.rotating-cube-perspective {
  width: 100%;
  height: 100%;
  perspective: 1200px; /* controls depth without overflowing container */
  perspective-origin: center;
}

/* Inner cube handles the rotation */
.rotating-cube-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(0.25, 0.8, 0.25, 1);
  border-radius: 12px;
}

/* Faces */
.cube-face {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  transform-origin: center;
  overflow: hidden;
}

/* Front and back placement */
.cube-front {
  background-color: #FFFCFA;
  color: #000;
  transform: rotateX(0deg) translateZ(100px);
  transition: filter 0.6s ease;
}

.cube-back {
  background-color: #A0917C;
  color: #fff;
  transform: rotateX(-90deg) translateZ(100px);
}

/* Hover: flip upward */
.rotating-cube-item:hover .rotating-cube-inner {
  transform: rotateX(90deg);
}


.rotating-cube-item:hover .cube-front {
  filter: brightness(0.9);
}