.cube-builder {
  width: 100%;
  padding: 40px 0 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: "Inter", sans-serif;
  color: #222;
}

/* TOP */
.cb-topbar {
  width: 100%;
  max-width: 1300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.cb-logo {
  width: 170px;
  height: 48px;
  background-image: url("/wp-content/uploads/wooow-logo.png"); /* поменяй */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Steps */
.cb-steps {
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: space-between;
  position: relative;
  padding: 20px 0;
}

.cb-step {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #ccc;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.5;
}

.cb-step.active {
  border-color: #4e3e94;
  background: #4e3e94;
  color: #fff;
  opacity: 1;
}

/* Layout */
.cb-main {
  width: 100%;
  max-width: 1300px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr);
  gap: 30px;
}

/* 3D cube */
.cube-wrapper {
  width: 100%;
  height: 380px;
  perspective: 900px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.cube {
  width: 220px;
  height: 220px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-34deg) rotateY(45deg);
  transition: transform 0.5s ease;
}

.face {
  position: absolute;
  width: 220px;
  height: 220px;
  border: 1px solid #ddd;
  background-color: #f8f8f8;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
}

/* грани */
.face.front {
  transform: translateZ(110px);
}
.face.back {
  transform: rotateY(180deg) translateZ(110px);
}
.face.right {
  transform: rotateY(90deg) translateZ(110px);
}
.face.left {
  transform: rotateY(-90deg) translateZ(110px);
}
.face.top {
  transform: rotateX(90deg) translateZ(110px);
}
.face.bottom {
  transform: rotateX(-90deg) translateZ(110px);
}

/* Side panel */
.cb-side {
  padding: 20px;
  border-radius: 20px;
  /* background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); */
}

.cb-step-panel.hidden {
  display: none;
}

/* rotate arrows */
.rotate {
  position: absolute;
  width: 40px;
  height: 40px;
  top: calc(50% - 20px);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  z-index: 3;
}
.rotate-left {
  left: 15%;
  background-image: url("https://bemo.ie/wp-content/uploads/2025/12/left.png");
}
.rotate-right {
  right: 15%;
  background-image: url("https://bemo.ie/wp-content/uploads/2025/12/right.png");
}

/* MODAL */
.cb-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9990;
}

.cb-modal-backdrop.hidden {
  display: none;
}

.cb-modal {
  width: 90%;
  max-width: 400px;
  background: #fff;
  border-radius: 18px;
  padding: 20px 24px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.cb-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cb-modal-close {
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}

/* Tabs */
.cb-modal-tabs {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 14px;
}
.tab-btn.active {
  border-color: #4e3e94;
  background: #4e3e94;
  color: #fff;
}

.tab-panel.hidden {
  display: none;
}

.cb-modal-body {
  margin-top: 15px;
}

/* upload */
.cb-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px dashed #ccc;
  cursor: pointer;
}
.cb-upload-label input {
  display: none;
}

.cb-upload-preview img {
  max-width: 200px;
  margin-top: 10px;
}

/* gallery */
.cb-gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.cb-gallery-filter-btn {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid #ddd;
  cursor: pointer;
}
.cb-gallery-filter-btn.active {
  background: #4e3e94;
  border-color: #4e3e94;
  color: #fff;
}

.cb-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.cb-gallery-item {
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
}
.cb-gallery-item img {
  width: 100%;
  display: block;
}
.cb-gallery-item.selected {
  border-color: #4e3e94;
}

/* apply button */
.cb-apply-btn {
  margin-top: 15px;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: #4e3e94;
  color: #fff;
  cursor: pointer;
}

/* helpers */
.hidden {
  display: none;
}

/* mobile */
@media (max-width: 768px) {
  .cb-main {
    grid-template-columns: 1fr;
  }
  .cube-wrapper {
    height: 320px;
  }
}
.cb-plus {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  font-size: 65px !important;
}
.face-top {
  pointer-events: none !important;
}
