.editor{
    margin: 0;
    padding: 0;
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    font-weight: 400;
    box-sizing: border-box;
    min-height: 90vh;
    height: 100%;
}
.editor *{
    font-family: 'Oswald', sans-serif;
    box-sizing: border-box;
}
.editor::after, .editor::before{
    box-sizing: inherit;
}
.editor p, .editor h1, .editor h2, .editor h3, .editor h4, .editor h5, .editor h6{
    margin: 0;
}

/* Main */
.editor .editorContainer{
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    padding: 0px;
    overflow: hidden;

    padding: 0px;
}

/* Sidebar */
.editor .sidebar{
    display: flex;
    flex-direction: column;
    row-gap: 46px;
    margin-right: 0px;
    position: relative;

    padding-right: 10px;
}
.editor .sidebar::before{
    content: '';
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    background-color: #ffffff99;
    visibility: hidden;
    opacity: 0;
}
.editor .popup.shirtActive ~ .editorContainer .sidebar::before{
    animation: fadeIn 250ms ease-in-out forwards;
}
.editor .popup.popupOut:not(.noAnimation) ~ .editorContainer .sidebar::before{
    animation: fadeOut 250ms ease-in-out forwards;
}
.editor .side__bx{
    display: flex;
    flex-direction: column;
    row-gap: 10px;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    outline: none;
    padding: 0;
    cursor: pointer;

    display: none;
}
.editor .side__bx.active{
    display: flex;
}
.editor .side__iconBx{
    display: flex;
}
.editor .side__icon{
    width: 64px;
}
.editor .side__desc{
    font-size: 16px;
    font-weight: 400;
    line-height: 17px;
}

/* SVG */
.editor .editorCanvas{
    width: 100%;
    height: 100%;
    border: 2px dotted #ab0d09;
}

.editor .editor__shirtSvg{
    transition: height 250ms ease-in-out;
}

/* POPUP */
.editor .popup{
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100dvh;
    background-color: white;
    z-index: 50;
    display: grid;

    opacity: 0;
    visibility: hidden;
    scale: 0.6;
}
.editor .popup__container{
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;

    display: none;
}
.editor .popup.popupActive{
    animation: zoomFadeIn 250ms ease-in-out forwards;
}
.editor .popup.popupOut:not(.noAnimation) {
    animation: zoomFadeOut 250ms ease-in-out forwards;
}
.editor .popup.imageActive .popup__container.popupImage{
    display: flex;
}
.editor .popup.textActive .popup__container.popupText{
    display: flex;
    width: 450px;
    padding: 0 20px;
    justify-content: start;
}
.editor .textActive .popup__title {
    font-size: 26px;
    line-height: 36px;
    font-weight: 600;
    padding: 0 0 0.4em;
}
.editor .popup.shirtActive{
    height: 40%;
    min-height: 400px;
}
.editor .popup.shirtActive ~ .editorContainer .editor__shirtSvg{
    height: 50%;
}
.editor .popup.popupOut ~ .editorContainer .editor__shirtSvg{
    height: 797px;
}
.editor .popup.patternActive .popup__container.popupPattern{
    display: flex;
}
.editor .popup.patternColorActive .popup__container.popupPatternColor{
    display: flex;
}

.editor .popup__title{
    font-size: 42px;
    margin-block: -60px 50px;

    line-height: 50px;
}
.editor .popup__btnBx{
    display: flex;
    flex-direction: row;
    column-gap: 28px;
    align-items: center;
    justify-content: center;
    margin-top: 40px;
    margin-bottom: 10px;
}

.editor .popup__btnBx .btnLeaveContainer{
    display: flex;
    gap: 10px;
    align-items: center;
}

@media only screen and (max-width: 84em) {
    .editor .popup.textActive .popup__container.popupText {
        margin: 0 auto;
    }
    .editor .popup.textActive {
        width: 100% !important;
    }

    .editor .popup.textActive .colorBoxWrap {
        left: unset;
        width: 450px;
        z-index: 1;
    }

    .editor div.textFont div.popup__selFontBx {
        margin: 0 auto;
        right: calc(50% - 225px);
    }
}
@media only screen and (max-width: 500px) {
    .editor .popup.textActive .popup__container.popupText {
        width: 100%;
        max-width: 450px;
    }

    .editor .popup.textActive .popup__selFontBx {
        width: 100%;
        max-width: 500px;
        right: 0;
        gap: 5px;
        z-index: 1;
        padding: 10px 10px 80px;
    }
    .editor .colorBoxWrap .popup__selColorBx, .editor .colorBoxWrap .popup__outlineTextColorBx {
        top: 125px !important;
        left: -154px !important;
    }
    .editor .colorBoxWrap .ownColorBox {
        right: 130px !important;
        width: 105px !important;
    }
    .editor div.popupText div.footer {
        right: calc(50% - 90px);
        width: 325px;
        padding: 15px 0;
    }
    .editor div.popupText div.fontBoxWrap div.footer {
        width: 100%;
        left: 0px;
    }
}
.editor div.popupText button.popupClose,
.editor div.editor__patternColorContainer button.popupClose {
    position: absolute;
    right: 15px;
    top: 15px;
    border: none;
    width: 35px;
    height: 35px;
    background-color: unset;
    cursor: pointer;
    color: #37474f;
}
.editor div.popupText button.popupClose i.fa,
.editor div.editor__patternColorContainer button.popupClose i.fa {
    font-family: FontAwesome;
}
.editor div.footer {
    position: absolute;
    bottom: 0;
    z-index: 1;
    background-color: white;
    right: calc(50% - 225px);
    width: 450px;
    padding: 15px 50px;
    display: flex;
    flex-flow: row;
    justify-content: center;
}
.editor div.footer .popup__btn {
    font-size: 17px;
    text-transform: uppercase;
    padding: 5px 12px;
    margin: 0 10px;
    width: 135px;
}
.editor div.footer .popup__btn.btnGoBack {
    float: left;
    width: 85px;
    padding: 3px 12px;
}
.editor div.footer .popup__btn.btnConfirm {
    float: right;
}

div.editorRow {
    width: 100%;
    height: 35px;
    display: flex;
    margin: 15px 0 0 0;
    justify-content: space-between;
}
div.editorRow .middle {
    vertical-align: middle;
}
div.editorRow div.editorColumn {
    display: flex;
    line-height: 35px;
    align-items: center;
}
div.editorRow div.editorColumn input[type="range"]{
    accent-color: #37474f;
}
div.editorRow h3 {
    font-size: 17px !important;
    margin: 0;
    display: inline;
    padding: 0;
}
div.textColor > span.selectedColor, div.outlineText > div > span.selectedColor {
    width: auto;
    height: 35px;
    aspect-ratio: 1;
    display: inline-block;
    margin: 0 0 0 10px;
    cursor:  pointer;
}
.doubleBorder {
    border:solid 2px white;
    outline: 2px solid black;
}
div.textColor span.popup__selColor, div.outlineText span.popup__outlineTextColor {
    width: auto;
    height: 25px;
    aspect-ratio: 1;
    margin: 2px 0;
}
div.textColor span.popup__selColor[style="background-color: rgb(255, 255, 255);"]:not(.selectedColor),
div.outlineText span.popup__outlineTextColor[style="background-color: rgb(255, 255, 255);"]:not(.selectedColor) {
    border: solid 1px #e4e4e5;
}
div.aligns, div.styles {
    text-align: center;
}
button.textEditorButton.active,
button.textEditorButton.selectedAlign {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    background-color: #e5e5e5 !important;
    color: black !important;
    border: none !important;
}

button.textEditorButton.active img,
button.textEditorButton.selectedAlign img{
    height: 20px;
}

button.textEditorButton {
    display: flex;
    width: auto;
    height: 35px;
    aspect-ratio: 1;
    background-color: white !important;
    color: black !important;
    border: none !important;
    margin: 0 4px;
    padding: 0 !important;
    line-height: calc(1em - 1px);
    justify-content: center;
    align-items: center;
}

button.textEditorButton img{
    height: 20px;
}

