/* ========================= */
/* RESET */
/* ========================= */

*{
margin:0;
padding:0;
box-sizing:border-box;
}

body{

font-family:'Inter',sans-serif;

background:#f5f8fd;

color:#111827;

overflow-x:hidden;

}

html, body {
    touch-action: manipulation;
}

/* ========================= */
/* APP */
/* ========================= */

.app{

min-height:100vh;

}

/* ========================= */
/* HEADER */
/* ========================= */

.header{

height:82px;

padding:0 22px;

display:flex;

align-items:center;

justify-content:space-between;

background:#fff;

border-bottom:1px solid #edf2f7;

position:sticky;

top:0;

z-index:100;

}

.left,
.right{

display:flex;

align-items:center;

gap:14px;

}

.logo{

font-size:34px;

font-weight:700;

}

.logo span{

color:#3b82f6;

}

.icon-btn{

width:48px;

height:48px;

border:none;

border-radius:16px;

background:#f4f8fd;

cursor:pointer;

font-size:18px;

position:relative;

}

.cart-count{

position:absolute;

top:-4px;
right:-4px;

width:20px;
height:20px;

background:#3b82f6;

border-radius:50%;

font-size:11px;

display:flex;

align-items:center;

justify-content:center;

color:#fff;

}

/* ========================= */
/* LAYOUT */
/* ========================= */

.layout{

display:grid;

grid-template-columns:
110px 1fr 320px;

gap:24px;

padding:15px;

}

/* ========================= */
/* TOOLS */
/* ========================= */

.tools{

display:flex;

flex-direction:column;

gap:5px;

}

.tool{

height:86px;

border:none;

border-radius:24px;

background:#fff;

border:1px solid #edf2f7;

display:flex;

flex-direction:column;

align-items:center;

justify-content:center;

gap:8px;

cursor:pointer;

font-size:12px;

transition:.2s;

}

.tool:hover{

transform:translateY(-2px);

}

.tool i{

font-size:20px;

color:#3b82f6;

}

/* ========================= */
/* CREATOR */
/* ========================= */

.creator{

display:flex;

flex-direction:column;

gap:10px;

}

.product-switch{

display:flex;

gap:10px;

overflow:auto;

}

.surface{

height:48px;

padding:0 18px;

border:none;

border-radius:14px;

background:#fff;

border:1px solid #edf2f7;

cursor:pointer;

font-weight:600;

white-space:nowrap;

}

.surface.active{

background:#3b82f6;

color:#fff;

}

.canvas-wrap{

background:#f8fbff;

border-radius:36px;

padding:30px;

display:flex;

justify-content:center;

align-items:center;

min-height:720px;

overflow:hidden;

}

#editorCanvas{

background:linear-gradient(104deg, #b0e4ff, transparent);

border-radius:26px;

box-shadow:
0 8px 30px rgba(0,0,0,.04);

}

/* ========================= */
/* CONTROLS */
/* ========================= */

.editor-canvas-wrap {
    touch-action: pan-y !important;
}

.editor-controls{
    width:100%;
    background:#fff;
    border:1px solid #eaf0f7;
    border-radius:28px;
    padding:16px;
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    align-items:center;
    box-shadow:0 12px 30px rgba(15,23,42,.04);
}

.editor-controls button,
.editor-controls select,
.editor-controls input[type="color"]{
    height:48px;
    border:none;
    border-radius:16px;
    background:#f6f9fd;
    color:#0f172a;
    font-size:14px;
    font-weight:600;
    padding:0 16px;
    outline:none;
}

.editor-controls button{
    min-width:35px;
    cursor:pointer;
    transition:.2s;
}

.editor-controls button:hover,
.editor-controls select:hover{
    background:#eef4ff;
    color:#2563eb;
}

.editor-controls select{
    min-width:145px;
    cursor:pointer;
}

.editor-controls input[type="color"]{
    width:52px;
    padding:6px;
    cursor:pointer;
}

.editor-controls input[type="range"]{
    width:170px;
    accent-color:#2563eb;
}

#moveUp,
#moveDown,
#moveLeft,
#moveRight{
    width:48px;
    padding:0;
    font-size:18px;
}

