body.spod-modal-open {
    overflow: hidden !important;
}

.spod-modal-overlay {
    display: none;
    position: fixed;
    z-index: 999999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.spod-modal-overlay.active {
    display: flex;
}

.spod-modal-content {
    background: #fff;
    width: 96%;
    max-width: 1100px;
    height: 88vh;
    max-height: 88vh;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    overflow: hidden;
    margin: auto;
}

.spod-header {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: #fafafa;
}

.spod-header-title {
    font-weight: bold;
    font-size: 15px;
    color: #333;
    flex: 1;
    text-align: left;
}

.spod-close {
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #888;
    transition: color 0.15s;
}

.spod-close:hover {
    color: #333;
}

.spod-main-container {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.spod-preview-side {
    flex: 1.2;
    padding: 20px;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-right: 1px solid #eee;
    box-sizing: border-box;
    overflow: hidden;
    min-height: 0;
}

.side-label {
    align-self: flex-start;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.canvas-wrapper {
    border: 1px solid #ddd;
    background: #fff;
    line-height: 0;
    max-width: 100%;
}

.canvas-wrapper canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.spod-controls-side {
    flex: 0.8;
    padding: 20px;
    overflow-y: auto;
    background: #fff;
    height: 100%;
    box-sizing: border-box;
}

.spod-slide-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
    margin-bottom: 10px;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.spod-slide-tab {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    user-select: none;
    border-right: 1px solid #ddd;
}

.spod-slide-tab:last-child {
    border-right: none;
}

.spod-slide-tab:hover {
    background: #e8e8e8;
    color: #333;
}

.spod-slide-tab.active {
    background: #FF0305;
    color: #fff;
}

.image-grid {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.img-upload-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
}

.img-upload-box {
    width: 100px;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #888;
    text-align: center;
    overflow: hidden;
}

.img-upload-box:hover {
    border-color: #FF0305;
}

.control-block {
    margin-bottom: 25px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 0px;
}

.block-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 10px;
    display: block;
    color: #333;
}

.temu-input {
    width: 100%;
    height: 45px;
    padding: 8px 60px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    line-height: 1.4;
    margin: 0 !important;
}

.temu-select {
    width: 100%;
    height: 45px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
}

.color-swatches {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ddd;
    flex-shrink: 0;
}

.swatch.active {
    box-shadow: 0 0 0 2px #FF0305;
}

.swatch.black {
    background: #000
}

.swatch.red {
    background: #FF0305
}

.swatch.yellow {
    background: #ffee00
}

.swatch.green {
    background: #76d200
}

.giftia-red-btn,
.temu-orange-btn {
    background-color: #FF0305 !important;
    border-color: rgba(0, 0, 0, .05) !important;
    color: #fff !important;
    border: 1px solid transparent !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    display: inline-block;
    font-size: .97em !important;
    font-weight: bolder !important;
    letter-spacing: .03em !important;
    line-height: 2.4em !important;
    margin-right: 1em !important;
    margin-top: 0 !important;
    max-width: 100% !important;
    min-height: 2.5em !important;
    min-width: 24px !important;
    padding: 0 1.2em !important;
    position: relative !important;
    text-align: center !important;
    text-decoration: none !important;
    text-rendering: optimizeLegibility !important;
    text-shadow: none !important;
    text-transform: uppercase !important;
    transition: transform .3s, border .3s, background .3s, box-shadow .3s, opacity .3s, color .3s !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

.giftia-red-btn:hover,
.temu-orange-btn:hover {
    background-color: #D40204 !important;
}

.giftia-red-btn:disabled,
.temu-orange-btn:disabled {
    opacity: 0.6 !important;
}

#spod-open-btn {
    white-space: nowrap !important;
    flex: 1 0 auto !important;
}

#spod-submit {
    width: 100% !important;
   flex: inherit !important;
    margin: 0 !important;
}

.hint-text {
    font-size: 11px;
    color: #888;
    margin-top: 8px;
    line-height: 1.4;
}

.spod-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff3b30;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    font-weight: bold;
    display: none;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.spod-remove-btn:hover {
    background: #e02d22;
}

.input-container {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

.char-counter {
    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: 12px;
    color: #999;
    pointer-events: none;
}

@keyframes spod-spin {
    0% {
        transform: rotate(0deg)
    }

    100% {
        transform: rotate(360deg)
    }
}

.spin {
    animation: spod-spin 1s infinite linear;
    display: inline-block;
    vertical-align: middle;
}

@media (max-width: 768px) {

    .spod-modal-overlay {
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    .spod-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border: none;
    }

    .spod-main-container {
        flex-direction: column;
        flex: 1;
        min-height: 0;
        display: flex;
        overflow: hidden;
    }

    .spod-preview-side {
        padding: 10px 15px;
        border-right: none;
        border-bottom: 1px solid #eee;
        height: auto;
        flex: 0 0 auto;
        flex-shrink: 0;
        overflow: visible;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .spod-controls-side {
        padding: 15px;
        overflow-y: auto;
        flex: 1 1 auto;
        min-height: 0;
        background: #fff;
    }

    .spod-header {
        padding: 10px 15px;
    }

    .spod-header-title {
        font-size: 14px;
    }

    .img-upload-wrapper,
    .img-upload-box {
        width: 80px;
        height: 80px;
    }

    .block-title {
        font-size: 13px;
    }

    .spod-slide-tabs {
        margin-bottom: 8px;
    }

    .spod-slide-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
}

.spod-action-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.spod-qty-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 45px;
    background: #fff;
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
}

.spod-qty-btn {
    width: 35px;
    height: 100%;
    background: #f7f7f7 !important;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box;
}

.spod-qty-btn:hover {
    background: #eee !important;
}

#spod-qty-input {
    width: 45px;
    height: 100%;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    color: #333;
    background: #fff;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -moz-appearance: textfield;
}

#spod-qty-input::-webkit-outer-spin-button,
#spod-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}