div.textColor div.colorBoxWrap, div.outlineText div.colorBoxWrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    background-color: white;
    overflow: auto;
}
div.textColor div.colorBoxWrap div.ownColorBox, div.outlineText div.colorBoxWrap div.ownColorBox {
    position: absolute;
    right: 25px;
    width: 170px;
    height: auto;
    aspect-ratio: 1;
    top: 170px;
}
div.textColor div.colorBoxWrap div.ownColorBox h3.popup__selTitle,
div.outlineText div.colorBoxWrap div.ownColorBox h3.popup__selTitle {
    display: inline-block;
    line-height: 25px;
    text-align: left;
}
div.textColor div.colorBoxWrap div.ownColorBox input.ownColor,
div.outlineText div.colorBoxWrap div.ownColorBox input.ownColor {
    background-color: #ffffff;
    display: block;
    width: 35px;
    height: auto;
    border: none;
    outline: none;
    aspect-ratio: 1;
}
div.textColor div.colorBoxWrap div.ownColorBox input.ownColor:hover,
div.outlineText div.colorBoxWrap div.ownColorBox input.ownColor:hover {
    cursor: pointer;
}
div.textColor div.popup__selColorBx, div.outlineText div.popup__outlineTextColorBx {
    display: grid;
    width: 500px;
    padding: 20px;
    max-width: none;
    max-height: none;
    grid-auto-rows: 25px;
    transform: rotate(90deg);
    position: absolute;
    top: 135px;
    left: -135px;
    gap: 2px 0;
}

div.textFont div.popup__selFontBx {
    background-color: white;
    position: absolute;
    display: grid;
    top: 0;
    width: 450px;
    right: 0;
    height: 100%;
    padding: 20px 20px 80px;
    max-width: none;
    max-height: none !important;
    box-sizing: inherit;
}

div.textFont div.popup__selFontBx .popup__selFont {
    border: solid 1px #d8dadb;
    text-align: center;
    font-size: 22px;
    width: 100%;
    margin: 0 auto;
    border-radius: 3px;
}
div.textFont div.popup__selFontBx .popup__selFont.selectedFont {
    border: solid 2px #ab0d09;
}

div.textFont button.popup__btn {
    background-color: #ab0d09;
    font-size: 17px;
    padding: 0 15px;
    color: white;
    float: right;
}

div.textFont button.popup__btn img{
    margin-top: -5px;
}

.editor .popup__btn.btnConfirm.btnTextConfirm {
    text-transform: uppercase;
}



.editor .popup__btn{
    font-size: 20px;
    padding: 10px 32px;
    border: 2px solid #ab0d09;
    cursor: pointer;
    transition: color 200ms ease-in-out, background-color 200ms ease-in-out;
}
.editor .popup__btn.btnLeave,
.editor .popup__btn.btnGoBack{
    background-color: white;
    color: #ab0d09;
}
.editor .popup__btn.btnLeave:hover,
.editor .popup__btn.btnGoBack:hover{
    background-color: #ab0d09;
    color: white;
}
.editor .popup__btn.btnConfirm{
    background-color: #ab0d09;
    color: white;
}
.editor .popup__btn.btnConfirm:disabled{
    background-color: #6c0b09;
    border-color: #6c0b09;
}
.editor .popup__btn.btnConfirm:not(:disabled):hover{
    background-color: white;
    color: #ab0d09;
}

.popup__btn.btnPatternConfirm{
    opacity: 0;
    visibility: hidden;
}


/* Image Grid */
.editor .popup__imageGrid{
    position: absolute;
    z-index: 1000;
    width: 100%;
    top: 0;
    left: 0;
    padding: 50px;
    background-color: white;
    display: none;
    flex-direction: column;
    align-items: self-start;
    gap: 30px;
    min-height: 100vh;
    overflow: auto;
}
.editor .popup__imageGridActions {
    width: 100%
}
.editor .popup__imageGridActions .popup__imageGridBtn.btnGalleryClose {
    float: right;
    padding: 15px;
    border: none;
    background-color: unset;
    font-weight: bold;
}
.editor .popup__imageGrid.loaderActive .popup__imageGridLoader{
    display: flex;
}
.editor .popup__imageGrid.loaderActive .popup__imageGridContainer{
    display: none;
}

.editor .popup__imageGridContainer{
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    width: 100%;
    gap: 16px 18px;
    height: 100%;

    overflow-x: hidden;
    overflow-y: auto;
}
.editor .popup__imageGridBx{
    display: flex;
    width: 100%;
    height: 100%;
    max-width: 110px;

    background-color: transparent;
    border: none;
    outline: none;
    padding: 0;
}
.editor .popup__imageGridImg{
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
}

