.preview-wrapper {
    display: flex;
    gap: 20px;
    flex-direction: row;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden
}

.controls {
    width: 200px;
    flex-shrink: 0;
    font-size: 13px;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e0e0e0
}

.control-group.section-border {
    border-top: none;
    margin-top: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    border: 1px solid #eaeaea
}

.control-group label:first-child {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #222;
    margin-bottom: 15px;
    line-height: 1.2;
    border-left: 5px solid #d63031;
    padding-left: 10px
}

.control-group .flex-row label,
.control-group label:not(:first-child) {
    font-size: 15px;
    font-weight: 700;
    color: #666;
    margin-top: 10px;
    margin-bottom: 5px;
    border-left: none;
    padding-left: 0
}

.section-border {
    border-top: 1px solid #ddd;
    padding-top: 10px;
    margin-top: 10px
}

.control-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px
}

.input-field,
.font-select {
    width: 100%;
    margin-bottom: 8px;
    padding: 10px;
    border: 2px solid #666 !important;
    border-radius: 4px;
    background-color: #ffffff !important;
    color: #000 !important;
    box-sizing: border-box;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .2);
    transition: all 0.2s ease
}

.input-field:focus,
.font-select:focus {
    outline: none;
    border-color: #005a87;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(0, 90, 135, .2)
}

.input-field {
    margin-top: 5px
}

.font-select {
    width: 100% !important
}

.color-palette-container {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap
}

.color-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 2px rgba(0, 0, 0, .3);
    cursor: pointer;
    transition: transform 0.1s
}

.color-btn.active {
    border-color: #f40;
    transform: scale(1.1)
}

#fileNameDisplay {
    font-size: 13px;
    color: #444;
    margin-top: 6px;
    word-break: break-all;
    font-weight: 400;
    background: #fff;
    padding: 4px;
    border: 1px dashed #ccc
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    border: none
}

.btn-primary {
    background: #444;
    color: #fff;
    margin-top: 15px
}

.btn-secondary {
    background: #fff;
    color: #333;
    border: 2px solid #888
}

#canvasContainer {
    flex-grow: 1;
    width: 100%
}

canvas {
    border: 1px solid #999;
    background: #fff;
    display: block;
    width: 100% !important;
    height: auto !important;
    -webkit-user-select: none;
    user-select: none
}

#imagePreviewContainer {
    background: #fff;
    padding: 5px;
    text-align: center
}

[data-prefix="product"] [class*="ct-container"]>article[class*="post"] {
    --has-boxed: revert !important;
    --has-wide: var(--true)
}

.woocommerce-custom-form-area .variations {
    width: 100%;
    margin-bottom: 10px
}

.woocommerce-custom-form-area .variations td {
    display: block;
    padding: 0
}

.woocommerce-custom-form-area select {
    width: 100% !important;
    margin-bottom: 10px;
    border: 2px solid #666 !important
}

.woocommerce-custom-form-area .quantity {
    display: inline-block;
    margin-bottom: 10px
}

.woocommerce-custom-form-area .single_add_to_cart_button {
    width: 100% !important;
    padding: 15px !important;
    background-color: #d63031 !important;
    font-size: 16px !important
}

.woocommerce-custom-form-area form.cart {
    margin-top: 10px
}

.custom-plugin-header {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff
}

.custom-plugin-header h2 {
    margin: 0 0 10px 0;
    font-size: 20px
}

.custom-plugin-header p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #555
}

.section-spacer {
    height: 40px;
    width: 100%
}

.independent-order-area {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-top: 20px
}

.independent-order-area .single_add_to_cart_button {
    background-color: #d63031 !important;
    color: #fff !important;
    font-size: 18px !important;
    padding: 20px !important;
    border-radius: 5px !important;
    transition: background 0.3s
}

.independent-order-area .single_add_to_cart_button:hover {
    background-color: #b32d2d !important
}

.color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer
}

.color-btn {
    border: none;
    border-radius: 10px;
    background: #e0e0e0;
    box-shadow: 6px 6px 12px #bebebe, -6px -6px 12px #fff;
    transition: all 0.2s ease
}

.color-btn.active {
    box-shadow: inset 4px 4px 8px #bebebe, inset -4px -4px 8px #fff;
    transform: scale(.95)
}

.color-thumb {
    width: 35px;
    height: 35px;
    object-fit: cover;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 3px
}

#bgColorPalette .color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 5px
}

#textColorPalette1 .color-btn,
#textColorPalette2 .color-btn {
    margin: 2px
}

.sub-palette .color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-width: 40px
}

.sub-palette {
    background: #f1f3f5 !important;
    border: 1px dashed #ced4da
}

.inquiry-btn {
    width: 100%;
    padding: 18px;
    background-color: #007cba !important;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    border: none;
    border-radius: 5px;
    cursor: pointer
}

.inquiry-btn:hover {
    background-color: #005a87 !important
}

.mode-selector {
    background: #e1f5fe !important;
    border: 2px solid #007cba !important
}

.mode-label {
    display: block;
    margin: 10px 0;
    cursor: pointer;
    font-size: 14px
}

#custom-preview-root input[type="text"],
#custom-preview-root input[type="email"],
#custom-preview-root textarea {
    background-color: #f0f8ff !important;
    border: 1px solid #ccc !important;
    color: #333 !important
}

#custom-preview-root input:focus {
    background-color: #ffffff !important;
    border-color: #007cba !important;
    outline: none
}

#color-sample-gallery {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee
}

#color-sample-gallery img {
    width: calc(25% - 10px);
    max-width: 100px;
    height: auto;
    object-fit: contain;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .05)
}

@media (max-width:480px) {
    #color-sample-gallery img {
        width: calc(33.3% - 10px)
    }
}

#color-gallery-root {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    height: auto !important;
    padding: 15px !important;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 0
}

.gallery-item {
    width: calc(12.5% - 12px);
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
    display: block
}

.gallery-item div {
    font-size: 10px;
    margin-top: 4px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.gallery-item:hover {
    transform: scale(1.05)
}

.custom-product-catchphrase {
    margin: 20px auto;
    padding: 20px 25px;
    max-width: fit-content;
    min-width: 300px;
    text-align: left
}

.main-phrase {
    font-size: 2.4rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.3
}

.sub-phrase {
    font-size: 1.6rem;
    color: #666;
    margin: 0;
    line-height: 1.4
}

@media screen and (max-width:600px) {
    .main-phrase {
        font-size: 2.2rem
    }

    .sub-phrase {
        font-size: 1.5rem
    }

    .custom-product-catchphrase {
        margin: 15px auto;
        width: 98%;
        text-align: left
    }
}

@media (max-width:768px) {
    .preview-wrapper {
        flex-direction: column;
        gap: 10px
    }

    .controls {
        width: 100%;
        order: 2;
        padding: 8px
    }

    .control-group.section-border {
        padding: 12px;
        margin-top: 10px
    }

    #canvasContainer {
        order: 1;
        width: 100%
    }

    .gallery-item {
        width: calc(20% - 10px)
    }

    .gallery-item div {
        font-size: 13px
    }
}