/* =========================================================
   Kendi kutunu tasarla
   ========================================================= */
.bb { padding-bottom: 3rem; }
.bb [hidden] { display: none !important; }
.bb-head .page-intro { max-width: 70ch; }
.bb-step { margin-bottom: 1.5rem; }
.bb-step-title { font-family: var(--font-body); font-size: 1rem; font-weight: 800; margin-bottom: .75rem; }
.bb-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem; margin-bottom: 1.1rem; }

/* Kutu seçimi */
.bb-boxes { display: flex; gap: .65rem; overflow-x: auto; padding: 2px 2px .4rem; scrollbar-width: thin; }
.bb-boxcard { flex: none; display: flex; align-items: center; gap: .75rem; min-width: 200px; padding: .65rem .9rem .65rem .65rem; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; text-align: left; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.bb-boxcard:hover { border-color: rgba(var(--brand-rgb), .5); }
.bb-boxcard.is-active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow-md); }
.bb-boxcard-shape { width: 56px; height: 56px; flex: none; border-radius: calc(var(--radius) - 6px); background: var(--surface); display: grid; place-items: center; overflow: hidden; }
.bb-boxcard-shape img { width: 100%; height: 100%; object-fit: cover; }
.bb-boxcard-shape i { display: block; border-radius: 3px; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .18); }
.bb-boxcard-text { display: flex; flex-direction: column; line-height: 1.25; }
.bb-boxcard-text small { color: var(--muted); font-weight: 600; font-size: .78rem; }
.bb-boxcard-price { color: var(--brand) !important; }