.editor .popup__imageGridLoader{
    height: 100%;
    width: 100%;
    display: flex;

    display: none;
}
.editor .popup__imageGridLoader img{
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Image Popup */
.popup.imageGridActive .popup__imageGrid.popupImgGrid{
    display: flex;
}

.editor .popup.imgPreviewActive .popup__imageUploadInputContainer{
    display: none;
}
.editor .popup.imgPreviewActive .popup__imagePreviewContainer{
    display: flex;
    gap: 20px;
}
.editor .popup.imgPreviewActive .popup__btn.btnImageConfirm{
    display: block;
}

.editor .popup__imageBx{
    display: flex;
    flex-direction: column;
    position: relative;
    width: 750px;
    height: 300px;
}
.editor .popup__imageUploadInputContainer{
    display: flex;
    flex-direction: column;
    row-gap: 16px;
    width: 100%;
    height: 100%;
}
.popup__imagePreviewContainer{
    display: flex;
    flex-direction: row;
    row-gap: 16px;
    width: 100%;
    height: 100%;

    display: none;
}

.editor .popup__imageUploadInput{
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    row-gap: 16px;
    align-items: center;
    justify-content: center;
    position: relative;
}
.editor .popup__fileInput{
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 50;
    cursor: pointer;
    visibility: hidden;
}
.editor .popup__fileLabel{
    width: 100%;
    height: 100%;
    border: 2px dotted #ab0d09;
    display: flex;
    flex-direction: column;
    row-gap: 14px;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}
.editor .popup__imageUploadInput.drag-over .popup__fileLabel{
    border-color: #4CAF50;
    border-style: solid;
    background-color: rgba(76, 175, 80, 0.05);
}
.editor .popup__labelImg{
    width: 128px;
}

.editor .popup__imgPreviewContainer{
    display: flex;
    column-gap: 20px;
}
.editor .popup__imgPreview{
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.editor .popup__imageError{
    display: none;
    font-size: calc(1em - 1px);
    color: #ab0d09;
}

.editor .popup__imageRemoveBackgroundContainer{
    display: grid;
}
.editor .popup__imageRemoveBackground{
    display: flex;
    flex-direction: column;
    justify-content: center;
    row-gap: 10px;

    grid-row: 1;
    grid-column: 1;
}
.editor .popup__imageBgInputBx{
    display: flex;
    column-gap: 8px;
    align-items: center;
    width: 400px;
}
.editor .popup__imageBgInput{
    accent-color: #ab0d09;
    margin: 0;
    margin-right: 3px;
    scale: 1.3;
}
.editor .popup__imageRemoveBackground-done{
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ab0d09;

    grid-row: 1;
    grid-column: 1;
    display: none;
}
.editor .popup__imageRemoveBackgroundContainer.imgRemoveBgDone .popup__imageRemoveBackground{
    display: none;
}
.editor .popup__imageRemoveBackgroundContainer.imgRemoveBgDone .popup__imageRemoveBackground-done{
    display: flex;
}


.popup__imageBgInputBox{
    display: flex;
    align-items: center;
    justify-content: center;
    column-gap: 1ch;
}

.editor .popup__imageBgLabel{
    font-size: 18px;
    font-weight: 500;
    color: black;
}
.editor .popup__imageBgLabel span{
    color: #ab0d09;
}
.editor .popup__imageBgDesc{
    font-size: 16px;
    font-weight: 300;
}

.editor .popup__btn.btnImageConfirm{
    display: none;
}

/* Ai popup */
.editor .popup__aiTextBx{
    display: flex;
    flex-direction: column;
    row-gap: 10px;
}
.editor .popup__aiTextBx .popup__title{
    line-height: 1.3;
    margin: 0;
}
.editor .popup__aiTextBx .popup__description, .editor .popupImage .popup__description{
    text-align: center;
    font-size: 16px;
}
.editor .popup__aiInputBx{
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
}
.editor .popup__aiInput{
    width: 100%;
    min-height: 48px;
    font-size: 18px;
    padding-inline: 20px;
    border: 2px solid black;
    outline: none;
    height: 48px;
    margin-top: 12px;
}
.editor .popup__aiInputError{
    font-size: 18px;
    font-weight: 400;
    color: #ab0d09;

    display: none;
}
.editor .popup__aiImgPreview{
    width: 100%;
    height: 100%;
    max-height: 400px;
    object-fit: contain;
    margin-top: 24px;

    display: none;
}

.editor .popup.aiActive .popup__container.popupAi{
    display: flex;
}
.editor .popup__container.popupAi.inputError .popup__aiInputError{
    display: block;
}

.editor .popup__container.popupAi.previewActive .popup__aiInput,
.editor .popup__container.popupAi.previewActive .popup__description,
.editor .popup__container.popupAi.previewActive .popup__imageGrid.popupAiGrid{
    display: none;
}
.editor .popup__container.popupAi.previewActive .popup__aiImgPreview{
    display: flex;
}

/* Login Failed Popup */
.editor .popup.failedActive .popup__container.popupFailed{
    display: flex;
}
.editor .popup.failedActive .popup__btn.btnConfirm,
.editor .popup.failedActive .popup__imageGrid.popupFailedGrid{
    display: none;
}
.editor .popup.failedActive .popup__btn.btnConfirm.activeButton{
    display: block;
}
.editor .popup.failedActive .popup__imageGrid.popupFailedGrid.activeGrid{
    display: flex;
}

/* Text popup */
.editor .popup__textInput{
    width: 100%;
    max-width: 500px;
    min-height: 100px;
    font-size: 20px;
    padding: 10px 20px;
    border: 2px solid black;
    outline: none;

    height: 100px;
}
.editor .popup__textSel{
    display: flex;
    flex-direction: row;
    column-gap: 70px;
    justify-content: center;
    margin-block: 32px 12px;
}
.editor .popup__selBx,
.editor .popup__patternColorChoose{
    display: flex;
    flex-direction: column;
    row-gap: 14px;
}
.editor .popup__selTitle,
.editor .popup__patternColorTitle{
    font-size: 26px;
    font-weight: 400;
    text-align: center;
}
.editor .popup__selColorBx,
.editor .popup__outlineTextColorBx,
.editor .popup__patternColorBx {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(16, 1fr);
    grid-auto-rows: 40px;
    max-height: calc((40px + 6px) * 4 - 3px);
    overflow-x: hidden;
    overflow-y: hidden;
}
.editor .popup__selColorBx, .editor .popup__outlineTextColorBx {
    overflow-y: auto;
}
.editor .popup__selColor,
.editor .popup__outlineTextColor,
.editor .popup__patternColor {
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: border-radius 200ms ease-in-out;
}
.editor .popup__selColor.selectedColor,
.editor .popup__outlineTextColor.selectedColor,
.editor .popup__patternColor.selectedColor {
    border: solid 2px #ab0d09;
}

.editor .popup__selFontBx{
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, 1fr);
    font-size: 20px;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
}
.editor .popup__selFont{
    display: inline-block;
    width: 180px;
    white-space: nowrap;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    line-height: 2;
    height: 2em;
    cursor: pointer;
    transition: color 200ms ease-in-out;
}
.editor .popup__selFont.selectedFont{
    color: #ab0d09;
}

.editor .popup__selAlignButton{
    border: 2px solid #ab0d09;
    background-color: #ab0d09;
    color: white;
    font-size: calc(1em - 1px);
    padding: 4px 16px;
    cursor: pointer;
    transition: color 200ms ease-in-out, background-color 200ms ease-in-out;
}
.editor .popup__selAlignButton.selectedAlign{
    background-color: white;
    color: #ab0d09;
}

/* Custom Scrollbar */
.editor .customScrollbar::-webkit-scrollbar{
    width: 12px;
}
.editor .customScrollbar::-webkit-scrollbar-track{
    background: #e9e9e9;
}
.editor .customScrollbar::-webkit-scrollbar-thumb{
    background: #999999;
    border-inline: 3px solid #e9e9e9;
}
.editor .customScrollbar::-webkit-scrollbar-thumb:hover{
    background: #666666;
}

/* Patterns Popup */
.editor .popup__container.popupPattern{
    padding-inline: 100px;
    min-height: 100%;
    height: 100%;
    padding: 0 !important;
}
.editor .popup__container.popupPattern .popup__title{
    margin-top: 0;
}
.editor .popup__patternContainer{
    display: grid;
    width: 100%;
    height: auto;
    overflow: hidden;
    margin-bottom: auto;
}

.editor .popup__patternContainer.activeCategories .popup__categories{
    animation: fadeIn 250ms ease-in-out forwards;
}
.editor .popup__patternContainer.activePatterns .popup__categories{
    animation: fadeOut 250ms ease-in-out forwards;
}
.editor .popup__patternContainer.activeCategories .popup__patterns{
    animation: fadeOut 250ms ease-in-out forwards;
}
.editor .popup__patternContainer.activePatterns .popup__patterns{
    animation: fadeIn 250ms ease-in-out forwards;
}

.editor .popup__patternContainer.showPatterns .popup__categories{
    opacity: 0;
    visibility: hidden;
}
.editor .popup__patternContainer.showPatterns .popup__patterns{
    opacity: 1;
    visibility: visible;
}
.editor .popup__patternContainer.showPatterns .popup__patternBx{
    display: contents;
}
.editor .popup__patternContainer.showPatterns .popup__patternBx .popup__pattern{
    display: none;
}

.editor .popup__categories{
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 28px 24px;
    align-items: flex-start;
    grid-row: 1;
    grid-column: 1;

    overflow-x: hidden;
    overflow-y: auto;
}
.editor .popup__category{
    display: flex;
    flex-direction: column;
    row-gap: 10px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: transparent;
    padding: 0;
    border: none;
    outline: none;
}
.editor .popup__categoryImgBx{
    width: 100%;
    height: 200px;
    padding: 22px 20px;
    background-color: rgb(217, 217, 217);
}
.editor .popup__categoryImg{
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: scale 200ms ease-in-out;
}
.editor .popup__category:hover .popup__categoryImg{
    scale: 0.9;
}
.editor .popup__categoryName{
    font-size: 22px;
    font-weight: 400;
    word-break: break-word;
}

.editor .popup__patterns{
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 28px 24px;
    align-items: flex-start;
    grid-row: 1;
    grid-column: 1;

    overflow-x: hidden;
    overflow-y: auto;

    opacity: 0;
    visibility: hidden;
}
.editor .popup__patternBx{
    display: none;
}
.editor .popup__patternBx.activePatterns{
    display: contents;
}
.editor .popup__pattern{
    height: 200px;
    background-color: rgb(217, 217, 217);
    padding: 10px 8px;
    border: none;
    outline: none;
    cursor: pointer;
}
.editor .popup__pattern.active{
    display: block !important;
}
.editor .popup__patternImg{
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: scale 200ms ease-in-out;
}
.editor .popup__pattern:hover .popup__patternImg{
    scale: 0.9;
}

.editor .popup__patternInput{
    width: 100%;
    max-width: 300px;
    min-height: 48px;
    font-size: 18px;
    padding-inline: 20px;
    border: 2px solid black;
    outline: none;
    height: 48px;

    margin-bottom: 44px;
}
.editor .popup__container.popupPattern .popup__title{
    margin-bottom: 22px;
}

/* Popup Draft */
.editor .popup.draftActive .popup__container.popupDraft{
    display: flex;
}

.editor .popup__container.popupDraft{
    min-height: 100%;
    height: 100%;
}
.editor .popupDraft .popup__title{
    margin-top: 0;
}
.editor .popup__draftContainer{
    display: grid;
    width: 100%;
    height: auto;
    overflow: hidden;
    margin-bottom: auto;
}
.editor .popup__draftImages{
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 28px 24px;
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
}
.editor .popup__draft{
    width: 100%;
    max-height: 250px;
    height: 100%;
    cursor: pointer;

    background-color: transparent;
    border: none;
    outline: none;
}
.editor .popup__draftImg{
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: scale 200ms ease-in-out;
}
.editor .popup__draftImg:hover{
    scale: 0.95;
}

/* Help popup */
.popup__container.popupHelp{
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 100;
}

.editor .popup.helpPopupActive .popup__container.popupHelp{
    display: flex;
}
.editor .popup__textArea{
    width: 100%;
    height: 100%;
    max-width: 1000px;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
    -ms-overflow-style: scrollbar; /* IE/Edge */
    scrollbar-3dlight-color: #f1f1f1;
    scrollbar-arrow-color: #888;
    scrollbar-base-color: #f1f1f1;
    scrollbar-darkshadow-color: #888;
    scrollbar-face-color: #888;
    scrollbar-highlight-color: #f1f1f1;
    scrollbar-shadow-color: #888;
    scrollbar-track-color: #f1f1f1;
    font-family: Helvetica,Arial,sans-serif;
    font-weight: 400;
    font-size: 16px;
    letter-spacing: 0.01em;
    line-height: 23px;
    padding: 0px 10px;
}

.editor .popup__textArea strong, .editor .popup__textArea a, .editor .popup__textArea p{
    font-family: Helvetica,Arial,sans-serif;
    font-size: 16px;
    letter-spacing: 0.01em;
    line-height: 23px;
}

.editor .popup__textArea a{
    text-decoration: underline;
}

.editor .popup__textArea ul{
    margin-left: 40px;
    list-style-type: initial;
}

.editor .popup__textArea img{
    max-width: 100%;
    max-height: 100%;
    height: auto;
}

.editor .popup__textArea::-webkit-scrollbar {
    width: 8px;
    -webkit-appearance: none;
}

.editor .popup__textArea::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
    -webkit-border-radius: 4px;
}

