/* Crystal Bracelet DIY - WordPress Plugin Styles */
.crystal-bracelet-diy-wrap * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.crystal-bracelet-diy-wrap {
  background-color: #f7f3ed;
  color: #2a2825;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 0;
  user-select: none;
  width: 100%;
}

.crystal-bracelet-diy-wrap .diy-container {
  display: flex;
  background: #fcfaf4;
  border: 1px solid #e6dfd5;
  border-radius: 16px;
  width: 100%;
  max-width: 1120px;
  height: 740px;
  box-shadow: 0 15px 45px rgba(42, 40, 37, 0.04);
  overflow: hidden;
  position: relative;
}

@media (max-width: 1100px) {
  .crystal-bracelet-diy-wrap .diy-container {
    flex-direction: column;
    height: auto;
    max-height: none;
  }
  .crystal-bracelet-diy-wrap .control-panel {
    width: 100% !important;
  }
  .crystal-bracelet-diy-wrap .canvas-area {
    border-right: none !important;
    border-bottom: 1px solid #e6dfd5;
    min-height: 480px;
  }
}

    /* 左侧画布区 */
    .canvas-area {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      position: relative;
      border-right: 1px solid #e6dfd5;
      background: radial-gradient(circle at center, #ffffff 0%, #faf6f0 100%);
    }

    /* 2D 骨架容器 */
    .bracelet-plate-wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 25px;
      transition: opacity 0.4s ease, transform 0.4s ease;
    }

    .bracelet-plate {
      width: 420px;
      height: 420px;
      background: #ffffff;
      border-radius: 50%;
      position: relative;
      display: flex;
      justify-content: center;
      align-items: center;
      box-shadow: 0 10px 35px rgba(140, 133, 123, 0.08);
      border: 1px solid rgba(230, 223, 213, 0.6);
      cursor: grab;
      transition: background 0.4s ease;
    }

    .bracelet-plate:active {
      cursor: grabbing;
    }

    .bracelet-plate::before {
      content: '';
      position: absolute;
      width: 300px;
      height: 300px;
      border: 2px solid var(--string-color, rgba(214, 203, 189, 0.5));
      border-radius: 50%;
      pointer-events: none;
      z-index: 12;
      transition: border-color 0.4s ease;
    }

    .bead-item {
      position: absolute;
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;
      background-size: cover;
      background-position: center;
      box-shadow: inset -4px -4px 10px rgba(0, 0, 0, 0.35),
        inset 3px 3px 6px rgba(255, 255, 255, 0.6),
        0 6px 12px rgba(42, 40, 37, 0.15);
      z-index: 20;
      transition: left 0.25s cubic-bezier(0.25, 1, 0.5, 1), top 0.25s cubic-bezier(0.25, 1, 0.5, 1), transform 0.1s ease;
      will-change: left, top, transform;
    }

    .bead-item:hover {
      transform: scale(1.06);
      z-index: 25;
    }

    .bead-placeholder {
      position: absolute;
      border-radius: 50%;
      border: 2px dashed rgba(42, 40, 37, 0.5);
      background-size: cover;
      background-position: center;
      pointer-events: none;
      z-index: 18;
      display: none;
      opacity: 0.5;
    }

    .ring-center-text {
      text-align: center;
      pointer-events: none;
      z-index: 10;
    }

    .ring-center-text h3 {
      font-size: 26px;
      font-weight: 400;
      color: #2a2825;
      margin-bottom: 2px;
    }

    .ring-center-text p {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: #8c857b;
    }

    /* 👁️ 3D 模式切换按钮设计 */
    .btn-view-3d {
      background: #2a2825;
      color: #fff;
      border: none;
      padding: 10px 24px;
      border-radius: 30px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 8px;
      box-shadow: 0 4px 12px rgba(42, 40, 37, 0.15);
      transition: all 0.2s ease;
    }

    .btn-view-3d:hover {
      background: #403e3a;
      transform: translateY(-1px);
    }

    /* 🔮 3D 渲染视口容器 */
    .three-viewport-container {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      pointer-events: none;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      transition: opacity 0.4s ease;
      z-index: 50;
    }

    .three-viewport-container.active {
      opacity: 1;
      pointer-events: auto;
    }

    #threeCanvasContainer {
      width: 500px;
      height: 500px;
    }

    .btn-back-2d {
      position: absolute;
      bottom: 45px;
      background: rgba(255, 255, 255, 0.9);
      border: 1px solid #e6dfd5;
      color: #2a2825;
      padding: 10px 24px;
      border-radius: 30px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
      transition: all 0.2s;
    }

    .btn-back-2d:hover {
      background: #fff;
      border-color: #2a2825;
    }

    /* 右侧控制面板 */
    .control-panel {
      width: 460px;
      display: flex;
      flex-direction: column;
      background: #fcfaf4;
      z-index: 5;
      height: 100%;
    }

    .panel-header {
      padding: 25px 30px 15px 30px;
      border-bottom: 1px solid rgba(230, 223, 213, 0.5);
    }

    .panel-header h2 {
      font-size: 22px;
      font-weight: 500;
      margin-bottom: 4px;
      letter-spacing: -0.5px;
    }

    .panel-header .subtitle {
      font-size: 13px;
      color: #8c857b;
    }

    .scroll-filter-area {
      flex: 1;
      overflow-y: auto;
      padding: 20px 30px;
      display: flex;
      flex-direction: column;
      gap: 20px;
    }

    .section-title {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: #8c857b;
      margin-bottom: 8px;
      font-weight: 600;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .reset-link {
      text-transform: none;
      font-size: 11px;
      color: #bfa07a;
      cursor: pointer;
      letter-spacing: 0;
    }

    .size-selector {
      display: flex;
      gap: 8px;
    }

    .size-btn {
      flex: 1;
      background: #fff;
      border: 1px solid #e6dfd5;
      padding: 8px;
      border-radius: 6px;
      font-size: 12px;
      cursor: pointer;
      text-align: center;
      transition: all 0.2s;
    }

    .size-btn.active {
      border-color: #2a2825;
      background-color: #2a2825;
      color: #fff;
      font-weight: 500;
    }

    .plate-color-selector {
      display: flex;
      gap: 10px;
    }

    .plate-color-btn {
      padding: 6px 12px;
      border-radius: 6px;
      border: 1px solid #e6dfd5;
      background: #fff;
      font-size: 11px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s;
    }

    .plate-color-btn .color-indicator {
      width: 10px;
      height: 10px;
      border-radius: 50%;
    }

    .plate-color-btn.active {
      border-color: #2a2825;
      font-weight: 600;
      background: #fdfdfc;
    }

    .main-category-tabs {
      display: flex;
      gap: 8px;
      border-bottom: 1px solid #e6dfd5;
      padding-bottom: 4px;
    }

    .main-tab {
      font-size: 13px;
      color: #8c857b;
      background: none;
      border: none;
      padding: 6px 12px;
      cursor: pointer;
      position: relative;
      font-weight: 500;
    }

    .main-tab.active {
      color: #2a2825;
    }

    .main-tab.active::after {
      content: '';
      position: absolute;
      bottom: -5px;
      left: 0;
      right: 0;
      height: 2px;
      background: #2a2825;
    }

    .sub-category-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
    }

    .sub-tag {
      font-size: 11px;
      background: #fff;
      border: 1px solid #e6dfd5;
      padding: 4px 10px;
      border-radius: 12px;
      cursor: pointer;
      color: #615e58;
      transition: all 0.15s;
    }

    .sub-tag.active {
      background: #f0e6da;
      border-color: #bfa07a;
      color: #2a2825;
    }

    .color-filter-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    .color-dot-opt {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      cursor: pointer;
      position: relative;
      box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
      border: 2px solid transparent;
      transition: all 0.15s;
    }

    .color-dot-opt.active {
      border-color: #2a2825;
      transform: scale(1.15);
    }

    .bead-size-options {
      display: flex;
      gap: 6px;
    }

    .mm-btn {
      background: #fff;
      border: 1px solid #e6dfd5;
      font-size: 11px;
      padding: 4px 10px;
      border-radius: 4px;
      cursor: pointer;
    }

    .mm-btn.active {
      background: #2a2825;
      color: #fff;
      border-color: #2a2825;
    }

    .bead-list {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
    }

    .bead-card {
      background: #fff;
      border: 1px solid #e6dfd5;
      border-radius: 8px;
      padding: 10px;
      cursor: grab;
      display: flex;
      align-items: center;
      gap: 10px;
      height: 58px;
      transition: border-color 0.2s;
    }

    .bead-card:hover {
      border-color: #bfa07a;
    }

    .bead-avatar {
      width: 26px;
      height: 26px;
      border-radius: 50%;
      background-size: cover;
      background-position: center;
      box-shadow: inset -2px -2px 5px rgba(0, 0, 0, 0.25);
      flex-shrink: 0;
    }

    .bead-info .name {
      font-size: 12px;
      font-weight: 500;
    }

    .bead-info .details {
      font-size: 11px;
      color: #8c857b;
      margin-top: 2px;
    }

    .global-drag-proxy {
      position: fixed;
      border-radius: 50%;
      background-size: cover;
      background-position: center;
      box-shadow: inset -4px -4px 10px rgba(0, 0, 0, 0.35), 0 10px 20px rgba(0, 0, 0, 0.15);
      pointer-events: none;
      z-index: 9999;
      display: none;
    }

    .panel-footer {
      border-top: 1px solid #e6dfd5;
      padding: 20px 30px 30px 30px;
      background: #fcfaf4;
      flex-shrink: 0;
    }

    .warning-bar {
      background: #fdf6ec;
      color: #e6a23c;
      padding: 10px 14px;
      border-radius: 6px;
      font-size: 12px;
      margin-bottom: 12px;
      border: 1px solid #faecde;
      line-height: 1.4;
    }

    .summary-row {
      display: flex;
      justify-content: space-between;
      margin-bottom: 6px;
      font-size: 13px;
    }

    .total-price-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 8px;
      margin-bottom: 16px;
    }

    .total-price-row .price {
      font-size: 24px;
      font-weight: 600;
    }

    .btn-clear {
      width: 100%;
      background: transparent;
      border: 1px solid #e6dfd5;
      color: #2a2825;
      padding: 12px;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 500;
      font-size: 14px;
      transition: background 0.2s;
    }

    .btn-clear:hover {
      background: #f5f0e8;
    }

/* Plugin extras */
.bead-card.sold-out {
  opacity: 0.45;
  pointer-events: none;
  position: relative;
}
.bead-card.sold-out::after {
  content: "售罄";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #c0392b;
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.btn-add-to-cart {
  width: 100%;
  background: #2a2825;
  border: none;
  color: #fff;
  padding: 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  margin-top: 10px;
  transition: background 0.2s;
}
.btn-add-to-cart:hover {
  background: #403e3a;
}
.btn-add-to-cart:disabled {
  background: #b0a99f;
  cursor: not-allowed;
}
.stock-badge {
  font-size: 10px;
  color: #8c857b;
  margin-top: 1px;
}
.stock-badge.low {
  color: #e67e22;
}
.stock-badge.out {
  color: #c0392b;
  font-weight: 600;
}
