.designer-page{
    min-height:calc(100vh - 135px);
    padding:24px;
    background:
        radial-gradient(circle at top right, rgba(255,0,170,.18), transparent 34%),
        radial-gradient(circle at bottom left, rgba(0,191,255,.16), transparent 34%),
        #0f1117;
    color:white;
}

.designer-shell{
    max-width:1500px;
    margin:0 auto;
    display:grid;
    grid-template-columns:260px 1fr 280px;
    gap:22px;
    align-items:start;
}

/* LEVA TRAKA */

.left-tools{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.tool-card{
    display:grid;
    grid-template-columns:72px 1fr;
    gap:15px;
    align-items:center;
    cursor:pointer;
    padding:10px;
    border-radius:18px;
    background:linear-gradient(145deg,#171b24,#111827);
    border:1px solid #252b36;
    transition:.25s;
}

.tool-card:hover{
    transform:translateY(-3px);
    border-color:#00bfff;
    box-shadow:0 0 22px rgba(0,191,255,.22);
}

.tool-icon{
    width:72px;
    height:72px;
    border-radius:16px;
    background:#0f1117;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:inset 0 0 0 1px #252b36, 0 0 18px rgba(0,0,0,.35);
    font-size:32px;
    transition:.25s;
}

.tool-card:hover .tool-icon{
    box-shadow:0 0 0 2px #00bfff, 0 0 18px rgba(255,0,170,.35);
}

.tool-label{
    font-weight:bold;
    text-transform:uppercase;
    font-size:14px;
    color:white;
    letter-spacing:.3px;
}

.product-picker,
.size-picker{
    display:none;
    background:#171b24;
    border-radius:16px;
    padding:12px;
    box-shadow:0 0 22px rgba(0,0,0,.35);
    border:1px solid #252b36;
    margin-top:-6px;
}

.product-picker.show,
.size-picker.show{
    display:grid;
    gap:8px;
}

.product-picker{
    grid-template-columns:1fr;
}

.product-picker button,
.size-picker button{
    border:1px solid #252b36;
    border-radius:12px;
    background:#111827;
    color:white;
    font-weight:bold;
    padding:11px;
    cursor:pointer;
    transition:.25s;
}

.product-picker button:hover,
.product-picker button.active,
.size-picker button:hover,
.size-picker button.active{
    background:#00bfff;
    color:white;
    border-color:#00bfff;
    box-shadow:0 0 15px rgba(0,191,255,.35);
}

.size-picker{
    grid-template-columns:repeat(3,1fr);
}

/* SREDINA */

.center-stage{
    background:linear-gradient(145deg,#171b24,#111827);
    min-height:640px;
    border-radius:22px;
    padding:20px 20px 14px;
    box-shadow:0 0 35px rgba(0,0,0,.35);
    border:1px solid #252b36;
    position:relative;
}

.stage-title{
    display:flex;
    justify-content:center;
    gap:12px;
    margin-bottom:14px;
}

.stage-tab{
    width:auto;
    border:0;
    border-radius:14px;
    padding:12px 24px;
    color:white;
    font-weight:bold;
    cursor:pointer;
    background:#00bfff;
    box-shadow:0 0 0 2px #ff00aa, 0 0 18px rgba(255,0,170,.3);
}

.stage-tab.preview{
    background:#ff00aa;
}

.product-preview{
    position:relative;
    width:460px;
    height:550px;
    margin:0 auto;
    border-radius:18px;
}

.template-img{
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
    max-width:430px;
    max-height:520px;
    width:auto;
    height:auto;
    z-index:1;
    filter:drop-shadow(0 18px 35px rgba(0,0,0,.55));
}

.print-area{
    position:absolute;
    top:125px;
    left:120px;
    width:220px;
    height:260px;
    border:1px dashed rgba(0,191,255,.55);
    border-radius:10px;
    z-index:5;
}

.print-area canvas{
    position:absolute !important;
    left:0 !important;
    top:0 !important;
    z-index:10 !important;
    background:transparent !important;
}

canvas{
    border-radius:8px;
    background:transparent !important;
}

.side-selector{
    display:flex;
    justify-content:center;
    gap:12px;
    margin:16px auto 0;
    flex-wrap:wrap;
}

.side-box{
    width:76px;
    border:0;
    background:transparent;
    cursor:pointer;
    color:#bbb;
    font-weight:bold;
    transition:.25s;
}

.side-thumb{
    width:70px;
    height:70px;
    background:#171b24;
    border:1px solid #252b36;
    border-radius:14px;
    box-shadow:0 0 15px rgba(0,0,0,.25);
    display:flex;
    align-items:center;
    justify-content:center;
    margin-bottom:7px;
    overflow:hidden;
    transition:.25s;
}

.side-thumb img{
    max-width:56px;
    max-height:62px;
    object-fit:contain;
}

.side-box:hover .side-thumb,
.side-box.active .side-thumb{
    border:2px solid #00bfff;
    box-shadow:0 0 0 2px #ff00aa, 0 0 18px rgba(0,191,255,.35);
}

.side-box.active{
    color:white;
}

.current-side{
    text-align:center;
    color:#ccc;
    margin:14px 0 0;
}

/* DESNO */

.right-settings{
    display:flex;
    flex-direction:column;
    gap:16px;
}

.price-box,
.setting-box{
    background:linear-gradient(145deg,#171b24,#111827);
    border-radius:18px;
    box-shadow:0 0 25px rgba(0,0,0,.28);
    border:1px solid #252b36;
    padding:15px;
}

.price-row{
    display:flex;
    align-items:center;
    gap:8px;
}

.qty-mini{
    background:#00bfff;
    color:white;
    border-radius:10px;
    padding:9px 12px;
    font-weight:bold;
}

.price-input{
    flex:1;
    background:#0f1117;
    border:1px solid #252b36;
    border-radius:10px;
    padding:9px;
    font-size:22px;
    text-align:right;
    color:#00bfff;
    font-weight:bold;
}

.save-design{
    width:100%;
    margin-top:12px;
    background:#ff00aa;
    color:white;
    border:2px solid #00bfff;
    border-radius:16px;
    padding:18px;
    font-size:23px;
    font-weight:bold;
    cursor:pointer;
    box-shadow:0 0 0 2px #ff00aa, 0 0 22px rgba(255,0,170,.35);
    transition:.25s;
}

.save-design:hover{
    background:#00bfff;
    transform:translateY(-3px);
}

.setting-icon{
    width:72px;
    height:72px;
    margin:auto;
    border:1px solid #252b36;
    border-radius:16px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:36px;
    box-shadow:0 0 18px rgba(0,0,0,.28);
    background:#0f1117;
}

.setting-label{
    text-align:center;
    font-weight:bold;
    font-size:13px;
    margin-top:9px;
    color:white;
    text-transform:uppercase;
}

.color-picker-wrap{
    display:flex;
    justify-content:center;
    margin-top:8px;
}

.selected-color{
    width:60px;
    height:60px;
    border-radius:50%;
    background:#000;
    border:3px solid #00bfff;
    cursor:pointer;
    transition:.3s;
    box-shadow:0 0 0 2px #ff00aa, 0 0 18px rgba(0,191,255,.25);
}

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

/* KONTROLE */

.hidden-file{
    display:none;
}

.quick-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin-top:12px;
}

.quick-actions button{
    border:0;
    border-radius:12px;
    background:#00bfff;
    color:white;
    font-weight:bold;
    padding:11px;
    cursor:pointer;
    transition:.25s;
}

.quick-actions button:hover{
    background:#ff00aa;
    transform:translateY(-2px);
}

.layers-box{
    background:linear-gradient(145deg,#171b24,#111827);
    border-radius:18px;
    padding:15px;
    box-shadow:0 0 18px rgba(0,0,0,.25);
    border:1px solid #252b36;
    font-weight:bold;
    color:white;
}

/* MOBILE */

@media(max-width:1000px){
    .designer-shell{
        grid-template-columns:1fr;
    }

    .left-tools{
        max-width:700px;
        width:100%;
        margin:0 auto;
    }

    .right-settings{
        max-width:700px;
        width:100%;
        margin:0 auto;
    }
}

@media(max-width:768px){

    .designer-page{
        padding:12px;
    }

    .designer-shell{
        gap:14px;
    }

    .tool-card{
        grid-template-columns:58px 1fr;
        padding:8px;
    }

    .tool-icon{
        width:58px;
        height:58px;
        font-size:26px;
        border-radius:14px;
    }

    .center-stage{
        padding:12px;
        min-height:auto;
        border-radius:18px;
    }

    .product-preview{
        width:100%;
        max-width:360px;
        height:460px;
    }

    .template-img{
        max-width:340px;
        max-height:430px;
    }

    .print-area{
        top:115px;
        left:50%;
        transform:translateX(-50%);
        width:160px;
        height:190px;
    }

    .print-area canvas{
        width:160px !important;
        height:190px !important;
    }

    .stage-title{
        display:none;
    }

    .side-box{
        width:64px;
        font-size:12px;
    }

    .side-thumb{
        width:58px;
        height:58px;
    }
}

/* TEXT SETTINGS PANEL */

.text-settings-panel{
    display:none;
    background:linear-gradient(145deg,#171b24,#111827);
    border:1px solid #252b36;
    border-radius:18px;
    box-shadow:0 0 25px rgba(0,0,0,.35);
    padding:16px;
}

.text-settings-panel.show{
    display:block;
}

.text-settings-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:12px;
}

.text-settings-head h3{
    margin:0;
    font-size:20px;
    color:white;
}

.close-text-settings{
    border:0;
    background:transparent;
    color:white;
    font-size:26px;
    cursor:pointer;
    width:auto;
    padding:0;
}

.text-settings-panel label{
    display:block;
    font-size:13px;
    font-weight:bold;
    margin:12px 0 6px;
    color:#ccc;
}

#textInput,
#fontFamily{
    width:100%;
    background:#0f1117;
    color:white;
    border:1px solid #252b36;
    border-radius:10px;
    padding:10px;
    box-sizing:border-box;
}

#textInput{
    min-height:72px;
    resize:vertical;
}

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

.text-control-btn{
    flex:1;
    min-width:42px;
    border:1px solid #252b36;
    border-radius:10px;
    background:#0f1117;
    color:white;
    font-weight:bold;
    padding:10px;
    cursor:pointer;
    transition:.25s;
}

.text-control-btn:hover,
.text-control-btn.active{
    background:#00bfff;
    border-color:#00bfff;
    box-shadow:0 0 14px rgba(0,191,255,.3);
}

.range-control{
    width:100%;
    accent-color:#00bfff;
}

.text-color-row{
    display:flex;
    justify-content:center;
    margin-top:8px;
}

.text-color-circle{
    width:54px;
    height:54px;
    border-radius:50%;
    background:#000;
    border:3px solid #00bfff;
    box-shadow:0 0 0 2px #ff00aa,0 0 16px rgba(0,191,255,.35);
    cursor:pointer;
}


.chosen-size{
    margin:8px 0 0;
    color:white;
    font-size:14px;
    text-align:center;
}

.chosen-size b{
    color:#00bfff;
}


#sizePicker.show{
    display:grid !important;
    grid-template-columns:repeat(3,1fr) !important;
    gap:8px !important;
}

.chosen-product{
    margin:8px 0 0;
    color:white;
    font-size:14px;
    text-align:center;
}

.chosen-product b{
    color:#00bfff;
}

.product-modal{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.78);
    z-index:999999999;
    align-items:center;
    justify-content:center;
    padding:20px;
}