.editor .popup__textArea::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
    -webkit-border-radius: 4px;
    min-height: 20px;
}

.editor .popup__textArea::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.editor .popup__textArea::-webkit-scrollbar-thumb:active {
    background: #333;
}

.editor .popup__textArea h1{
    font-size: 37px;
    font-weight: 500;
    letter-spacing: 0 em;
}

.editor .popup__textArea h2{
    font-size: 1.7em;
    font-weight: 600;
    letter-spacing: 0 em;
    padding: 1em 0 0.3em;
}

.editor .popup__textArea h3{
    font-size: 1.5em;
    font-weight: 600;
    letter-spacing: 0 em;
    padding: 1em 0 0.3em;
}

.editor .popup__textArea h4{
    font-size: 1.3em;
    font-weight: 600;
    letter-spacing: 0 em;
    padding: 1em 0 0.3em;
}

.help__btn{
    border: none;
    outline: none;
    padding: 0;
    background-color: transparent;
}
.help__btn img{
    width: 32px;
    height: 32px;
    cursor: pointer;
}

#helpSaveForLaterMobile{
    position: absolute;
    z-index: 10;
    bottom: 50px;
    right: 7px;
}

@keyframes zoomFadeIn {
    0%{
        opacity: 0;
        visibility: hidden;
        scale: 0.6;
    }
    1%{
        opacity: 0;
        visibility: visible;
        scale: 0.6;
    }
    100%{
        opacity: 1;
        visibility: visible;
        scale: 1;
    }
}

@keyframes zoomFadeOut {
    0%{
        opacity: 1;
        visibility: visible;
        scale: 1;
    }
    99%{
        opacity: 0;
        visibility: visible;
        scale: 0.6;
    }
    100%{
        opacity: 0;
        visibility: hidden;
        scale: 0.6;
    }
}

@keyframes fadeIn {
    0%{
        opacity: 0;
        visibility: hidden;
    }
    1%{
        opacity: 0;
        visibility: visible;
    }
    100%{
        opacity: 1;
        visibility: visible;
    }
}

@keyframes fadeOut {
    0%{
        opacity: 1;
        visibility: visible;
    }
    99%{
        opacity: 0;
        visibility: visible;
    }
    100%{
        opacity: 0;
        visibility: hidden;
    }
}

/* Summary Section */
.editor .summary{
    height: 100%;
    display: flex;
    flex-direction: column;
    row-gap: 10px;
    margin-left: auto;
}
.sum__btn{
    align-self: flex-end;
    width: 100%;
    font-size: 20px;
    padding: 10px 20px;
    background-color: #ab0d09;
    border: 2px solid #ab0d09;
    color: white;
    outline: none;
    cursor: pointer;
    transition: color 200ms ease-in-out, background-color 200ms ease-in-out;
}
.editor .sum__btn:hover{
    background-color: white;
    color: #ab0d09;
}

/* Breakpoints */
@media only screen and (max-height: 38em){
    .editor .sidebar{
        grid-template-columns: repeat(2, 1fr);
        gap: 34px;
        margin-right: 30px;
    }
}

@media only screen and (min-width: 35em){
    .editor .popup__selColorBx,
    .editor .popup__outlineTextColorBx,
    .editor .popup__patternColorBx {
        /* will be 16 */
        grid-template-columns: repeat(16, 1fr);
    }
}

@media only screen and (max-width: 84em){
    .editor .popup__categories{
        grid-template-columns: repeat(4, 1fr);
    }
    .editor .popup__patterns{
        grid-template-columns: repeat(4, 1fr);
    }
    .editor .popup__categoryImgBx{
        height: 224px;
    }
    .editor .popup__title{
        font-size: 40px;
        margin-bottom: 36px;
    }
    .editor .popup__categoryName{
        font-size: 21px;
    }

    .editor .popup__container.popupPattern .popup__title{
        margin-bottom: 22px;
    }
    .editor .popup__patternInput{
        margin-bottom: 44px;
    }
}

@media only screen and (min-width: 62.0625em) and (max-width: 72em){
    .editor .popup__selColorBx,
    .editor .popup__outlineTextColorBx,
    .editor .popup__patternColorBx {
        grid-template-columns: repeat(8, 1fr);
    }
}


@media only screen and (max-width: 62em), (max-height: 38em){
    .editor .editorContainer{
        justify-content: flex-start;
    }

    /* Popups */
    .editor .popup__imageBx{
        width: 600px;
        height: 250px;
    }
    .editor .popup__imageUploadInput{
        height: inherit;
    }

    .editor .popup__selColorBx,
    .editor .popup__outlineTextColorBx,
    .editor .popup__patternColorBx {
        grid-auto-rows: 20px;
        max-height: calc(5*20px);
        max-width: calc(16*20px);
        margin: 0 auto;
        gap: 0;
    }
    .editor .popup__selColor,
    .editor .popup__outlineTextColor,
    .editor .popup__patternColor {
        width: 20px;
        height: 20px;
    }
    .editor .popup__textSel{
        margin-block: 22px 8px;
    }
    .editor .popup__selFont{
        font-size: 16px;
        width: 120px;
    }

    .editor .popup__categoryImgBx{
        height: 144px;
        padding: 10px;
    }
    .editor .popup__pattern{
        height: 152px;
        padding: 10px;
    }
    .editor .popup__categories{
        gap: 16px 14px;
        margin-top: 16px;
        grid-template-columns: repeat(5, 1fr);
    }
    .editor .popup__patterns{
        grid-template-columns: repeat(5, 1fr);
        gap: 16px 14px;
    }
    .editor .popup__categoryName{
        font-size: 20px;
    }

    .editor .popup.shirtActive{
        height: 100%;
    }
    .editor .popup.shirtActive ~ .editorContainer .editor__shirtSvg{
        scale: 1;
        top: 0;
    }

    .editor .popup__title{
        font-size: 32px;
        margin-block: 0;
        margin-bottom: 20px;
    }
    .editor .popup__btnBx{
        margin-top: 28px;
        column-gap: 20px;
    }
    .editor .popup__btn{
        padding: 6px 28px;
    }
    .editor .popup__selBx,
    .editor .popup__patternColorChoose{
        row-gap: 10px;
        width: 100%;
    }
    .editor .popup__selTitle,
    .editor .popup__patternColorTitle {
        font-size: 22px;
        padding: 3px 0;
    }
    .editor .popup__imageGrid{
        max-height: calc(100px + 16px);
        margin-block: 16px 26px;
    }
    .editor .popup__imageGridContainer{
        grid-template-columns: repeat(5, 1fr);
        gap: 16px 18px;
    }
    .editor .popup__imageGridBx{
        max-width: 100px;
    }
}

@media only screen and (max-width: 540px) {
    .editor .popup__btnBx.grid {
        display: grid;
    }

    .editor .popup__btnBx.grid .btnLeave {
        order: 3;
        grid-area: 2 / 1 / 3 / 3;
        margin-top: 15px;
    }

    .editor .popup__btnBx.grid .btnOpenGallery {
        order: 1;
        grid-area: 1 / 1 / 2 / 2;
    }

    .editor .popup__btnBx.grid .btnImageConfirm {
        order: 2;
        grid-area: 1 / 2 / 2 / 3;
    }

    .editor .popup__btnBx{
        flex-direction: column;
        gap: 10px;
        margin-top: 10px !important;
    }

    .editor .popup__btnBx .btnLeaveContainer{
        order: 3;
    }

    .editor .popup__imageBgInputBx{
        width: auto;
    }

    .editor .popup__aiTextBx .popup__description, .editor .popupImage .popup__description{
        font-size: 12px;
    }

    .editor .popup__imageUploadInput{
        height: 120px !important;
    }
}

