/* WALLANCE Design Studio */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --ds-bg: #F0F0F0;
    --ds-white: #FFFFFF;
    --ds-black: #111111;
    --ds-gray-100: #F5F5F5;
    --ds-gray-200: #E8E8E8;
    --ds-gray-300: #D4D4D4;
    --ds-gray-400: #999999;
    --ds-gray-500: #666666;
    --ds-radius: 12px;
    --ds-radius-sm: 8px;
    --ds-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

*, *::before, *::after { box-sizing: border-box; }

body.design-studio-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--ds-bg);
    color: var(--ds-black);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body.design-studio-page .preloader { display: none !important; }

/* Header */
.ds-header {
    background: var(--ds-white);
    border-bottom: 1px solid var(--ds-gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.ds-header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ds-logo {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--ds-black);
    text-decoration: none;
}

.ds-logo img {
    height: 32px;
    width: auto;
}

.ds-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ds-nav a {
    text-decoration: none;
    color: var(--ds-black);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: background 0.2s;
}

.ds-nav a:hover { background: var(--ds-gray-100); }
.ds-nav a.active { background: var(--ds-gray-200); }

.ds-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ds-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: var(--ds-black);
    text-decoration: none;
    transition: background 0.2s;
}

.ds-icon-btn:hover { background: var(--ds-gray-100); }
.ds-icon-btn svg { width: 20px; height: 20px; }

.ds-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--ds-black);
    color: var(--ds-white);
    font-size: 10px;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Layout */
.ds-main {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 32px 0;
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    gap: 20px;
    min-height: calc(100vh - 64px - 180px);
}

/* Panels */
.ds-panel {
    background: var(--ds-white);
    border-radius: var(--ds-radius);
    padding: 20px;
    box-shadow: var(--ds-shadow);
}

.ds-panel-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ds-gray-500);
    margin: 0 0 16px;
}

.ds-panel + .ds-panel { margin-top: 16px; }

/* Product Selection */
.ds-product-select {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--ds-gray-100);
    border-radius: var(--ds-radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.ds-product-select:hover { border-color: var(--ds-gray-300); }

.ds-product-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--ds-radius-sm);
    object-fit: cover;
    background: var(--ds-gray-200);
}

.ds-product-info h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.ds-product-info p {
    margin: 2px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-black);
}

.ds-product-list {
    display: none;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--ds-gray-200);
    border-radius: var(--ds-radius-sm);
}

.ds-product-list.open { display: block; }

.ds-product-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.ds-product-option:hover { background: var(--ds-gray-100); }
.ds-product-option img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; }
.ds-product-option span { font-size: 13px; font-weight: 500; }

/* Color Swatches */
.ds-color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.ds-color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
    outline: none;
    padding: 0;
}

.ds-color-swatch:hover { transform: scale(1.08); }

.ds-color-swatch.active {
    box-shadow: 0 0 0 2px var(--ds-white), 0 0 0 4px var(--ds-black);
}

.ds-color-swatch.active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ds-white);
    font-size: 14px;
    font-weight: 700;
    text-shadow: 0 0 3px rgba(0,0,0,0.5);
}

.ds-color-swatch.light.active::after { color: var(--ds-black); text-shadow: none; }

.ds-color-swatch.rainbow {
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
}

/* Brush Settings */
.ds-slider-group { margin-bottom: 20px; }

.ds-slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.ds-slider-label span:last-child { color: var(--ds-gray-500); }

.ds-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--ds-gray-200);
    outline: none;
}

.ds-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ds-black);
    cursor: pointer;
    border: 2px solid var(--ds-white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.ds-brush-types {
    display: flex;
    gap: 8px;
}

.ds-brush-btn {
    flex: 1;
    height: 44px;
    border: 1px solid var(--ds-gray-200);
    border-radius: var(--ds-radius-sm);
    background: var(--ds-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ds-brush-btn:hover { border-color: var(--ds-gray-400); }

.ds-brush-btn.active {
    background: var(--ds-black);
    border-color: var(--ds-black);
    color: var(--ds-white);
}

.ds-brush-btn svg { width: 20px; height: 20px; }

/* Center Workspace */
.ds-workspace {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ds-view-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.ds-view-tab {
    padding: 8px 24px;
    border: 1px solid var(--ds-gray-200);
    border-radius: 20px;
    background: var(--ds-white);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.ds-view-tab:hover { border-color: var(--ds-gray-400); }

.ds-view-tab.active {
    background: var(--ds-black);
    color: var(--ds-white);
    border-color: var(--ds-black);
}

.ds-mockup-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 119/168;
    background: var(--ds-white);
    border-radius: var(--ds-radius);
    box-shadow: var(--ds-shadow);
    overflow: hidden;
}

.ds-mockup-controls {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.ds-control-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--ds-gray-200);
    background: var(--ds-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
}

.ds-control-btn:hover { background: var(--ds-gray-100); }

.ds-mockup-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.ds-shirt-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,0.12));
}

.ds-canvas-overlay {
    position: absolute;
    top: 22%;
    left: 28%;
    width: 44%;
    height: 38%;
    cursor: crosshair;
    border-radius: 4px;
}

#designCanvas {
    width: 100%;
    height: 100%;
    touch-action: none;
}

