/* =====================================================================
 * Kanvas Tablolar (/kanvas-tablolar) + Sen Tasarla (/kanvas-tasarla)
 * SUP-0321 — yalnız bu iki sayfada yüklenir.
 * ===================================================================== */

/* --- Örnek "fotoğraf" dokusu (görseli olmayan şekil kartları) --- */
.kv-mini { position: relative; display: block; width: 100%; max-height: 100%; }
.kv-mini i { position: absolute; display: block; border-radius: 2px;
    background-image: linear-gradient(160deg, #f6c38b 0%, #e98a6b 34%, #a3557a 62%, #3c3561 100%);
    box-shadow: 2px 6px 12px rgba(0,0,0,.28), inset -2px -2px 0 rgba(0,0,0,.12); }
.kv-mini i.kv-mini-c0 { background-image: linear-gradient(150deg, #f6c38b, #c9707a); }
.kv-mini i.kv-mini-c1 { background-image: linear-gradient(150deg, #8fc7c4, #3d6f8c); }
.kv-mini i.kv-mini-c2 { background-image: linear-gradient(150deg, #e7d6a8, #a08155); }
.kv-mini i.kv-mini-c3 { background-image: linear-gradient(150deg, #c6b3e0, #6b5a9c); }

/* =========================== LİSTE =========================== */
.kv-hero { background: linear-gradient(120deg, var(--hero-from), var(--hero-to)); color: var(--hero-ink); padding: 44px 0; }
.kv-hero-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.kv-hero h1 { color: inherit; margin: 0 0 8px; }
.kv-hero p { margin: 0; opacity: .85; max-width: 640px; }
.kv-hero .kv-hero-note { margin-top: 10px; display: flex; gap: 6px; align-items: center; font-size: 14px; }
.kv-hero-note svg { width: 16px; height: 16px; }
.kv-hero-cta svg { width: 18px; height: 18px; }

.kv-wrap { padding: 28px 20px 60px; }
.kv-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.kv-tabs button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 18px;
    font-size: 14px; cursor: pointer; color: var(--ink-soft); }
.kv-tabs button.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.kv-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
    display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.kv-card[hidden] { display: none !important; }
.kv-card-visual { position: relative; display: flex; align-items: center; justify-content: center; height: 230px;
    background: linear-gradient(180deg, #f1ede8, #e4ddd4); padding: 26px; }
.kv-card-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kv-card-visual .kv-mini { width: auto; height: 100%; max-width: 100%; }
.kv-badge { position: absolute; left: 12px; top: 12px; background: rgba(255,255,255,.92); color: var(--ink);
    font-size: 12px; font-weight: 600; border-radius: 99px; padding: 3px 10px; }
.kv-card-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.kv-card-body h2 { font-size: 18px; margin: 0; }
.kv-card-body p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.kv-prices { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv-prices th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 0;
    border-bottom: 1px solid var(--border); }
.kv-prices td { padding: 7px 0; border-bottom: 1px dashed var(--border-soft); }
.kv-prices td:last-child { text-align: right; }
.kv-row-link { font-size: 13px; color: var(--accent-dark); display: inline-flex; align-items: center; gap: 2px; }
.kv-row-link svg { width: 14px; height: 14px; }
.kv-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 6px; }
.kv-from { font-size: 18px; font-weight: 700; }
.kv-from small { font-size: 12px; font-weight: 400; color: var(--muted); }
.kv-info { margin-top: 40px; }

/* =========================== TASARIM =========================== */
.kv-design-wrap { padding: 24px 20px 60px; }
.kv-design { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.kv-stage-col { position: sticky; top: calc(var(--header-h) + 70px); min-width: 0; }

.kv-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 300px;
    padding: 24px 24px 34px; border-radius: var(--radius); overflow: hidden; touch-action: none;
    background: radial-gradient(ellipse at 50% 30%, #f7f3ee 0%, #e9e2d8 70%, #ddd3c6 100%); }
.kv-stage::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 18px;
    background: linear-gradient(180deg, #cfc4b5, #bfb3a2); }
.kv-art { position: relative; z-index: 1; }
.kv-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; color: var(--ink-soft); font-size: 14px; text-align: center; padding: 20px; pointer-events: none; z-index: 2; }
.kv-empty[hidden] { display: none !important; }
.kv-empty svg { width: 34px; height: 34px; opacity: .6; }

.kv-base { position: absolute; left: 0; top: 0; background: #fff; box-shadow: 6px 14px 26px rgba(0,0,0,.32); }
.kv-pn { position: absolute; overflow: hidden; background: #e7e2db; cursor: grab;
    box-shadow: 5px 12px 22px rgba(0,0,0,.33); z-index: 2; }
.kv-pn.is-joined { box-shadow: none; }
.kv-pn:active { cursor: grabbing; }
.kv-pn img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.kv-pn.is-active { outline: 3px solid var(--accent); outline-offset: -3px; }
.kv-pn.is-empty { display: flex; align-items: center; justify-content: center;
    background: repeating-linear-gradient(45deg, #efeae3, #efeae3 8px, #e6e0d7 8px, #e6e0d7 16px); }
.kv-pn-add { font-size: 12px; color: var(--ink-soft); background: rgba(255,255,255,.85); border-radius: 99px; padding: 3px 9px; }

/* Yan yüzler (derinlik) */
.kv-side { position: absolute; overflow: hidden; z-index: 1; }
.kv-side img { position: absolute; max-width: none; filter: brightness(.68); pointer-events: none; }
.kv-side-r { transform: skewY(45deg); transform-origin: left top; }
.kv-side-b { transform: skewX(45deg); transform-origin: left top; }
.kv-side.kv-edge-wrap  { background: #6b6259; }
.kv-side.kv-edge-white { background: #e9e6e1; }
.kv-side.kv-edge-black { background: #1b1b1b; }
.kv-side-b.kv-edge-white { background: #d9d5ce; }

.kv-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.kv-zoom { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 220px; }
.kv-zoom label { font-size: 13px; color: var(--ink-soft); margin: 0; }
.kv-zoom input { flex: 1; accent-color: var(--accent); }
.kv-zoom button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
    font-size: 16px; cursor: pointer; }
.kv-tools .btn svg { width: 15px; height: 15px; }
.kv-tip { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.kv-warn { margin-top: 10px; background: #fff8e6; border: 1px solid var(--warning); color: #8a5c0c; border-radius: var(--radius-sm);
    padding: 10px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.kv-warn[hidden] { display: none !important; }

.kv-panel-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.kv-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.kv-step h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kv-step h2 > span { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
    display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.kv-step h2 small { font-weight: 400; color: var(--muted); font-size: 13px; }

.kv-shapes { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 330px; overflow-y: auto; padding: 2px; }
.kv-shape { cursor: pointer; position: relative; }
.kv-shape input, .kv-chip input { position: absolute; opacity: 0; pointer-events: none; }
.kv-shape > span { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; height: 100%;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px 6px; }
.kv-shape .kv-mini-sm { width: 70%; max-width: 74px; margin: 2px auto 4px; }
.kv-shape b { font-size: 12.5px; line-height: 1.25; }
.kv-shape small { font-size: 11.5px; color: var(--muted); }
.kv-shape input:checked + span, .kv-chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.kv-shape input:focus-visible + span, .kv-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.kv-sizes, .kv-edges { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.kv-chip { cursor: pointer; position: relative; display: block; }
.kv-chip > span { display: flex; flex-direction: column; gap: 2px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px 10px; font-size: 13px; height: 100%; }
.kv-chip b { font-size: 14px; }
.kv-chip em { font-style: normal; color: var(--ink-soft); font-size: 12.5px; }
.kv-edges { grid-template-columns: 1fr; }
.kv-edges .kv-chip > span { flex-direction: row; align-items: center; gap: 10px; }
.kv-edge-sw { width: 26px; height: 18px; border-radius: 3px; flex: 0 0 auto; border: 1px solid rgba(0,0,0,.15); }
.kv-edge-sw.kv-edge-wrap { background: linear-gradient(90deg, #e98a6b 70%, #8b5a4a 70%); }
.kv-edge-sw.kv-edge-white { background: linear-gradient(90deg, #e98a6b 70%, #fff 70%); }
.kv-edge-sw.kv-edge-black { background: linear-gradient(90deg, #e98a6b 70%, #111 70%); }

.kv-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px dashed var(--border);
    border-radius: var(--radius-sm); padding: 18px; text-align: center; cursor: pointer; background: var(--cream); font-size: 14px; }
.kv-drop:hover, .kv-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.kv-drop svg { width: 28px; height: 28px; color: var(--accent); }
.kv-drop small { color: var(--muted); font-size: 12px; }
.kv-progress { height: 6px; background: var(--border-soft); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.kv-progress[hidden] { display: none !important; }
.kv-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.kv-tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; margin-top: 10px; }
.kv-tray:empty { display: none; }
.kv-thumb { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; border: 2px solid transparent; }
.kv-thumb.is-used { border-color: var(--accent); }
.kv-thumb-pick { display: block; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; background: var(--border-soft); }
.kv-thumb-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kv-thumb-del { position: absolute; right: 2px; top: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0;
    background: rgba(0,0,0,.65); color: #fff; font-size: 11px; cursor: pointer; }
.kv-thumb-n { position: absolute; left: 2px; bottom: 2px; background: var(--accent); color: #fff; font-size: 11px;
    border-radius: 4px; padding: 0 5px; }
.kv-tray-hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.kv-tray-hint[hidden] { display: none !important; }

.kv-buy { box-shadow: var(--shadow); }
.kv-buy-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.kv-qty { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.kv-qty button { width: 36px; border: 0; background: var(--cream); font-size: 18px; cursor: pointer; }
.kv-qty input { width: 50px; border: 0 !important; border-radius: 0 !important; text-align: center; padding: 8px 2px;
    -moz-appearance: textfield; appearance: textfield; }
.kv-qty input::-webkit-outer-spin-button, .kv-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.kv-price { text-align: right; display: flex; flex-direction: column; min-width: 0; }
.kv-price small { font-size: 12px; color: var(--muted); }
.kv-price strong { font-size: 26px; }
.kv-buy .btn svg { width: 18px; height: 18px; }
.kv-note { display: flex; gap: 6px; font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.kv-note svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 1px; }

@media (max-width: 991px) {
    .kv-design { grid-template-columns: 1fr; }
    .kv-stage-col { position: static; }
}

@media (max-width: 640px) {
    .kv-hero { padding: 30px 0; }
    .kv-hero-cta { width: 100%; justify-content: center; }
    .kv-wrap, .kv-design-wrap { padding: 18px 16px 48px; }
    .kv-grid { grid-template-columns: 1fr; }
    .kv-card-visual { height: 200px; }
    .kv-stage { padding: 16px 16px 28px; min-height: 240px; }
    .kv-shapes { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 300px; }
    .kv-sizes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* boş önizlemede genel mesaj görünürken parça etiketlerini gizle (üst üste binmesin) */
.kv-stage:has(.kv-empty:not([hidden])) .kv-pn-add { visibility: hidden; }