@media only screen and (max-width: 1250px){
    .editor{
        padding: 8px 18px 24px 18px;
    }
    .editor .editorContainer{
        flex-direction: column;
    }
    .editor .sidebar{
        display: flex;
        flex-direction: row;
        column-gap: 8px;
        justify-content: space-evenly;
        width: 100%;
        margin-right: 0;
    }
    .editor .side__icon{
        width: 52px;
    }
    /* Popups */
    .editor .popup__imageUploadInput{
        width: 100%;
    }
    .editor .popup__title{
        text-align: center;
        margin-bottom: 16px;
    }
    .editor .popup__fileLabel{
        row-gap: 6px;
    }
    .editor .popup__labelImg{
        width: 86px;
    }
    .editor .popup__fileLabel p{
        font-size: 20px;
    }

    .editor .popup__textSel{
        flex-direction: column;
        column-gap: 0;
        row-gap: 16px;
    }
    .editor .popup__shirtColorBx{
        gap: 8px 14px;
        margin-block: 4px 8px;
    }
    .editor .popup__shirtColor{
        width: 40px;
        height: 40px;
    }

    .editor .popup__categories{
        grid-template-columns: repeat(3, 1fr);
        gap: 14px 10px;
        margin-top: 12px;
    }
    .editor .popup__patterns{
        grid-template-columns: repeat(3, 1fr);
        gap: 14px 10px;
        margin-top: 12px;
    }
    .editor .popup__category{
        row-gap: 6px;
    }

    .editor .popup__draftImages{
        grid-template-columns: repeat(4, 1fr);
    }
    .editor .popup__draft{
        max-height: 225px;
    }

    .editor .popup__container{
        padding: 36px 26px !important;
    }

    .editor .popup__patternInput{
        margin-bottom: 16px;
    }
    .editor .popup__container.popupPattern .popup__title{
        margin-bottom: 8px;
    }
}

@media only screen and (min-width: 62.0625em){
    .popup.popupActive.patternColorActive{
        display: none !important;
    }
}

@media only screen and (max-width: 38em){
    .editor .popup__container.popupPatternColor{
        padding-inline: 0 !important;
    }
    .editor .popup__categories{
        grid-template-columns: repeat(2, 1fr);
    }
    .editor .popup__patterns{
        grid-template-columns: repeat(2, 1fr);
    }
    .editor .popup__title{
        font-size: 24px;
    }
    .editor .popup__categoryName{
        font-size: 18px;
    }
    .editor .popup__categoryImgBx{
        height: 80px;
    }
    .editor .popup__pattern{
        height: 136px;
    }

    .editor .popup__imageBx{
        width: 100%;
        height: auto;
    }

    .editor .popup__imageRemoveBackground{
        row-gap: 6px;
    }
    .editor .popup__imageBgLabel{
        font-size: 16px;
    }
    .popup__imageBgCheckbox{
        width: 18px;
        height: 18px;
    }
    .editor .popup__imageBgDesc{
        font-size: 15px;
    }
    .editor .popup__imageGrid{
        max-height: calc(90px + 14px);
        margin-block: 0 20px;
    }
    .editor .popup__imageGridContainer{
        grid-template-columns: repeat(3, 1fr);
        gap: 14px 16px;
    }
    .editor .popup__imageGridBx{
        max-width: 90px;
    }
    .editor .popup__imageGridLoader{
        height: calc(90px + 14px);
    }
}