#duplicateBtn{
    min-width:78px;
}

#boldBtn,
#italicBtn{
    width:35px;
    padding:0;
    font-size:16px;
}

@media(max-width:768px){
    .editor-controls{
        border-radius:24px;
        padding:8px;
        gap:5px;
        overflow-x:auto;
    }

    .editor-controls::-webkit-scrollbar{
        display:none;
    }

    .editor-controls input[type="range"]{
        min-width:130px;
    }

    .editor-controls select{
        min-width:100px;
    }

    .editor-controls button{
        flex-shrink:0;
    }
}

/* ========================= */
/* SIDE PANEL */
/* ========================= */

.panel{

background:#fff;

padding:24px;

border-radius:30px;

height:fit-content;

border:1px solid #edf2f7;

}

.product-card h2{

font-size:30px;

margin-bottom:8px;

}

.product-card p{

color:#64748b;

margin-bottom:30px;

}

.price-box{

display:flex;

flex-direction:column;

gap:18px;

margin-bottom:30px;

}

.total{

font-size:28px;

font-weight:700;

}

.buy-btn{

width:100%;

height:56px;

border:none;

border-radius:18px;

background:#3b82f6;

color:#fff;

font-size:16px;

cursor:pointer;

margin-bottom: 85px;

}

.sebet-btn{

    width: 100%;
    height: 56px;
    border: none;
    border-radius: 18px;
    background: #ffffff;
    color: #3b82f6;
    font-size: 16px;
    cursor: pointer;
    border: 1px solid #3b82f6;
    font-weight: 700;
    font-family: monospace;
    margin-bottom: 15px;

}

/* ========================= */
/* MODALS */
/* ========================= */

.elements-modal,
.preview-modal{

position:fixed;

inset:0;

background:rgba(0,0,0,.45);

display:none;

align-items:flex-end;

justify-content:center;

z-index:999;

}

.preview-modal{

align-items:center;

}

.elements-grid{

width:100%;

max-width:700px;

background:#fff;

padding:28px;

border-radius:30px 30px 0 0;

display:grid;

grid-template-columns:
repeat(4,1fr);

gap:16px;

}

.el{

height:82px;

background:#f5f8fd;

border-radius:20px;

display:flex;

align-items:center;

justify-content:center;

font-size:34px;

cursor:pointer;

}

.preview-box{

width:92%;

max-width:700px;

background:linear-gradient(104deg, #b0e4ff, #ffffff);

border-radius:30px;

padding:30px;

position:relative;

}

#closePreview{

position:absolute;

top:20px;
right:20px;

border:none;

background:none;

font-size:24px;

cursor:pointer;

}

.shirt-3d{

display:flex;

justify-content:center;

align-items:center;

min-height:500px;

}

.shirt-3d img{

width:320px;

transition:.4s;

}

/* ========================= */
/* MOBILE */
/* ========================= */

@media(max-width:991px){

.layout{

grid-template-columns:1fr;

padding:16px;

}

.tools{

position:fixed;

bottom:0;

left:0;

width:100%;

background:#fff;

padding:14px;

display:grid;

grid-template-columns:
repeat(5,1fr);

z-index:999;

border-top:1px solid #edf2f7;

}

.tool{

height:74px;

border-radius:18px;

}

.panel{

order:3;

}

.canvas-wrap{

min-height:520px;

padding:18px;

}

#editorCanvas{

max-width:100%;

}

.editor-controls{

/*margin-bottom:90px;*/

}

}

.color-selector{

    margin: 0;
    margin-top: -15px;
    margin-bottom: 10px;

}

.color-selector h4{

    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 600;

}

.colors{

display:flex;

gap:12px;

flex-wrap:wrap;

margin-right: 5px;

}

.color-selector .colors {
    margin-bottom: 10px !important;
}

.color{

width:45px;
height:45px;

border-radius:50%;

cursor:pointer;

border:3px solid transparent;

transition:.2s;

box-shadow:
0 0 0 1px #dbe3ee;

}

.color:hover{

transform:scale(1.08);

}

.color.active{

border-color:#3b82f6;

box-shadow:
0 0 0 4px rgba(59,130,246,.15);

}