/* Yerleşim */
.bb-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); gap: 1.5rem; align-items: start; }
.bb-stage-col, .bb-side { min-width: 0; }
.bb-stage-col { position: sticky; top: calc(var(--header-h) + 66px); }
.bb-stage-card { background: var(--surface); border-radius: calc(var(--radius) + 4px); padding: 1.1rem 1.2rem 1rem; margin-bottom: 1.1rem; }
.bb-stage-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: .9rem; flex-wrap: wrap; }
.bb-fill { min-width: 170px; }
.bb-fill-label { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: .3rem; text-align: right; }
.bb-fill-label b { color: var(--ink); }
.bb-fill-bar { display: block; height: 8px; border-radius: 8px; background: #fff; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.bb-fill-bar span { display: block; height: 100%; width: 0; border-radius: 8px; background: var(--ok); transition: width .35s ease, background .2s; }
.bb-fill-bar.is-high span { background: var(--accent); }

.bb-alert { display: flex; gap: .7rem; align-items: flex-start; background: #fff4e0; border: 1px solid #f3d29a; color: #6b4300; border-radius: var(--radius-sm); padding: .7rem .9rem; margin-bottom: .9rem; font-size: .9rem; }
.bb-alert > i { font-size: 1.1rem; margin-top: 1px; }
.bb-alert strong { display: block; }
.bb-alert span { display: block; }
.bb-alert.is-shake { animation: bbShake .4s ease; }
@keyframes bbShake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* Kutu sahnesi */
.bb-stage-wrap { position: relative; display: flex; justify-content: center; padding: 22px 0 6px 22px; min-width: 0; overflow: hidden; }
.bb-ruler { position: absolute; font-size: .74rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.bb-ruler-x { top: 0; left: 22px; right: 0; text-align: center; }
.bb-ruler-y { left: 0; top: 50%; transform: translate(-38%, -50%) rotate(-90deg); }
.bb-box { --wall: #e9e3d8; padding: 10px; border-radius: 10px; background: color-mix(in srgb, var(--wall) 72%, #000); box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .55), inset 0 2px 0 rgba(255, 255, 255, .25); }
.bb-inner { position: relative; border-radius: 4px; background-size: cover; background-position: center; box-shadow: inset 0 3px 10px rgba(0, 0, 0, .28); overflow: hidden; touch-action: none; user-select: none; }
.bb-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; text-align: center; padding: 1rem; color: rgba(0, 0, 0, .45); font-weight: 600; font-size: .9rem; }
.bb-box.is-dark .bb-empty { color: rgba(255, 255, 255, .6); }
.bb-empty .bi { font-size: 2rem; }

.bb-item { position: absolute; border-radius: 4px; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(0, 0, 0, .06); cursor: grab; overflow: hidden; transition: left .3s cubic-bezier(.2, .8, .2, 1), top .3s cubic-bezier(.2, .8, .2, 1), width .3s, height .3s, box-shadow .15s; }
.bb-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6%; mix-blend-mode: multiply; pointer-events: none; }
.bb-item.is-cut { background: none; box-shadow: none; overflow: visible; }
.bb-item.is-cut img { inset: auto; left: 50%; top: 50%; padding: 0; object-fit: fill; mix-blend-mode: normal; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.bb-item:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(var(--brand-rgb), .5); }
.bb-item.is-selected { outline: 2px solid var(--brand); outline-offset: 1px; z-index: 2; }
.bb-item:focus-visible { outline: 3px solid rgba(var(--accent-rgb), .95); }
.bb-item.is-dragging { cursor: grabbing; transition: none; z-index: 5; opacity: .92; box-shadow: 0 12px 24px rgba(0, 0, 0, .35); }
.bb-item.is-bad { outline: 2px dashed #d7262e; }
.bb-item.is-new { animation: bbPop .55s cubic-bezier(.3, 1.6, .5, 1); }
.bb-item.is-bad-flash { animation: bbShake .4s ease; outline: 2px solid #d7262e; }
@keyframes bbPop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.bb-tools { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; }
.bb-tools-right { display: flex; gap: .4rem; flex-wrap: wrap; margin-left: auto; }
.bb-selected { display: flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .88rem; min-width: 0; }
.bb-selected > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.bb-hint { font-size: .8rem; color: var(--muted); margin: .65rem 0 0; }

/* İçindekiler */
.bb-contents { list-style: none; margin: 0; padding: 0; }
.bb-contents:empty::after { content: "—"; color: var(--muted); }
.bb-c { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.bb-c:last-child { border-bottom: 0; }
.bb-c > img { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; background: var(--surface); padding: 4px; mix-blend-mode: multiply; }
.bb-c-name { display: block; font-weight: 700; color: var(--ink); font-size: .9rem; line-height: 1.25; }
.bb-c-body small { display: block; color: var(--muted); font-size: .76rem; }
.bb-c-color { margin-top: .3rem; max-width: 220px; }
.bb-c-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.bb-c-qty button { border: 0; background: var(--surface); width: 32px; height: 32px; font-weight: 800; }
.bb-c-qty b { min-width: 30px; text-align: center; }

/* Ürün seçici */
.bb-picker { padding-bottom: .6rem; }
.bb-search { position: relative; margin-bottom: .6rem; }
.bb-search i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.bb-search input { padding-left: 2.2rem; }
.bb-cats { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: .2rem; scrollbar-width: thin; }
.bb-cats .chip { padding: .3rem .75rem; }
.bb-list { list-style: none; margin: 0 -.4rem; padding: 0; max-height: min(560px, 62vh); overflow-y: auto; }
.bb-p { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .55rem .4rem; border-radius: var(--radius-sm); transition: background .15s, opacity .15s; }
.bb-p:hover { background: var(--brand-softer); }
.bb-p > img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: var(--surface); padding: 4px; mix-blend-mode: multiply; }
.bb-p-name { display: block; font-weight: 700; font-size: .88rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bb-p-size { display: block; color: var(--muted); font-size: .76rem; font-weight: 600; margin: .1rem 0 .25rem; }
.bb-p .swatches { gap: .25rem; }
.bb-p .swatch { width: 16px; height: 16px; border-width: 1.5px; }
.bb-p .swatch.is-active { box-shadow: 0 0 0 2px var(--ink); }
.bb-p-act { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.bb-p-status { font-size: .72rem; font-weight: 700; color: var(--ok); white-space: nowrap; min-height: 1em; }
.bb-p-add { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 1.1rem; display: grid; place-items: center; transition: transform .15s, background .15s; }
.bb-p-add:hover { transform: scale(1.08); background: var(--brand-dark); }
.bb-p-add.is-done { background: var(--ok); }
.bb-p.is-nofit > img, .bb-p.is-nofit .bb-p-body { opacity: .5; }
.bb-p.is-nofit .bb-p-status { color: var(--warn); }
.bb-p.is-nofit .bb-p-add { background: var(--surface-2); color: var(--muted); }
.bb-more { padding: .5rem .4rem; }

@media (max-width: 991.98px) {
  .bb-layout { grid-template-columns: minmax(0, 1fr); }
  .bb-stage-col { position: static; }
  .bb-list { max-height: none; }
}
@media (max-width: 575.98px) {
  .bb-stage-card { padding: .9rem .7rem; }
  .bb-tools-right { margin-left: 0; }
  .bb-boxcard { min-width: 170px; }
}
@media (hover: none) {
  .bb-hint { display: none; }
}