.product-modal.show{
    display:flex;
}

.product-modal-box{
    width:min(1050px, 96vw);
    max-height:88vh;
    overflow:auto;
    background:#171b24;
    border:1px solid #252b36;
    border-radius:22px;
    box-shadow:0 0 40px rgba(0,191,255,.22);
    padding:20px;
}

.product-modal-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:15px;
    margin-bottom:18px;
}

.product-modal-head h2{
    margin:0;
    color:white;
}

.product-modal-head button{
    width:46px;
    height:46px;
    border-radius:50%;
    border:0;
    background:#ff00aa;
    color:white;
    font-size:30px;
    cursor:pointer;
    line-height:1;
}

.product-modal-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(180px, 1fr));
    gap:16px;
}

.product-modal-item{
    background:#111827;
    border:1px solid #252b36;
    border-radius:16px;
    padding:12px;
    color:white;
    cursor:pointer;
    transition:.25s;
    text-align:center;
}

.product-modal-item:hover{
    transform:translateY(-4px);
    border-color:#00bfff;
    box-shadow:0 0 18px rgba(0,191,255,.28);
}

.product-modal-item img{
    width:100%;
    height:140px;
    object-fit:contain;
    display:block;
    margin-bottom:10px;
}

.product-modal-item span{
    display:block;
    font-weight:bold;
    font-size:14px;
}

