/* =========================================================
   COMPOSER — interactive builder layout, draggable items,
   selection frame, layer bar, mobile bottom sheet.
   ========================================================= */

.composer {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 32px;
  align-items: start;
  margin-top: 40px;
  position: relative;
}

.composer-controls { min-width: 0; }

/* ----- Stepper ----- */
.composer .lux-steps {
  display: flex; gap: 4px;
  margin: 0 0 22px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
}
.composer .lux-steps::-webkit-scrollbar { display: none; }
.composer .lux-step {
  flex: 1; min-width: 90px;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: 12.5px; letter-spacing: .04em;
  color: var(--muted); border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s;
}
.composer .lux-step span {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gray-100); color: var(--muted);
  font-size: 10px; font-weight: 600;
}
.composer .lux-step.active { background: var(--ink); color: #fff; }
.composer .lux-step.active span { background: var(--pink); color: #fff; }
.composer .lux-step.done span { background: var(--pink-soft); color: var(--pink-deep); }

/* ----- Preview pane ----- */
.composer-preview {
  position: sticky; top: 96px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 22px; padding: 22px;
  box-shadow: 0 1px 2px rgba(20,16,22,.04), 0 24px 60px -28px rgba(20,16,22,.14);
}
.cmp-preview-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.cmp-preview-head .live { font-size: 12px; color: var(--muted); }
.cmp-preview-head .live .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #6dbb73; margin-right: 6px;
  animation: cmpLive 1.6s ease-in-out infinite;
}
@keyframes cmpLive { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.cmp-price-tag {
  font-family: var(--display); font-size: 22px; color: var(--ink);
}

/* ----- Stage ----- */
.cmp-stage-wrap { position: relative; margin-bottom: 18px; }
.cmp-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, #fbf6f4 0%, #ffffff 100%);
  border-radius: 16px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: default;
}
.cmp-stage:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.cmp-stage-glow {
  position: absolute; inset: 6% 10% 18% 10%;
  background: radial-gradient(60% 60% at 50% 40%, rgba(242,167,184,.18), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}
.cmp-stage-floor {
  position: absolute; left: 14%; right: 14%; bottom: 8%; height: 14px;
  background: radial-gradient(50% 100% at 50% 50%, rgba(20,16,22,.14), transparent 70%);
  filter: blur(6px);
  pointer-events: none;
}

/* ----- Base (the box) — rendered with pure CSS per type ----- */
.cmp-base {
  position: absolute;
  left: 8%; right: 8%;
  bottom: 7%;
  height: 32%;
  z-index: 5;
  background: #fff;
  border: 1px solid #e3e3e5;
  border-radius: 8px;
  box-shadow:
    inset 0 -4px 12px rgba(0,0,0,.04),
    0 8px 16px -10px rgba(0,0,0,.18);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: 8%;
  pointer-events: none;
}
.cmp-base::before {
  content: ""; position: absolute; left: -2%; right: -2%; top: -8%; height: 18%;
  background: #fafafa; border: 1px solid #dadada; border-radius: 8px;
  box-shadow: 0 4px 10px -6px rgba(0,0,0,.18);
}
.cmp-base::after {
  content: "Sofira  ·  B A L L O O N S";
  position: absolute; bottom: 18%; left: 50%; transform: translateX(-50%);
  font-family: var(--display); font-style: italic; font-size: 13px;
  color: #c4a26a; letter-spacing: 1.5px; white-space: nowrap;
}
.cmp-base[data-base="round-box"]   { border-radius: 50% 50% 8px 8px / 18% 18% 8px 8px; }
.cmp-base[data-base="round-box"]::before { border-radius: 50%; }
.cmp-base[data-base="square-box"]  { border-radius: 6px; }
.cmp-base[data-base="acrylic"]     { background: rgba(220, 222, 228, .35); border-color: #b9c0c8; }
.cmp-base[data-base="acrylic"]::after { color: #7a87a0; }
.cmp-base[data-base="transparent"] { background: rgba(255,255,255,.35); border-color: #d0d6dd; border-radius: 50% 50% 8px 8px / 22% 22% 8px 8px; }
.cmp-base[data-base="tray"]        { height: 20%; background: #f5e8d6; border-color: #c4a26a; border-radius: 16px; }
.cmp-base[data-base="tray"]::before { display: none; }
.cmp-base[data-base="stand"]       {
  background: linear-gradient(180deg, #fff 0%, #fff 40%, #c4a26a 40%, #a4814b 100%);
  border-color: #c4a26a;
}

/* ----- Item nodes ----- */
.cmp-item {
  position: absolute;
  transition: opacity .25s ease;
  cursor: grab;
  will-change: transform;
}
.cmp-item:active { cursor: grabbing; }
.cmp-item svg { width: 100%; height: 100%; display: block; pointer-events: none; }

/* ----- Selection frame ----- */
.cmp-sel-frame {
  position: absolute;
  border: 1.5px solid var(--pink-deep);
  background: rgba(242, 167, 184, .12);
  border-radius: 8px;
  pointer-events: none;
  box-shadow: 0 0 0 4px rgba(242, 167, 184, .18);
  animation: cmpSelPulse 1.6s ease-in-out infinite;
}
@keyframes cmpSelPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(242, 167, 184, .18); }
  50%      { box-shadow: 0 0 0 8px rgba(242, 167, 184, .10); }
}
.cmp-sel-x {
  position: absolute; top: -14px; right: -14px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--ink); color: #fff;
  border: 2px solid #fff;
  display: grid; place-items: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 6px 14px -4px rgba(20,16,22,.4);
}
.cmp-sel-x:hover { background: var(--pink-deep); }

/* ----- Layer bar ----- */
.cmp-layer-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 13px;
}
.cmp-sel-label {
  font-family: var(--display);
  font-style: italic;
  font-size: 15px;
  color: var(--pink-deep);
  margin-right: auto;
}
.cmp-layer-group {
  display: flex; gap: 4px;
  background: var(--gray-50);
  border-radius: 8px;
  padding: 3px;
}
.cmp-layer-group button {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 14px;
  transition: background .15s ease, color .15s ease;
}
.cmp-layer-group button:hover { background: #fff; color: var(--ink); box-shadow: 0 2px 6px -2px rgba(20,16,22,.18); }

/* ----- Selected items list ----- */
.cmp-items {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  margin-bottom: 14px;
}
.cmp-items-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 12px;
}
.cmp-clear {
  background: transparent; border: 0; color: var(--muted-2);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer;
}
.cmp-clear:hover { color: var(--pink-deep); }
.cmp-items-list { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.cmp-empty { color: var(--muted); font-size: 13px; padding: 8px 0; font-style: italic; }
.cmp-list-item {
  display: grid;
  grid-template-columns: 16px 1fr auto auto;
  gap: 10px; align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s ease;
  border: 1px solid transparent;
}
.cmp-list-item:hover { background: var(--gray-50); }
.cmp-list-item.selected { background: #fbf6f4; border-color: rgba(242,167,184,.4); }
.cli-dot { width: 10px; height: 10px; border-radius: 50%; }
.cli-label { font-size: 13px; }
.cli-price { font-size: 12px; color: var(--muted); }
.cli-x {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gray-50);
  color: var(--muted);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .15s ease, color .15s ease;
}
.cli-x:hover { background: var(--pink-soft); color: var(--pink-deep); }

/* ----- Summary + actions ----- */
.cmp-summary { margin-bottom: 14px; }
.cmp-sum-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 0; font-size: 13px;
}
.cmp-sum-row span { color: var(--muted); }
.cmp-sum-row strong { font-weight: 500; text-align: right; }
.cmp-sum-total {
  border-top: 1px solid var(--line);
  padding-top: 10px; margin-top: 4px;
}
.cmp-sum-total span { font-family: var(--display); font-size: 18px; color: var(--ink); }
.cmp-sum-total strong { font-family: var(--display); font-size: 22px; }
.cmp-actions { display: grid; gap: 10px; }
.cmp-note { font-size: 11px; color: var(--muted); text-align: center; margin: 12px 0 0; letter-spacing: .03em; }

/* ----- Flash toast ----- */
.cmp-flash {
  position: fixed; left: 50%; bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 20px 40px -20px rgba(20,16,22,.45);
  transition: opacity .25s ease, transform .35s var(--ease);
}
.cmp-flash.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ----- Mobile bottom sheet ----- */
.cmp-sheet-tab {
  display: none;
  position: fixed; left: 12px; right: 12px; bottom: 12px;
  z-index: 100;
  align-items: center; gap: 14px;
  padding: 14px 18px;
  border-radius: 999px;
  background: var(--ink); color: #fff;
  box-shadow: 0 16px 36px -12px rgba(20,16,22,.4);
  cursor: pointer;
  border: 0;
  font-size: 13px;
}
.cmp-sheet-count {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--pink-deep);
  font-weight: 600; font-size: 12px;
}
.cmp-sheet-price { font-family: var(--display); font-size: 16px; margin-right: auto; }
.cmp-sheet-cta { letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }

/* ----- Responsive ----- */
@media (max-width: 1024px) {
  .composer { grid-template-columns: 1fr; }
  .composer-preview { position: relative; top: 0; }
}
@media (max-width: 768px) {
  .composer-preview {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    top: auto;
    width: 100%;
    border-radius: 22px 22px 0 0;
    padding: 16px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(calc(100% - 0px));
    transition: transform .35s var(--ease);
    z-index: 90;
    box-shadow: 0 -20px 50px -16px rgba(20,16,22,.25);
  }
  .composer-preview::before {
    content: "";
    position: sticky;
    top: 0;
    display: block;
    width: 48px; height: 4px;
    background: var(--gray-100);
    border-radius: 4px;
    margin: 4px auto 12px;
  }
  body.cmp-sheet-open .composer-preview { transform: translateY(0); }
  .cmp-sheet-tab { display: flex; }
  body.cmp-sheet-open .cmp-sheet-tab { transform: translateY(120%); transition: transform .35s var(--ease); }
  .cmp-stage { max-width: 320px; margin: 0 auto; }
}

@media (max-width: 540px) {
  .composer .lux-step { padding: 8px 10px; font-size: 11.5px; gap: 6px; }
  .composer .lux-step span { width: 18px; height: 18px; font-size: 9px; }
  .lux-panel { padding: 18px; }
  .lux-panel-head h4 { font-size: 22px; }
  .lux-step-nav { flex-direction: column; }
  .lux-step-nav .btn-lux { width: 100%; }
}


/* =========================================================
   WC BUILDER PLACEHOLDER — WooCommerce shortcode slot
   ========================================================= */
.wc-builder-ph {
  display: flex; justify-content: center;
  padding: 8px 0 4px;
}
.wc-ph-card {
  width: 100%; max-width: 720px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 16px;
  padding: clamp(40px, 6vw, 72px) clamp(28px, 5vw, 64px);
  background:
    radial-gradient(120% 120% at 50% 0%, var(--blush-50, #fff5f7) 0%, #ffffff 60%);
  border: 1.5px dashed var(--pink, #f2a7b8);
  border-radius: var(--r-xl, 32px);
  position: relative;
}
.wc-ph-card::after {
  content: ""; position: absolute; inset: 7px;
  border: 1px solid rgba(194,160,106,.28);
  border-radius: calc(var(--r-xl, 32px) - 8px);
  pointer-events: none;
}
.wc-ph-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: #b88a3e;
  background: rgba(194,160,106,.10);
  border: 1px solid rgba(194,160,106,.30);
  padding: 6px 14px; border-radius: 999px;
}
.wc-ph-illus {
  width: 76px; height: 76px; margin-top: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--pink-deep, #e88fa3);
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 2px rgba(32,32,32,.05), 0 18px 36px -20px rgba(232,143,163,.6);
}
.wc-ph-illus svg { width: 40px; height: 40px; }
.wc-ph-card h3 {
  font-family: var(--display, serif); font-weight: 400;
  font-size: clamp(22px, 3vw, 30px); letter-spacing: -.01em;
  margin: 0; color: var(--ink, #202020);
}
.wc-ph-card p {
  margin: 0; max-width: 52ch;
  color: var(--muted, #666); font-size: 15px; line-height: 1.6;
  text-wrap: pretty;
}
.wc-ph-code-row {
  display: inline-flex; align-items: stretch; gap: 0;
  margin-top: 6px; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(32,32,32,.06), 0 14px 30px -18px rgba(32,32,32,.25);
}
.wc-ph-code {
  font-family: "SFMono-Regular", ui-monospace, "Menlo", monospace;
  font-size: 15px; color: #fff; background: var(--ink, #202020);
  padding: 14px 20px; letter-spacing: .02em; display: inline-flex; align-items: center;
}
.wc-ph-copy {
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  padding: 14px 18px; color: var(--ink, #202020); background: #fff;
  border-left: 1px solid var(--line, #ececee);
  transition: background .2s ease, color .2s ease;
}
.wc-ph-copy:hover { background: var(--ink, #202020); color: #fff; }
.wc-ph-hint { font-size: 12px; color: var(--muted-2, #8a8a8a); letter-spacing: .02em; }