.ds-view-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-gray-500);
    margin-bottom: 16px;
    text-align: center;
}

.ds-view-label span {
    color: var(--ds-black);
}

/* Technical Template Mockup — arka plan her zaman beyaz */
.ds-technical-mockup {
    position: relative;
    width: 100%;
    height: 100%;
    background: #FFFFFF;
}

.ds-template-lineart {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center top;
    pointer-events: none;
    z-index: 1;
}

.ds-canvas-full {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.ds-canvas-full #designCanvas {
    width: 100%;
    height: 100%;
}

/* Template Selector Grid */
.ds-template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
}

.ds-template-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 2px solid var(--ds-gray-200);
    border-radius: var(--ds-radius-sm);
    background: var(--ds-white);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.ds-template-item:hover {
    border-color: var(--ds-gray-400);
}

.ds-template-item.active {
    border-color: var(--ds-black);
    background: var(--ds-gray-100);
}

.ds-template-item img {
    width: 100%;
    height: 72px;
    object-fit: contain;
    object-position: center top;
    background: #fff;
    border-radius: 4px;
}

.ds-template-item span {
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    color: var(--ds-gray-500);
}

.ds-template-item.active span {
    color: var(--ds-black);
}

.ds-template-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center top;
    background: #fff;
}

.ds-angle-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: flex-start;
    flex-wrap: wrap;
    max-width: 420px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.ds-angle-thumb {
    width: 56px;
    height: 72px;
    flex-shrink: 0;
    border-radius: var(--ds-radius-sm);
    border: 2px solid transparent;
    background: var(--ds-white);
    cursor: pointer;
    overflow: hidden;
    padding: 2px;
    transition: border-color 0.15s;
}

.ds-angle-thumb.active { border-color: var(--ds-black); }

/* Right Sidebar */
.ds-tool-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.ds-tool-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--ds-radius-sm);
    transition: background 0.15s;
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    color: var(--ds-gray-500);
}

.ds-tool-action:hover { background: var(--ds-gray-100); color: var(--ds-black); }
.ds-tool-action svg { width: 20px; height: 20px; }

.ds-upload-zone {
    border: 2px dashed var(--ds-gray-300);
    border-radius: var(--ds-radius-sm);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 12px;
}

.ds-upload-zone:hover { border-color: var(--ds-gray-500); background: var(--ds-gray-100); }
.ds-upload-zone.dragover { border-color: var(--ds-black); background: var(--ds-gray-100); }

.ds-upload-zone svg { width: 32px; height: 32px; color: var(--ds-gray-400); margin-bottom: 8px; }

.ds-upload-zone p {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.ds-upload-zone small {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--ds-gray-400);
}

.ds-btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--ds-black);
    color: var(--ds-white);
    border: none;
    border-radius: var(--ds-radius-sm);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
    font-family: inherit;
    text-transform: uppercase;
}

.ds-btn-primary:hover { opacity: 0.85; }

/* Summary */
.ds-summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ds-gray-200);
    margin-bottom: 16px;
}

.ds-summary-item img {
    width: 48px;
    height: 48px;
    border-radius: var(--ds-radius-sm);
    object-fit: cover;
}

.ds-summary-item h4 { margin: 0; font-size: 13px; font-weight: 600; }
.ds-summary-item p { margin: 2px 0 0; font-size: 12px; color: var(--ds-gray-500); }

.ds-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 6px 0;
}

.ds-summary-row .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid var(--ds-gray-300);
}

.ds-checkout {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--ds-gray-200);
}

.ds-total-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--ds-gray-500);
    margin-bottom: 4px;
}

.ds-total-price {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 16px;
}

/* Footer Palette */
.ds-footer-palette {
    max-width: 1440px;
    margin: 24px auto 0;
    padding: 24px 32px 32px;
}

.ds-footer-palette h3 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ds-gray-500);
    margin: 0 0 16px;
}

.ds-palette-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ds-palette-chip {
    flex: 1;
    min-width: 80px;
    height: 48px;
    border-radius: var(--ds-radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s;
    border: 1px solid rgba(0,0,0,0.06);
}

.ds-palette-chip:hover { transform: translateY(-2px); }
.ds-palette-chip span { opacity: 0.7; font-weight: 400; font-size: 9px; }

.ds-disclaimer {
    text-align: center;
    font-size: 11px;
    color: var(--ds-gray-400);
    margin-top: 16px;
    line-height: 1.5;
}

.ds-embed { max-width: 100%; padding: 0; min-height: auto; }
.ds-embed .ds-main { padding: 0; }

#imageUpload { display: none; }
#imageUpload { display: none; }

/* Responsive */
@media (max-width: 1100px) {
    .ds-main {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .ds-sidebar-left, .ds-sidebar-right {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .ds-sidebar-left .ds-panel:last-child,
    .ds-sidebar-right .ds-panel:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .ds-header-inner { padding: 0 16px; }
    .ds-nav { display: none; }
    .ds-sidebar-left, .ds-sidebar-right { grid-template-columns: 1fr; }
    .ds-palette-row { flex-wrap: wrap; }
    .ds-palette-chip { min-width: calc(25% - 8px); flex: none; }
}