.no-modal-img{
    height:140px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#777;
    background:#0f1117;
    border-radius:12px;
    margin-bottom:10px;
}

@media(max-width:768px){
    .product-modal-box{
        padding:14px;
    }

    .product-modal-grid{
        grid-template-columns:repeat(2, 1fr);
        gap:10px;
    }

    .product-modal-item img,
    .no-modal-img{
        height:110px;
    }
}


.product-color-picker{
    display:none;
    grid-template-columns:repeat(5, 1fr);
    gap:9px;
    background:#171b24;
    border-radius:16px;
    padding:12px;
    box-shadow:0 0 22px rgba(0,0,0,.35);
    border:1px solid #252b36;
    margin-top:-6px;
}

.product-color-picker.show{
    display:grid !important;
}

.product-color-picker button{
    height:38px;
    border-radius:50%;
    border:3px solid #252b36;
    cursor:pointer;
    transition:.25s;
}

.product-color-picker button:hover,
.product-color-picker button.active{
    border-color:#00bfff;
    box-shadow:0 0 0 2px #ff00aa, 0 0 14px rgba(0,191,255,.35);
    transform:scale(1.08);
}

.color-tool-icon{
    background:#111827 !important;
    border:3px solid #00bfff !important;
}

.chosen-color,
.chosen-product,
.chosen-size{
    margin:8px 0 0;
    color:white;
    font-size:14px;
    text-align:center;
}