.header-new-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.surface-tabs{
    display:flex;
    gap:12px;
    margin-bottom:20px;
}

.surface-tab{

    width:85px;

    background:#fff;

    border:1px solid #e5e7eb;

    border-radius:16px;

    padding:8px;

    cursor:pointer;

    transition:.25s;

    text-align:center;
}

.surface-tab img{

    width:40px;
    height:40px;

    object-fit:contain;

    margin-bottom:6px;
}

.surface-tab span{

    display:block;

    font-size:13px;
    font-weight:600;
}

.surface-tab.active{
    background:#d0dfff;
    color:#01938f;
    border-color:#7ea6ff;
}

.canvas-wrap,
.canvas-container,
.upper-canvas,
.lower-canvas{
    touch-action:pan-y;
}

.upper-canvas {
    touch-action: none !important;
}

#topControls{

    max-height:300px;

    overflow:hidden;

    transition:.35s ease;

}

#topControls.collapsed{

    max-height:0;

    margin:0;

    opacity:0;

}

.top-controls{
    transition:.3s ease;
}

.top-controls.collapsed .surface-tabs,
.top-controls.collapsed .color-selector{
    display:none;
}

.top-toggle-btn{
    width:100%;
    height:34px;
    border:none;
    background:#f4f8ff;
    border-radius:0 0 18px 18px;
    color:#3b82f6;
    font-size:16px;
    cursor:pointer;
    margin-top: -15px;
}

.hidden {
    display: none !important;
}

.case-model-box{
    background:#fff;
    border:1px solid #eaf0f7;
    border-radius:22px;
    padding:16px;
    margin-bottom:16px;
}

.case-model-box label{
    display:block;
    font-size:15px;
    font-weight:700;
    margin-bottom:10px;
    color:#111827;
}

#phoneModel{
    width:100%;
    height:54px;
    border:none;
    outline:none;
    border-radius:16px;
    background:#f6f9fd;
    padding:0 18px;
    font-size:15px;
    font-weight:700;
    color:#111827;
    cursor:pointer;
    appearance:none;
    background-image:
        linear-gradient(45deg, transparent 50%, #3b82f6 50%),
        linear-gradient(135deg, #3b82f6 50%, transparent 50%);
    background-position:
        calc(100% - 22px) 23px,
        calc(100% - 16px) 23px;
    background-size:6px 6px;
    background-repeat:no-repeat;
}

#phoneModel:focus{
    box-shadow:0 0 0 4px rgba(59,130,246,.14);
}

@media(max-width:768px){
    .case-model-box{
        padding:14px;
        border-radius:20px;
        margin-bottom:12px;
    }

    #phoneModel{
        height:58px;
        font-size:16px;
        border-radius:18px;
    }
}

.upload-preview-modal{
    position:fixed;
    inset:0;
    background:rgba(15,23,42,.65);
    backdrop-filter:blur(8px);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:999999;
    padding:18px;
}

.upload-preview-box{
    width:100%;
    max-width:460px;
    background:#fff;
    border-radius:30px;
    padding:22px;
    text-align:center;
}

.upload-preview-box h2{
    font-size:26px;
    margin-bottom:8px;
}

.upload-preview-box p{
    color:#64748b;
    line-height:1.6;
    margin-bottom:16px;
}

.upload-preview-img{
    background:#f8fbff;
    border:1px dashed #cbd5e1;
    border-radius:22px;
    padding:12px;
    margin-bottom:16px;
}

.upload-preview-img img{
    width:100%;
    max-height:300px;
    object-fit:contain;
    border-radius:16px;
}

.upload-preview-actions{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.upload-preview-actions button{
    height:52px;
    border:none;
    border-radius:17px;
    font-weight:900;
    cursor:pointer;
}

#removeBgPreviewBtn{
    background:#eef4ff;
    color:#2563eb;
    font-family: 'Inter',sans-serif;
}

#confirmUploadImage{
    background:#3b82f6;
    color:#fff;
    font-family: 'Inter',sans-serif;
}

#cancelUploadImage{
    background:#f1f5f9;
    color:#334155;
    font-family: 'Inter',sans-serif;
}