/* Kupabardak — Kişiye özel tasarım: ürün sayfası kartı + tasarım stüdyosu (assets/js/designer.js) */

/* ---------- Ürün sayfası kartı ---------- */
.kbd-card { position: relative; border: 1px solid #eeeeef; background: #fff; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.kbd-card.is-shake { animation: kbd-shake .45s ease; }
@keyframes kbd-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.kbd-card-head { display: flex; align-items: flex-start; gap: 12px; }
.kbd-card-icon { width: 40px; height: 40px; border-radius: 12px; background: #fff1e8; color: #E95902; display: grid; place-items: center; flex-shrink: 0; }
.kbd-card-text { flex: 1; min-width: 0; }
.kbd-card-title { font-size: 16px; font-weight: 700; margin: 0; color: #111827; }
.kbd-card-sub { font-size: 13px; color: #6b7280; font-weight: 400; line-height: 1.5; margin-top: 2px; }
.kbd-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: #C2410C; background: #ffedd5; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.kbd-open { display: flex; align-items: center; justify-content: center; gap: 10px; height: 48px; border-radius: 10px; border: 2px dashed #f2a776; background: #fff; color: #E95902; font-size: 15.5px; font-weight: 700; transition: background .2s, border-color .2s, transform .15s; }
.kbd-open:hover { background: #fff6f0; border-color: #E95902; transform: translateY(-1px); }
.kbd-card.has-design .kbd-open { border-style: solid; border-width: 1px; height: 42px; font-size: 14px; color: #6b7280; border-color: #e5e7eb; }
.kbd-card.has-design .kbd-open:hover { color: #E95902; border-color: #f2a776; }
.kbd-req { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #b45309; font-weight: 600; margin-top: -4px; }
.kbd-facts { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: #4b5563; font-weight: 400; }
.kbd-facts li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; }
.kbd-facts svg { flex-shrink: 0; margin-top: 1px; color: #9ca3af; }
.kbd-facts strong { color: #111827; font-weight: 600; }
.kbd-help { font-size: 12.5px; color: #4b5563; font-weight: 400; }
.kbd-help summary { cursor: pointer; color: #E95902; font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 4px; }
.kbd-help summary::-webkit-details-marker { display: none; }
.kbd-help summary::after { content: ''; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -3px 0 0 4px; transition: transform .2s; }
.kbd-help[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.kbd-help ul { margin-top: 8px; padding: 10px 12px; background: #fafafa; border-radius: 10px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.kbd-help strong { color: #111827; font-weight: 600; }

.kbd-selected { display: flex; gap: 12px; align-items: center; padding: 10px; background: #fff; border: 1px solid #d1fae5; border-radius: 12px; box-shadow: 0 2px 8px rgba(16, 185, 129, .08); }
.kbd-sel-thumbs { display: flex; gap: 6px; flex-shrink: 0; }
.kbd-sel-thumb { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: #f5f5f5; padding: 0; border: 1px solid #eee; }
.kbd-sel-thumb img { width: 100%; height: 100%; object-fit: cover; }
.kbd-sel-thumb span { position: absolute; left: 4px; bottom: 4px; font-size: 9.5px; font-weight: 700; background: rgba(255, 255, 255, .92); padding: 1px 5px; border-radius: 999px; color: #374151; }
.kbd-sel-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 12.5px; color: #4b5563; font-weight: 400; }
.kbd-sel-info > strong { display: flex; align-items: center; gap: 5px; color: #047857; font-size: 14px; font-weight: 700; }
.kbd-sel-info b { color: #111827; font-weight: 700; }
.kbd-sel-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; }
.kbd-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: #E95902; padding: 2px 0; cursor: pointer; }
.kbd-link svg { width: 14px; height: 14px; }
.kbd-link:hover { color: #C54A01; text-decoration: underline; }
.kbd-link.is-muted { color: #6b7280; }
.kbd-link.is-danger { color: #dc2626; }

.kbd-previous { display: flex; flex-direction: column; gap: 6px; }
.kbd-previous-title { font-size: 12px; font-weight: 600; color: #6b7280; }
.kbd-previous-list { display: flex; gap: 8px; flex-wrap: wrap; }
.kbd-prev { position: relative; }
.kbd-prev-pick { width: 54px; height: 54px; border-radius: 10px; overflow: hidden; border: 1px solid #e5e7eb; background: #f5f5f5; padding: 0; transition: border-color .2s, transform .15s; }
.kbd-prev-pick:hover { border-color: #E95902; transform: translateY(-1px); }
.kbd-prev-pick img { width: 100%; height: 100%; object-fit: cover; }
.kbd-prev-pick i { position: absolute; left: 3px; bottom: 3px; font-style: normal; font-size: 9px; font-weight: 700; background: rgba(255, 255, 255, .92); padding: 0 4px; border-radius: 999px; }
.kbd-prev-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 1px solid #e5e7eb; color: #6b7280; display: none; place-items: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.kbd-prev-del svg { width: 12px; height: 12px; }
.kbd-prev:hover .kbd-prev-del, .kbd-prev-del:focus-visible { display: grid; }
@media (hover: none) { .kbd-prev-del { display: grid; } }

/* Galeri: tasarım küçük görselleri ve ana görsel etiketi */
.tsp-thumb.is-design { position: relative; }
.tsp-thumb-tag { position: absolute; right: 4px; bottom: 4px; width: 20px; height: 20px; border-radius: 50%; background: #E95902; color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.tsp-thumb-tag svg { width: 11px; height: 11px; }
.kbd-chip { position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 6px; z-index: 3; }
.kbd-chip[hidden] { display: none; }
.kbd-chip span, .kbd-chip button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, .1); }
.kbd-chip span { background: rgba(255, 255, 255, .95); color: #C2410C; }
.kbd-chip button { background: #E95902; color: #fff; }
.kbd-chip button:hover { background: #C54A01; }
.kbd-chip svg { width: 14px; height: 14px; }

/* ---------- Stüdyo ---------- */
html.kbd-lock, html.kbd-lock body { overflow: hidden; }
.kbd-studio { position: fixed; inset: 0; z-index: 2000; background: rgba(17, 24, 39, .55); display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; transition: opacity .2s ease; }
.kbd-studio[hidden] { display: none; }
.kbd-studio.is-open { opacity: 1; }
.kbd-box { position: relative; width: min(1120px, 100%); height: min(760px, 100%); background: #fff; border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .25); transform: translateY(12px) scale(.985); transition: transform .25s ease; }
.kbd-studio.is-open .kbd-box { transform: none; }
.kbd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #f0f0f0; }
.kbd-head h2 { font-size: 18px; font-weight: 700; margin: 0; }
.kbd-head span { font-size: 13px; color: #6b7280; font-weight: 400; }
.kbd-x { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #6b7280; transition: background .2s; }
.kbd-x:hover { background: #f3f4f6; color: #111827; }
.kbd-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); }

.kbd-stage { position: relative; background: #f4f2ef; display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; }
.kbd-canvas { display: block; cursor: grab; touch-action: pan-y; outline: none; }
.kbd-studio.is-turning .kbd-canvas { cursor: grabbing; }
.kbd-canvas:focus-visible { box-shadow: inset 0 0 0 3px rgba(233, 89, 2, .4); border-radius: 12px; }
.kbd-stage-hint { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #6b7280; background: rgba(255, 255, 255, .85); padding: 6px 12px; border-radius: 999px; pointer-events: none; transition: opacity .4s; }
.kbd-stage-hint svg { width: 14px; height: 14px; }
.kbd-stage-hint.is-gone { opacity: 0; }
.kbd-stage-tools { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; background: #fff; border-radius: 999px; box-shadow: 0 6px 20px rgba(0, 0, 0, .1); }
.kbd-stage-tools button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #4b5563; transition: background .2s, color .2s; }
.kbd-stage-tools button svg { width: 15px; height: 15px; }
.kbd-stage-tools button:hover:not(:disabled) { background: #f5f5f5; color: #111827; }
.kbd-stage-tools button.is-on { background: #111827; color: #fff; }
.kbd-stage-tools button:disabled { opacity: .35; cursor: not-allowed; }

.kbd-panel { overflow-y: auto; padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 20px; border-left: 1px solid #f0f0f0; }
.kbd-step { display: flex; flex-direction: column; gap: 10px; }
.kbd-step-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: #111827; }
.kbd-step-title b { width: 22px; height: 22px; border-radius: 50%; background: #fff1e8; color: #E95902; font-size: 12px; display: grid; place-items: center; }
.kbd-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kbd-seg button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1.5px solid #e5e7eb; border-radius: 12px; text-align: left; transition: border-color .2s, background .2s; }
.kbd-seg button strong { font-size: 14px; font-weight: 700; color: #111827; }
.kbd-seg button small { font-size: 12px; color: #6b7280; font-weight: 500; }
.kbd-seg button:hover { border-color: #f2a776; }
.kbd-seg button[aria-checked="true"] { border-color: #E95902; background: #fff7f2; box-shadow: 0 0 0 3px rgba(233, 89, 2, .1); }
.kbd-sidetabs { display: flex; gap: 6px; padding: 4px; background: #f5f5f5; border-radius: 12px; }
.kbd-sidetabs[hidden] { display: none; }
.kbd-sidetabs button { flex: 1; height: 36px; border-radius: 9px; font-size: 13px; font-weight: 600; color: #6b7280; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.kbd-sidetabs button.is-on { background: #fff; color: #111827; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.kbd-sidetabs i { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; }
.kbd-sidetabs i.is-ok { background: #10b981; }

[data-editor] { display: flex; flex-direction: column; gap: 10px; transition: opacity .2s; }
[data-editor].is-loading { opacity: .5; pointer-events: none; }
.kbd-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 28px 16px; border: 2px dashed #f2a776; border-radius: 14px; background: #fffaf6; color: #E95902; text-align: center; cursor: pointer; transition: background .2s, border-color .2s; }
.kbd-drop svg { width: 30px; height: 30px; }
.kbd-drop strong { font-size: 15px; color: #111827; }
.kbd-drop span { font-size: 12.5px; color: #6b7280; font-weight: 400; }
.kbd-drop:hover, .kbd-drop.is-over, .kbd-drop:focus-visible { background: #fff1e8; border-color: #E95902; outline: none; }
.kbd-spec { font-size: 12.5px; color: #4b5563; background: #f9fafb; border-radius: 12px; padding: 10px 12px; font-weight: 400; line-height: 1.5; }
.kbd-spec strong { color: #111827; font-weight: 700; }
.kbd-spec span { display: block; margin-top: 4px; color: #6b7280; }

.kbd-area { position: relative; width: 100%; border-radius: 12px; overflow: hidden; cursor: grab; touch-action: none; box-shadow: inset 0 0 0 1px #e5e7eb; background: #fff; }
.kbd-area.is-drag { cursor: grabbing; }
.kbd-area canvas { display: block; width: 100%; height: 100%; }
.kbd-guide-v, .kbd-guide-h { position: absolute; background: #E95902; opacity: 0; transition: opacity .15s; pointer-events: none; }
.kbd-guide-v { left: 50%; top: 0; bottom: 0; width: 1px; }
.kbd-guide-h { top: 50%; left: 0; right: 0; height: 1px; }
.kbd-guide-v.is-on, .kbd-guide-h.is-on { opacity: .8; }
.kbd-area-hint { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #6b7280; font-weight: 400; margin-top: -4px; }
.kbd-area-hint svg { width: 13px; height: 13px; }
.kbd-zoom { display: flex; align-items: center; gap: 8px; }
.kbd-zoom button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #e5e7eb; font-size: 18px; font-weight: 600; color: #374151; display: grid; place-items: center; line-height: 1; }
.kbd-zoom button:hover { border-color: #E95902; color: #E95902; }
.kbd-zoom input { flex: 1; accent-color: #E95902; }
.kbd-zoom output { width: 44px; text-align: right; font-size: 12.5px; font-weight: 600; color: #4b5563; }
.kbd-fit { display: flex; gap: 6px; flex-wrap: wrap; }
.kbd-fit button { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid #e5e7eb; font-size: 12.5px; font-weight: 600; color: #4b5563; transition: border-color .2s, background .2s, color .2s; }
.kbd-fit button:hover { border-color: #f2a776; color: #E95902; }
.kbd-fit button.is-on { background: #fff1e8; border-color: #E95902; color: #C2410C; }
.kbd-quality { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: 12px; font-size: 13px; }
.kbd-quality svg { flex-shrink: 0; margin-top: 1px; }
.kbd-quality span { display: flex; flex-direction: column; }
.kbd-quality strong { font-weight: 700; }
.kbd-quality small { font-size: 11.5px; font-weight: 500; opacity: .85; }
.kbd-quality.is-good { background: #ecfdf5; color: #047857; }
.kbd-quality.is-mid { background: #fffbeb; color: #b45309; }
.kbd-quality.is-bad { background: #fef2f2; color: #b91c1c; }
.kbd-file { display: flex; align-items: center; gap: 12px; font-size: 12.5px; }
.kbd-file-name { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; color: #4b5563; font-weight: 500; }
.kbd-file-name svg { width: 15px; height: 15px; flex-shrink: 0; color: #9ca3af; }
.kbd-file-name em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.kbd-foot { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid #f0f0f0; background: #fff; flex-wrap: wrap; }
.kbd-total { display: flex; flex-direction: column; margin-right: auto; line-height: 1.2; }
.kbd-total span { font-size: 12px; color: #6b7280; font-weight: 500; }
.kbd-total strong { font-size: 22px; font-weight: 700; color: #E95902; }
.kbd-total small { font-size: 11.5px; color: #6b7280; font-weight: 500; }
.kbd-err { order: 5; flex-basis: 100%; font-size: 13px; color: #b91c1c; background: #fef2f2; border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.kbd-err.is-soft { color: #b45309; background: #fffbeb; }
.kbd-err[hidden] { display: none; }
.kbd-cancel { height: 46px; padding: 0 18px; border-radius: 10px; font-size: 15px; font-weight: 600; color: #4b5563; }
.kbd-cancel:hover { background: #f5f5f5; }
.kbd-confirm { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 24px; border-radius: 10px; background: #E95902; color: #fff; font-size: 15.5px; font-weight: 700; transition: background .2s, transform .15s; }
.kbd-confirm:hover { background: #C54A01; transform: translateY(-1px); }
.kbd-busy { position: absolute; inset: 0; background: rgba(255, 255, 255, .88); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 5; }
.kbd-busy[hidden] { display: none; }
.kbd-busy-in { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; width: min(320px, 80%); }
.kbd-busy-in strong { font-size: 16px; }
.kbd-busy-in small { font-size: 12px; color: #6b7280; font-weight: 500; }
.kbd-spin { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fde2cf; border-top-color: #E95902; animation: kbd-rot .8s linear infinite; }
@keyframes kbd-rot { to { transform: rotate(360deg); } }
.kbd-bar { width: 100%; height: 6px; border-radius: 999px; background: #f3f4f6; overflow: hidden; }
.kbd-bar i { display: block; height: 100%; width: 0; background: #E95902; border-radius: inherit; transition: width .25s ease; }

.kbd-toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 16px); z-index: 2100; background: #111827; color: #fff; font-size: 14px; font-weight: 600; padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); opacity: 0; transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); text-align: center; }
.kbd-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
	.kbd-studio { padding: 0; }
	.kbd-box { width: 100%; height: 100%; border-radius: 0; }
	.kbd-head { padding: 10px 14px; }
	.kbd-head h2 { font-size: 16px; }
	.kbd-body { display: flex; flex-direction: column; overflow-y: auto; }
	.kbd-stage { flex: none; height: min(46vh, 100vw); }
	.kbd-panel { overflow: visible; border-left: 0; border-top: 1px solid #f0f0f0; padding: 16px 14px 20px; }
	.kbd-stage-tools { bottom: 10px; }
	.kbd-stage-tools button { padding: 0 11px; height: 32px; }
	.kbd-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); gap: 8px; }
	.kbd-cancel { display: none; }
	.kbd-confirm { flex: 1; justify-content: center; }
	.kbd-total strong { font-size: 19px; }
	.kbd-selected { flex-direction: column; align-items: flex-start; }
	.kbd-toast { bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
	.kbd-studio, .kbd-box, .kbd-card.is-shake { transition: none; animation: none; }
}
.kbd-stage-tools button, .kbd-confirm, .kbd-cancel { white-space: nowrap; }
@media (max-width: 380px) { .kbd-confirm { padding: 0 14px; font-size: 14.5px; } .kbd-total strong { font-size: 17px; } .kbd-total small { font-size: 10.5px; } }

/* Kulp ve iç rengi */
.kbd-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.kbd-color { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 8px; border: 1.5px solid #e5e7eb; border-radius: 12px; background: #fff; transition: border-color .2s, box-shadow .2s, transform .15s; }
.kbd-color:hover:not(:disabled) { border-color: #f2a776; transform: translateY(-1px); }
.kbd-color[aria-checked="true"] { border-color: #E95902; background: #fff7f2; box-shadow: 0 0 0 3px rgba(233, 89, 2, .1); }
.kbd-color[aria-checked="true"]::after { content: ''; position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; border-radius: 50%; background: #E95902 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 10px no-repeat; }
.kbd-color-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .08); }
.kbd-color-name { font-size: 12.5px; font-weight: 700; color: #111827; line-height: 1.2; text-align: center; }
.kbd-color small { font-size: 11px; font-weight: 600; color: #6b7280; }
.kbd-color.is-out { opacity: .5; cursor: not-allowed; }
.kbd-color.is-out .kbd-color-dot { background: repeating-linear-gradient(135deg, var(--c) 0 4px, #fff 4px 6px); }
.kbd-color.is-out small { color: #b91c1c; }
.kbd-color-note { font-size: 12.5px; color: #6b7280; font-weight: 500; margin-top: -2px; }
.kbd-dots { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 2px; }
.kbd-dots i, .kbd-sel-color { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); vertical-align: -2px; }
.kbd-sel-color { margin-right: 4px; }