/* For parent element */
@media only screen and (max-width: 48em){
    .editor{
        min-height: auto !important;
        padding: 0px !important;
    }
    .editor .editorContainer{
        flex-wrap: wrap;
        height: 100%;
    }
    .editor .sidebar{
        flex-direction: row;
        margin-top: 10px;
        position: relative;
        z-index: 49;
    }
    .editor .editor__container{
        margin-top: -20px;
    }
    .editor .editor__shirtSvg{
        height: auto;
    }
    .editor .side__bx{
        margin-right: 20px;
        row-gap: 0px;
    }
    .editor .side__bx:last-of-type{
        margin-right: 0px;
    }
    .editor .popup.popupActive{
        top: 0px;
        position: fixed;
        padding: 10px;
    }
    .editor .popup.textActive .popup__container.popupText{
        padding: 0px !important;
        justify-content: flex-start;
    }
    .editor .popup__textInput{
        width: 100%;
    }
    .editor .popup__textSel{
        width: 100%;
    }
    .editor .popup__textSel{
        flex-direction: column;
    }
    .editor .popup__title{
        margin-block: 0px;
    }
    .editor .popup__selBx{
        margin-top: 5px;
        row-gap: 0px;
    }
    .editor .popup__categories{
        grid-template-columns: repeat(2, 1fr);
    }
    .editor .popup.patternActive .popup__container.popupPattern{
        padding-bottom: 0 !important;
    }
    .editor .popup__patterns{
        grid-template-columns: repeat(2, 1fr);
    }
    .editor .popup.imageActive .popup__container.popupImage{
        padding-bottom: 50px !important;
    }
    .editor .popup__selFontBx{
        max-height: 110px;
    }
    .editor .popup__selColorBx, .editor .popup__outlineTextColorBx {
        max-height: 100px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .editor .popup__draftImages{
        grid-template-columns: repeat(3, 1fr);
    }
    .editor .popup__draft{
        max-height: 200px;
    }

    .editor .popup__aiInputError{
        font-size: 16px;
    }
    .editor .popup__aiTextBx{
        row-gap: 10px;
    }
    .editor .popup__aiTextBx .popup__description{
        text-align: center;
        font-size: 18px;
    }
}

@media only screen and(max-width: 93.75em){
    .editor{
        padding: 8px 18px 24px 18px;
    }
    .editor .editorContainer{
        flex-direction: column;
        justify-content: flex-start;
    }
    .editor .sidebar{
        display: flex;
        flex-direction: row;
        column-gap: 8px;
        justify-content: space-evenly;
        width: 100%;
        margin-right: 0;
    }
    .editor .side__icon{
        width: 52px;
    }
    .editor .side__desc{
        font-size: 16px;
    }

    /* Popups */
    .editor .popup__title{
        font-size: 28px;
        text-align: center;
        margin-bottom: 16px;
    }
    .editor .popup__fileLabel{
        row-gap: 6px;
    }
    .editor .popup__labelImg{
        width: 86px;
    }
    .editor .popup__fileLabel p{
        font-size: 20px;
    }
    .editor .popup__textSel{
        flex-direction: column;
        column-gap: 0;
        row-gap: 16px;
    }
    .editor .popup__shirtColorBx{
        gap: 8px 14px;
        margin-block: 4px 8px;
    }
    .editor .popup__shirtColor{
        width: 40px;
        height: 40px;
    }
    .editor .popup__categories{
        grid-template-columns: repeat(3, 1fr);
        gap: 14px 10px;
        margin-top: 12px;
    }
    .editor .popup__patterns{
        grid-template-columns: repeat(3, 1fr);
        gap: 14px 10px;
        margin-top: 12px;
    }

    .editor .popup__category{
        row-gap: 6px;
    }
    .editor .popup__container{
        padding: 36px 26px !important;
    }
}


/* EDITOR CONTAINER */
.editor .editor__container{
    display: flex;
    position: relative;
    width: 100%;
    height: 100%;
}
.editor__wrapper{
    display: flex;
    width: 100%;
    height: 100%;
}
.editor__bx{
    display: grid;
}

.editor .editorImage__container{
    grid-row: 1;
    grid-column: 1;
}
.editor .editorImage{
    display: flex;
    width: 100%;
    height: 100%;

    display: none;
}
.editor .editorImage.active{
    display: flex;
}
.editor .editorImage.overlayImg{
    position: relative;
    z-index: 9;
    pointer-events: none;
}
.editor .editor__canvasMiddleBx{
    position: relative;
    pointer-events: none;
    grid-row: 1;
    grid-column: 1;
}
.editor .editor__canvasBottomBx{
    position: absolute;
    pointer-events: all;
}
.editor .editor__canvasMiddleImg{
    width: 100%;
    height: 100%;
    object-fit: cover;

    position: absolute;
    left: 0;
    top: 0;

    display: none;
}

.editor__bxContainer{
    display: flex;
    flex-direction: column;
    row-gap: 16px;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Zoom Buttons */
.zoomContainer{
    position: absolute;
    right: 8px;
    top: 16px;
    display: flex;
    flex-direction: column;
    row-gap: 10px;

    display: none;
}
.zoomContainer.active{
    display: flex;
}
.zoomContainer__btn{
    width: 48px;
    aspect-ratio: 1;
    border-radius: 50%;
    padding: 0;
    background-color: transparent;
    border: none;
    outline: none;
    cursor: pointer;
}
.zoomContainer__btn img{
    width: 100%;
    height: 100%;
    object-fit: contain;
}


/* Check Quality */
.editor .editor__checkQuality{
    display: flex;
    margin-top: 16px;
}
.editor .editor__checkQualityBox{
    display: flex;
    column-gap: 8px;
    align-items: center;
    justify-content: center;
}
.editor .editor__checkQualityBox:has(.editor__checkQualityInput:disabled){
    opacity: 0.5;
}

.editor .editor__checkQualityResult{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 300px;
    z-index: 99;
    transform-origin: center center;

    opacity: 0;
    visibility: hidden;
    scale: 0.6;
}
.editor .editor__checkQualityResultImg{
    grid-column: 1;
    grid-row: 1;
    display: none;
}

.editor .editor__checkQualityResult.active{
    animation: zoomFadeIn 250ms ease-in-out forwards;
}
.editor .editor__checkQualityResult.hidden{
    animation: zoomFadeOut 250ms ease-in-out forwards;
}
.editor .editor__checkQualityResult.active-perfect .editor__checkQualityResultImg.perfect{
    display: block;
}
.editor .editor__checkQualityResult.active-good .editor__checkQualityResultImg.good{
    display: block;
}
.editor .editor__checkQualityResult.active-bad .editor__checkQualityResultImg.bad{
    display: block;
}


/* IOS Button color fix */
button{
    color: black;
}

/* Border Box */
.editor .borderBox{
    display: block;
    position: absolute;
    cursor: move;
    z-index: 10;
    border: 2px solid #ab0d09;
    pointer-events: none;
}
.editor .borderBox.boxHidden{
    display: none;
}
.editor .borderBox__btn{
    width: 36px;
    height: 36px;
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    outline: none;
    position: absolute;
    z-index: 10;
    padding: 0;
    border-radius: 50%;
    pointer-events: all;
}
.editor .borderBox__removeBtn{
    right: -36px;
    bottom: -36px;
    background-image: url(../img/icons/delete.png);
    cursor: pointer;
}
.editor .borderBox__resizeBtn{
    left: -36px;
    bottom: -36px;
    background-image: url(../img/icons/resize.png);
    cursor: ne-resize;
}
.editor .borderBox__moveBtn{
    left: -36px;
    top: -36px;
    background-image: url(../img/icons/move.png);
    cursor: move;
}
.editor .borderBox__rotateBtn{
    right: -36px;
    top: -36px;
    background-image: url(../img/icons/rotate.png);
    cursor: crosshair;
}
.editor .borderBox__layerControlBtn{
    left: 50%;
    bottom: -39px;
    transform: translateX(-50%);
    background-image: url(../img/icons/layer.png);
    cursor: pointer;
}
.editor .borderBox__layerFrontControlBtn{
    display: none;
    left: 50%;
    bottom: -72px;
    transform: translateX(-44px);
    background-image: url(../img/icons/layer-front.png);
    cursor: pointer;
}
.editor .borderBox__layerBackControlBtn{
    display: none;
    left: 50%;
    bottom: -72px;
    transform: translateX(8px);
    background-image: url(../img/icons/layer-back.png);
    cursor: pointer;
}
.editor .borderBox.activeLayer .borderBox__layerFrontControlBtn,
.editor .borderBox.activeLayer .borderBox__layerBackControlBtn{
    display: block;
}
.editor .borderBox__textEditBtn{
    display: none;
    left: -22px;
    top: 50%;
    transform: translate(-50%, -50%);
    background-image: url(../img/icons/updateText.png);
    cursor: pointer;
}
.editor .borderBox.textPopupActive .borderBox__textEditBtn{
    display: block;
}
.editor .borderBox__patternColorBtn{
    display: none;
    bottom: -39px;
    left: 50%;
    transform: translateX(-50%);
    background-color: transparent;
    border: 2px solid #ab0d09;
    cursor: pointer;
}
.editor .borderBox.patternColorActive .borderBox__patternColorBtn{
    display: block;
}
.editor .borderBox__objectCloneBtn{
    right: -22px;
    top: 50%;
    transform: translate(50%, -50%);
    background-image: url(../img/icons/clone.png);
    cursor: pointer;
}

/* Border box object size */
.editor .borderBox__objectSizeContainer{
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: calc(100% + 19px);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column-reverse;
    row-gap: 6px;

    align-items: center;
    white-space: nowrap;
    pointer-events: none;

    display: none;
}
.editor .borderBox__imageHelpers{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    column-gap: 8px;
}
.editor .borderBox .borderBox__text{
    background-color: #ab0d09;
    color: white;
    font-size: 15px;
    font-weight: 400;
    padding: 4px 8px;
    border-radius: 6px;
}

.editor .borderBox__removeBg{
    display: none;
}
.editor .borderBox.removeBgActive .borderBox__removeBg{
    display: block;
}

.editor .borderBox__imageScaleRatioContainer{
    display: flex;
    align-items: center;
    justify-content: center;
    column-gap: 6px;
    text-align: center;
    font-size: 16px;
    font-weight: 400;
    background-color: #ab0d09;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;

    display: none;
}
.editor .borderBox.imageQualityActive .borderBox__imageScaleRatioContainer{
    display: flex;
}

.editor .borderBox__imageScaleRatioBx{
    display: grid;
}
.editor .borderBox__imageScaleRatio{
    grid-column: 1;
    grid-row: 1;
    width: auto;
    height: 1em;

    display: none;
}
.editor .borderBox__imageScaleRatioBx.s-4 .s-4{
    display: block;
}
.editor .borderBox__imageScaleRatioBx.s-3 .s-3{
    display: block;
}
.editor .borderBox__imageScaleRatioBx.s-2 .s-2{
    display: block;
}
.editor .borderBox__imageScaleRatioBx.s-1 .s-1{
    display: block;
}
.editor .borderBox__imageScaleRatioBx.s-0 .s-0{
    display: block;
}

.editor .borderBox.objectSizeActive .borderBox__objectSizeContainer{
    display: flex;
}

.editor .borderBox.textPopupFix .borderBox__layerControlBtn,
.editor .borderBox.patternColorActive .borderBox__layerControlBtn{
    bottom: -78px;
}
.editor .borderBox.textPopupFix .borderBox__layerFrontControlBtn,
.editor .borderBox.patternColorActive .borderBox__layerFrontControlBtn{
    bottom: -108px;
}
.editor .borderBox.textPopupFix .borderBox__layerBackControlBtn,
.editor .borderBox.patternColorActive .borderBox__layerBackControlBtn{
    bottom: -108px;
}
.editor .borderBox.textPopupFix .borderBox__textEditBtn{
    bottom: -39px;
    top: unset;
}


/* Pattern color popup */
.editor .popup__container.popupPatternColor{
    max-height: 100dvh;
}
.editor .popup__patternColorContainer {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-image: url(../../assets/img/transparent.png);
    padding: 10px;
}

.editor .popup__patternColorContainer svg{
    max-width: 100%;
    max-height: 100%;
}

/* Pattern Colors */
.editor .editor__patternColorContainer {
    display: grid;
    row-gap: 8px;
    align-items: center;
    justify-content: center;

    position: absolute;
    top: 0;
    background-color: white;
    padding: 23px 10px 10px 10px;
    border-radius: 2px;
    z-index: 999;

    opacity: 0;
    visibility: hidden;
}

.editor .editor__patternColorTitle{
    text-align: left;
    min-width: 0;
    min-height: 0;
    white-space: pre;
    overflow: hidden;
    font-size: 19px;
    font-weight: 400;
    padding: 0;
}
.editor .editor__patternColorBx{
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 0;
    height: fit-content;
    grid-auto-rows: 25px;
    max-height: calc((25px + 6px) * 16 - 3px);
    overflow-y: auto;
    overflow-x: hidden;
}
.editor .editor__patternColor {
    width: 25px;
    height: 100%;
    aspect-ratio: 1;
    cursor: pointer;
    display: block;
    transition: border-radius 200ms ease-in-out;
}
.editor .editor__patternColor.selectedColor{
    border: solid 2px #ab0d09;
}
.editor .editor__patternColorContainer.disableTransition .editor__patternColor{
    transition: none !important;
}


@media only screen and (max-width: 62em){
    .editor .editor__patternColorTitle{
        font-size: 26px;
    }
    .editor .editor__patternColorBx{
        gap: 4px;
        margin-block: 0;
        max-height: calc((40px + 6px) * 8 - 3px);
        grid-template-columns: repeat(4, 1fr);
    }
    .editor .editor__patternColor{
        width: 32px;
        height: 32px;
        cursor: pointer;
        display: block;
    }
}

@media only screen and (max-width: 38em){
    .editor .editor__patternColorTitle{
        font-size: 22px;
    }
    .editor .popup__draftImages{
        grid-template-columns: repeat(2, 1fr);
    }

    .editor .editor__patternColorContainer{
        width: max-content;
        bottom: -25%;
        left: 50%;
        right: unset;
        transform: translateX(-50%);
    }
    .editor .editor__patternColorBx{
        grid-template-columns: repeat(6, 1fr);
        max-height: calc((40px + 6px) * 4 - 3px);
    }

    .zoomContainer{
        right: 2px;
        top: 30px;
        row-gap: 8px;
    }
    .zoomContainer__btn{
        width: 40px;
    }
}


/* Loader */
.editorLoader{
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;

    font-family: 'Oswald', sans-serif;
    box-sizing: border-box;

    display: none;
}
.editorLoader.activeLoader{
    display: flex;
}
.editorLoader__description{
    font-size: 32px;
    font-weight: 400;
    text-align: center;
}


@media only screen and (max-width: 62em){
    .editorLoader__description{
        font-size: 26px;
    }
}

@media only screen and (max-width: 38em){
    .editorLoader__description{
        font-size: 20px;
    }
}



/* EDITOR BELLOW */
.editor.canvasBellowActive .editor__bx{
    display: block;
}
.editor.canvasBellowActive .editor__container{
    height: 100% !important;
}
.editor.canvasBellowActive .editor__canvasBottomBx{
    top: 0 !important;
}
.editor.canvasBellowActive .editor__canvasMiddleImg{
    display: block;
}


/* Custom Checkbox */
/* .customCheckbox-input, .customCheckbox-span */
.customCheckbox-input{
    display: none;
}

.customCheckbox-span{
    width: 20px;
    height: 20px;
    border: 2px solid #000;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: white;
}
.customCheckbox-input:checked + .customCheckbox-span{
    background-color: #ab0d09;
    border-color: #ab0d09;
}
.customCheckbox-input:checked + .customCheckbox-span::after{
    content: "";
    position: absolute;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transform-origin: 5px;
}


/* Invisible Block helper */
.invisibleBlock{
    width: 100%;
    height: 100%;
    position: fixed;;
    top: 0;
    left: 0;
    z-index: 90;

    display: none;
}
.invisibleBlock.active{
    display: block;
}

/* Mobile saveForLater button */
.editor__mobileSaveForLater{
    display: block;
    position: absolute;
    z-index: 10;
    bottom: 0;
    right: 0;
    color: #fff;
    font-size: 12px;
    padding: 10px;
    border-radius: 25px;
    line-height: 12px;
    background: #ab0d09;
}

@media only screen and (min-width: 767px){
    .editor__mobileSaveForLater{
        display: none;
    }
}

.textActive {
    width: 450px !important;
    right: 0;
    left: auto !important;
    box-shadow: 0 0 25px 0 rgba(0,0,0,0.25);
    z-index: 2147483648;
}

/* úpravy pro AI generovani obrazku */
.editor section.popup.patternActive div.signpost__item {
    display: none;
}
.editor section.popup.patternActive .--hidden {
    display: none;
}
.editor section.popup.patternActive div.signpost__item.signpost__pattern{
    padding: 10px;
}
.editor section.popup.patternActive div.signpost__item.signpost__pattern,
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate {
    min-height: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: auto;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate {
    width: 90%;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate textarea {
    border: solid 2px #404040;
    height: 100px;
    padding: 10px;
    width: 500px;
    min-height: 50px;
    line-height: 16px;
    letter-spacing: 0px;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate .ai_generate-wrapper {
    margin: 20px 20px 5px 20px;
    min-width: 300px;
    max-height: 400px;
    max-width: 500px;
    display:  flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    position: relative;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate .ai_generate-wrapper:not(.border) {
    aspect-ratio: auto;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate .ai_generate-wrapper.border {
    border: dashed 2px #d2a354;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate .ai_generate-wrapper img.popup__aiGeneratePreview {
    width: fit-content;
    max-height: 350px;
    max-width: 500px;
    padding: 10px;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate .ai_generate-wrapper:not(.border) img.popup__aiGeneratePreview {
    padding: 0;
    max-width: 400px;
    max-height: 400px;
}
div.my-ai-gallery {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 28px 24px;
    align-items: flex-start;
    grid-row: 1;
    grid-column: 1;
    overflow-x: hidden;
    overflow-y: auto;
}
div.my-ai-gallery-wrapper {
    display: none;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate h3.ai_remaining-count {
    font-size: 19px;
    font-weight: 400;
    color: #a70a03;
    padding: 0;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate p.ai_removeBackground label {
    font-size: 19px;
    font-weight: 400;
    color: #a70a03;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate p.ai_removeBackground label span {
    color: #38474f;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate h3.ai-error-message {
    font-weight: 600;
    color: #a70a03;
}
.editor section.popup.patternActive div.signpost__item .popup__btn {
    font-size: 19px;
    font-weight: 500;
    text-transform: uppercase;
    padding: 9px 23px;
}
.editor section.popup.patternActive div.signpost__item .popup__btn.btnGenerateNew {
    background-color: #d2a354;
    border-color: #d2a354;
}
.editor section.popup.patternActive div.signpost__item .popup__btn.btnGenerateNew:hover {
    background-color: white;
    border-color: #d2a354;
    color: #d2a354;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate .popup__aiGenerateSettings {
    display: flex;
    flex-direction: row;
    gap: 30px;
    padding: 5px;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate .popup__aiGenerateSettings > div:nth-child(odd) {
    display: flex;
    margin: 0px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate .popup__aiGenerateSettings > div:nth-child(even) {
    display: flex;
    margin: 0px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate .popup__aiGenerateSettings select {
    border: solid 1px #bdbdbd;
    border-radius: 5px;
    padding-left: 10px;
    padding-bottom: 2px;
    letter-spacing: 0px;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate .popup__aiGenerateSettings select option {
    letter-spacing: 0;
}
.editor section.popup.patternActive div.signpost__item.signpost__ai-generate .popup__aiGenerateSettings .popup__aiGenerateSettingsBx label {
    font-size: 16px;
    padding: 0px;
    margin: 0px;
}
.editor section.popup.patternActive div.pattern__signpost {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    align-content: center;
    height: 100vh;
    overflow: auto;
    flex-direction: row;
}
.editor section.popup.patternActive div.pattern__signpost div.signpost {
    width: 450px;
    height: 550px;
    margin: 25px;
    background-color: #f7f6f6;
    padding: 50px;
    text-align: center;
}
.editor section.popup.patternActive div.pattern__signpost div.signpost .signpost__link {
    color: #a70a03;
    text-decoration: underline;
    font-size: 18px;
}
.editor section.popup.patternActive div.pattern__signpost div.signpost .signpost__link:hover {
    text-decoration: none;
}
.editor section.popup.patternActive div.pattern__signpost div.signpost img {
    min-height: 212px;
    aspect-ratio: 1;
}
.editor section.popup.patternActive div.pattern__signpost div.signpost__footer {
    width: 100%;
    margin-bottom: 30px;
}
.editor section.popup.patternActive div.pattern__signpost div.signpost button {
    text-transform: uppercase;
}
.editor section.popup.patternActive button:disabled,
.editor section.popup.patternActive button[disabled] {
    cursor: not-allowed;
}
.editor section.popup.patternActive div.ai_generate-zoom-it {
    position: absolute;
    right: 0;
    top: -6px;
}
.editor section.popup.patternActive div.ai_generate-zoom-it img {
    cursor: pointer;
}
@media only screen and (max-width: 580px) {
    .editor .popup__container.popupPattern {
        align-items: unset;
        flex-direction: inherit;
    }

    .editor section.popup.patternActive div.pattern__signpost {
        width: 100%;
        align-content: flex-start;
    }

    .editor section.popup.patternActive div.pattern__signpost div.signpost {
        width: 100%;
        padding: 20px;
        height: auto;
        margin: 10px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .editor section.popup.patternActive div.pattern__signpost .right_block{
        display: flex;
        flex-direction: column;
    }

    .editor section.popup.patternActive div.pattern__signpost div.signpost h2{
        font-size: 19px;
        margin-bottom: 0px;
        text-align: left;
    }

    .editor section.popup.patternActive div.pattern__signpost div.signpost .popup__btnBx{
        margin-top: 0px !important;
        justify-content: flex-start;
    }

    .editor section.popup.patternActive div.pattern__signpost div.signpost .signpost__link{
        text-align: left;
        font-size: 16px;
    }

    .editor section.popup.patternActive div.pattern__signpost div.signpost button{
        font-size: 14px;
        padding: 6px 14px;
    }

    .editor .signpost__item h2 {
        font-size: 28px;
    }

    .editor section.popup.patternActive div.signpost__item.signpost__ai-generate textarea {
        width: 100%;
        min-height: 50px;
        padding: 2px;
        font-size: 13px;
    }

    .editor section.popup.patternActive div.signpost__item.signpost__ai-generate .ai_generate-wrapper {
        min-width: 100px;
        aspect-ratio: auto;
    }

    .editor section.popup.patternActive h2 {
        font-size: 24px;
        margin-top: 15px;
    }

    .editor div.my-ai-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px 10px;
        margin-top: 12px;
    }

    .editor section.popup.patternActive div.pattern__signpost div.signpost img {
        height: 70px;
        min-height: 70px;
    }

    .editor section.popup.patternActive div.signpost__item.signpost__ai-generate .popup__aiGenerateSettings {
        flex-direction: column;
        gap: 5px;
    }

    .editor section.popup.patternActive div.signpost__item.signpost__ai-generate .popup__aiGenerateSettings .popup__aiGenerateSettingsBx label {
        margin-bottom: 0;
    }

    .editor section.popup.patternActive div.signpost__item.signpost__ai-generate .popup__aiGenerateSettings > div:nth-child(odd) {
        margin: 3px 5px 3px 0;
    }
    .editor section.popup.patternActive div.signpost__item.signpost__ai-generate .popup__aiGenerateSettings > div:nth-child(even) {
        margin: 3px 0 3px 5px;
    }
}

/* 2D Preview */
.editor .editor2DPreview{
    display: flex;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    visibility: hidden;
}
.previewButton{
    display: flex;
    flex-direction: column;
    border: 0px;
    background: transparent;
}
.previewButton.activeTshirtPart .editor__tshirtName{
    color: #ab0d09;
}
.previewButton.activeTshirtPart .editor2DPreview__container{
    border: 2px solid #ab0d09;
}
.previewButton .editor__tshirtName{
    font-family: 'Oswald', sans-serif;
    font-weight: 800;
    color: #37474F;
}
.editor2DPreview__container{
    width: 100%;
    position: relative;
    display: flex;
}
.editor2DPreview__img{
    width: 100%;
    object-fit: contain;
    z-index: 2;
    max-width: 100%;
    max-height: 100%;
}
.editor2DPreview__canvasContainer{
    z-index: 5;
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: center center;
}

.editor.preview2DActive .editorContainer{
    visibility: hidden;
}

.editor.preview2DActive .editor2DPreview{
    visibility: visible;
}

.editor.preview2DActive .tshirtPartContainer{
    visibility: visible;
}

@media (max-width: 767px) {
    .previewButton{
        margin-left: 10px;
    }

    .previewButton .editor__tshirtName{
        font-size: 10px;
    }

    .editor section.popup.patternActive div.signpost__item.signpost__ai-generate .ai_generate-wrapper img.popup__aiGeneratePreview {
        height: 150px;
        width: auto;
    }

    .signpost__item.signpost__ai-generate .popup__btnBx{
        flex-direction: column;
        gap: 10px;
        margin-top: 0px;
    }

    .editor section.popup.patternActive div.signpost__item.signpost__ai-generate p.ai_removeBackground{
        display: flex;
        padding-left: 10px;
        gap: 10px;
        margin-top: 10px;
    }

    .editor section.popup.patternActive div.signpost__item.signpost__ai-generate p.ai_removeBackground.--hidden{
        display: none;
    }

    .editor section.popup.patternActive div.signpost__item.signpost__ai-generate p.ai_removeBackground label{
        line-height: 19px;
    }

    .signpost__item.signpost__ai-generate .popup__btnBx .btnLeaveContainer{
        order: 3;
    }

    .signpost__item.signpost__ai-generate .popup__btnBx .btnGenerateNew{
        order: 2;
    }

    .signpost__item.signpost__ai-generate .popup__btnBx .btnUseImage{
        order: 1;
    }
}

div.popupText input[type="range"] {
    height: 2px;
}

/** Context menu **/
.context-menu {
    position: absolute;
    z-index: 10000;
    width: 240px;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    flex-direction: column;
    padding: 5px 0;
}
.context-menu ul.context-menu__items {
    list-style: none;
    padding: 0;
    width: 90%;
    margin: 0 auto;
}
.context-menu ul.context-menu__items li.context-menu__item {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 17px;
    transition: background-color 0.2s;
    color: #a70a03;
}
.context-menu ul.context-menu__items li.context-menu__item.second {
    font-size: 15px;
    color: #38474f;
}
.context-menu ul.context-menu__items li.context-menu__item:not(:last-child) {
    border-bottom: 1px solid #e8e8e8;
}

.context-menu ul.context-menu__items li.context-menu__item:hover {
    background-color: #f0f0f0;
}
.context-menu ul.context-menu__items li.context-menu__item img {
    width: 17px;
    height: 17px;
    margin-right: 10px;
    vertical-align: middle;
}

/** DELETE SAVED DESIGN **/
section.editor section.draftActive div.popup__draftWrapper {
    display: grid;
}

section.editor section.draftActive div.popup__draftWrapper .draft_btn {
    background: none;
    border: none;
    padding: 10px 16px;
    display: inline-block;
    font-size: 16px;
    line-height: 16px;
}

section.editor section.draftActive div.popup__draftWrapper .draft_btn img {
    vertical-align: bottom;
}

section.editor section.draftActive div.popup__draftWrapper .popup__draftFooter {
    text-align: center;
    margin-top: 12px;
}

section.editor section.draftActive div.popup__draftWrapper .popup__draftFooter .popup__draftUse {
    background-color: #ab0d09;
    color: white;
    transition: color 200ms ease-in-out, background-color 200ms ease-in-out;
}

section.editor section.draftActive div.popup__draftWrapper .popup__draftFooter .popup__draftUse:hover {
    background-color: white;
    color: #ab0d09;
}

/** Context menu **/
.context-menu {
    position: absolute;
    z-index: 10000;
    width: 240px;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    flex-direction: column;
    padding: 5px 0;
}
.context-menu ul.context-menu__items {
    list-style: none;
    padding: 0;
    width: 90%;
    margin: 0 auto;
}
.context-menu ul.context-menu__items li.context-menu__item {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 17px;
    transition: background-color 0.2s;
    color: #a70a03;
}
.context-menu ul.context-menu__items li.context-menu__item.second {
    font-size: 15px;
    color: #38474f;
}
.context-menu ul.context-menu__items li.context-menu__item:not(:last-child) {
    border-bottom: 1px solid #e8e8e8;
}

.context-menu ul.context-menu__items li.context-menu__item:hover {
    background-color: #f0f0f0;
}
.context-menu ul.context-menu__items li.context-menu__item img {
    width: 17px;
    height: 17px;
    margin-right: 10px;
    vertical-align: middle;
}

.editor .popup__imageUploadInputContainer #uniform-imageInput{
    display: none !important;
}

/** Tablety - iPad optimalizace **/
@media (max-width: 1024px) and (min-width: 768px) {
    .context-menu {
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%);
    }
}

/** Mobilní zařízení - vycentrování kontextového menu **/
@media (max-width: 767px) {
    .context-menu {
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%);
    }
}