.chosen-color b,
.chosen-product b,
.chosen-size b{
    color:#00bfff;
}


.tool-card.selected{
    border-color:#00bfff !important;
    box-shadow:0 0 22px rgba(0,191,255,.25), 0 0 18px rgba(255,0,170,.18) !important;
}

.tool-card.selected .tool-label{
    color:#00bfff !important;
}

#chosenProductColorIcon{
    background:#111827;
}

#chosenProductColorIcon.color-selected{
    box-shadow:0 0 0 2px #ff00aa, 0 0 18px rgba(0,191,255,.35) !important;
}


#chosenProductColorIcon.color-selected{
    border:0 !important;
}

#chosenProductColorIcon.color-selected[style*="255, 255, 255"],
#chosenProductColorIcon.color-selected[style*="#ffffff"]{
    border:3px solid #00bfff !important;
}


#chosenProductColorIcon{
    background:#111827 !important;
}

#chosenProductColorIcon.color-selected{
    background:var(--selected-product-color) !important;
    background-color:var(--selected-product-color) !important;
}

#chosenProductColorIcon.color-selected.white-color{
    border:3px solid #00bfff !important;
}

#chosenProductColorIcon.color-selected:not(.white-color){
    border:0 !important;
}

/* PrintMania fix: kvadrat izabrane boje u dizajneru */
#chosenProductColorIcon{
    background:#111827 !important;
}

#chosenProductColorIcon.color-selected{
    background:var(--selected-product-color) !important;
    background-color:var(--selected-product-color) !important;
}

#chosenProductColorIcon.color-selected.white-color{
    border:3px solid #00bfff !important;
}

#chosenProductColorIcon.color-selected:not(.white-color){
    border:0 !important;
}
