/**
 * Simple builder storefront layout and toolbar skin.
 * Canvas core lives in builder.min.css; shared toolbar in builder-shared.css.
 *
 * @package CustomProductBuilderProWC
 */

/* Main Layout Grid — display:contents flattens legacy wrappers into grid tracks */
.cpbpwc-main-designer-container .wrapper-memes-main:not(.is-fullscreen),
#product-designer .wrapper-memes-main:not(.is-fullscreen),
.wrapper-memes-main:not(.is-fullscreen) {
    display: grid;
    width: 100%;
    grid-template-areas:
        "ops ops"
        "sidebar preview"
        "fill fill"
        "textboxes textboxes"
        "assets assets";
    grid-template-columns: 100px minmax(0, 1fr);
    overflow: visible;
    position: relative;
    z-index: 1;
}

/*
 * Legacy HTML nests ops inside .wrapper-memes-preview and
 * sidebar/cliparts inside .wrapper-memes-operations.
 * contents makes those children participate in the parent grid.
 */
.cpbpwc-main-designer-container .wrapper-memes-main > .wrapper-memes-preview,
.cpbpwc-main-designer-container .wrapper-memes-main > .wrapper-memes-operations,
.wrapper-memes-main > .wrapper-memes-preview,
.wrapper-memes-main > .wrapper-memes-operations {
    display: contents;
}

.wrapper-memes-main .advanced-options-operations-form {
    display: contents;
}

.cpbpwc-main-designer-container .wrapper-memes-main > .clear_both,
.wrapper-memes-main > .clear_both,
.wrapper-memes-main .form-generat-meme {
    display: none;
}

/* Keep chrome visible unless draw / text mode hides it */
.wrapper-memes-main .wrapper-memes-preview-operations {
    display: flex;
}

body:not(.cpb-drawing-mode) .wrapper-memes-main .view-images-memes-ar-amm {
    display: block;
}

body:not(.cpb-drawing-mode):not(.cpb-text-mode) .wrapper-memes-main .wrapper-amm-select-merge-images {
    display: block;
}

#product-designer:not(.cpbwc-empty-designer) {
    overflow: visible;
    position: relative;
}

/* Header Bar */
.wrapper-memes-preview-operations {
    grid-area: ops;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f7fe;
    margin-bottom: 10px;
    position: relative;
    z-index: 30;
    overflow: visible;
}

/* Keep layout helpers out of the icon row (they sat between Preview and Add TextBox) */
.wrapper-memes-preview-operations > .clear_both,
.wrapper-memes-preview-operations > .wrapper-amm-stop-brushes:not(.show) {
    display: none;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    flex: 0 0 0;
    border: 0;
}

.wrapper-memes-preview-operations > .wrapper-amm-stop-brushes.show {
    display: inline-flex;
    flex-basis: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto;
    height: 44px;
    margin: 0;
    margin-top: 0;
    padding: 0;
    line-height: 0;
    vertical-align: middle;
}

body.cpb-drawing-mode .wrapper-memes-preview-operations {
    justify-content: center;
}

body.cpb-drawing-mode .wrapper-memes-preview-operations > .wrapper-amm-stop-brushes.show {
    display: inline-flex;
    flex-basis: auto;
    width: auto;
    height: 44px;
    margin-top: 0;
    align-items: center;
}

/* Draw mode — Clear / Stop / brush color as icon toolbar buttons */
.wrapper-amm-stop-brushes #amm-clear-brush,
.wrapper-amm-stop-brushes #amm-stop-brushing {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    margin: 0;
    padding: 0;
    font-size: 0;
    line-height: 0;
    color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    cursor: pointer;
    float: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    top: 0;
    overflow: visible;
    box-sizing: border-box;
    vertical-align: middle;
    flex: 0 0 44px;
}

.wrapper-amm-stop-brushes #amm-clear-brush:hover,
.wrapper-amm-stop-brushes #amm-stop-brushing:hover {
    border-color: #3b82f6;
    background: #f8fbff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}

.wrapper-amm-stop-brushes #amm-clear-brush::before,
.wrapper-amm-stop-brushes #amm-stop-brushing::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    min-width: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.wrapper-amm-stop-brushes #amm-clear-brush::before {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(71, 85, 105)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M19 6l-1 14H6L5 6'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E");
}

.wrapper-amm-stop-brushes #amm-stop-brushing::before {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(71, 85, 105)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E");
}

/* Theme-proof color swatch (TT3 / block themes often shift native color inputs) */
.wrapper-amm-stop-brushes .amm-color-picker,
.wrapper-amm-stop-brushes input[type="color"].amm-color-picker,
.wrapper-amm-stop-brushes input[type="color"].colorSelectorBrushes {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: block;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    margin: 0;
    padding: 4px;
    border: 1px solid #94a3b8;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    background: #f8fafc;
    line-height: 0;
    font-size: 0;
    vertical-align: middle;
    align-self: center;
    flex: 0 0 44px;
    float: none;
    position: relative;
    top: 0;
    bottom: auto;
    transform: none;
    outline: none;
}

.wrapper-amm-stop-brushes .amm-color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
    box-sizing: border-box;
}

.wrapper-amm-stop-brushes .amm-color-picker::-webkit-color-swatch {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.wrapper-amm-stop-brushes .amm-color-picker::-moz-color-swatch {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.wrapper-amm-stop-brushes .clear_both {
    display: none;
}

#amm-preview-responsive,
.amm-preview-responsive,
.wrapper-memes-preview-operations #amm-preview-responsive {
    display: inline-flex;
    visibility: visible;
    opacity: 1;
}

/* Simple builder toolbar — icon-only action buttons */
#amm-merge-image-trigger,
#amm-brushes,
#amm-upload-image-meme-responsive,
#amm-preview-responsive,
#amm-download-image-responsive,
#amm-reset-responsive,
#amm-ai-creative-responsive,
.wrapper-memes-preview-operations .add_textbox,
#cpbpwc-back-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    padding: 0;
    font-size: 0;
    font-weight: 600;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    height: 44px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    position: relative;
    margin-top: 0;
    overflow: visible;
}

#amm-merge-image-trigger .text_value,
#amm-brushes .text_value,
#amm-upload-image-meme-responsive .text_value,
#amm-preview-responsive .text_value,
#amm-download-image-responsive .text_value,
#amm-reset-responsive .text_value,
#amm-ai-creative-responsive .text_value,
.wrapper-memes-preview-operations .add_textbox .text_value,
#amm-merge-image-trigger .glyphicon,
#amm-brushes .glyphicon,
#amm-upload-image-meme-responsive .glyphicon,
#amm-preview-responsive .glyphicon {
    display: none;
}

/* Tooltips: defined once in builder-shared.css */

#amm-merge-image-trigger:hover,
#amm-brushes:hover,
#amm-upload-image-meme-responsive:hover,
#amm-preview-responsive:hover,
#amm-download-image-responsive:hover,
#amm-reset-responsive:hover,
#amm-ai-creative-responsive:hover,
.wrapper-memes-preview-operations .add_textbox:hover,
#cpbpwc-back-btn:hover {
    border-color: #3b82f6;
    background: #f8fbff;
    color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}

/* SVG Icon Injection - Simple builder toolbar icons */
#amm-merge-image-trigger::before,
#amm-brushes::before,
#amm-upload-image-meme-responsive::before,
#amm-preview-responsive::before,
#amm-download-image-responsive::before,
#amm-reset-responsive::before,
#amm-ai-creative-responsive::before,
.wrapper-memes-preview-operations .add_textbox::before,
#cpbpwc-back-btn::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    min-width: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Merge Image Icon */
#amm-merge-image-trigger::before,
.wrapper-memes-preview-operations button:nth-child(1)::before,
.wrapper-memes-preview-operations .btn:nth-of-type(1)::before {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(71, 85, 105)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5'/%3E%3C/svg%3E");
}

/* Draw Icon */
#amm-brushes::before,
.wrapper-memes-preview-operations button:nth-child(2)::before,
.wrapper-memes-preview-operations .btn:nth-of-type(2)::before {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(71, 85, 105)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19l7-7 3 3-7 7-3-3z'/%3E%3Cpath d='M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z'/%3E%3Cpath d='M2 2l5 5'/%3E%3C/svg%3E");
}

/* Preview Icon */
#amm-preview-responsive::before,
.wrapper-memes-preview-operations button:nth-child(3)::before,
.wrapper-memes-preview-operations .btn:nth-of-type(3)::before {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(71, 85, 105)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

/* Add Template Icon */
.wrapper-memes-preview-operations button:nth-child(4)::before,
.wrapper-memes-preview-operations .btn:nth-of-type(4)::before {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(71, 85, 105)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='3' y1='9' x2='21' y2='9'/%3E%3Cline x1='9' y1='21' x2='9' y2='9'/%3E%3C/svg%3E");
}

/* Add Template Icon - by ID */
#amm-upload-image-meme-responsive::before {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(71, 85, 105)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='3' y1='9' x2='21' y2='9'/%3E%3Cline x1='9' y1='21' x2='9' y2='9'/%3E%3C/svg%3E");
}

/* Add TextBox Icon - by class */
.add_textbox::before {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(71, 85, 105)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 7 4 4 20 4 20 7'/%3E%3Cline x1='9' y1='20' x2='15' y2='20'/%3E%3Cline x1='12' y1='4' x2='12' y2='20'/%3E%3C/svg%3E");
}

/* Download Image Icon - by ID */
#amm-download-image-responsive::before {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(71, 85, 105)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
}

/* Reset Icon - by ID */
#amm-reset-responsive::before {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(71, 85, 105)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 4 1 10 7 10'/%3E%3Cpolyline points='23 20 23 14 17 14'/%3E%3Cpath d='M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15'/%3E%3C/svg%3E");
}

/* Back Button - by ID */
#cpbpwc-back-btn::before {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(71, 85, 105)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='19' y1='12' x2='5' y2='12'/%3E%3Cpolyline points='12 19 5 12 12 5'/%3E%3C/svg%3E");
}

#cpbpwc-back-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
}

#cpbpwc-back-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
}

#cpbpwc-back-btn:hover::before {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(59, 130, 246)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='19' y1='12' x2='5' y2='12'/%3E%3Cpolyline points='12 19 5 12 12 5'/%3E%3C/svg%3E");
}

/* Left Side Sidebar - Vertical Templates */
.view-images-memes-ar-amm {
    grid-area: sidebar;
    border-right: 1px solid #f1f7fe;
    padding-right: 15px;
    max-height: 382px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

.view-images-memes-ar-amm::-webkit-scrollbar {
    width: 6px;
}

.view-images-memes-ar-amm::-webkit-scrollbar-track {
    background: #f8fafc;
}

.view-images-memes-ar-amm::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 20px;
}

.view-images-memes-ar-amm .wrapper_thumbnail_meme {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
}

.wrapper_select_image_amm {
    cursor: pointer;
}

.wrapper_select_image_amm:hover {
    border-color: #3b82f6;
}

/* Transparent shape masks */
.wrapper-memes-main.cpbpwc-has-product-fill .wrapper_select_image_amm {
    background-color: #dbe3ee;
    background-image:
        linear-gradient(45deg, #c5d0de 25%, transparent 25%),
        linear-gradient(-45deg, #c5d0de 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #c5d0de 75%),
        linear-gradient(-45deg, transparent 75%, #c5d0de 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    box-sizing: border-box;
}

.wrapper-memes-main.cpbpwc-has-product-fill .wrapper_select_image_amm img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    background: transparent;
}

/* Canvas Box - Fixed Stretch */
.wrapper-memes-preview {
    width: 100%;
    max-width: 100%;
    grid-area: preview;
    background: none;
    border-radius: 12px;
    border: none;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 0;
    overflow: visible;
    position: relative;
    flex: 1 1 auto;
    box-sizing: border-box;
}

/* When preview uses display:contents, canvas wrapper owns the preview track */
.wrapper-memes-main #wrapper_canvas_background {
    grid-area: preview;
    width: 100%;
    max-width: 100%;
}

/* WooCommerce Style Fullscreen Trigger — desktop only */
.cpbpwc-fullscreen-trigger {
    position: absolute;
    top: 20px;
    right: 12px;
    z-index: 100;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

#wrapper_canvas_background > .cpbpwc-fullscreen-trigger {
    z-index: 110;
}

.cpbpwc-fullscreen-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.cpbpwc-fullscreen-trigger:focus {
    outline: none;
}

.cpbpwc-fullscreen-trigger:focus-visible {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
}

.cpbpwc-fullscreen-trigger::after {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cpolyline points='9 21 3 21 3 15'/%3E%3Cline x1='21' y1='3' x2='14' y2='10'/%3E%3Cline x1='3' y1='21' x2='10' y2='14'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Fullscreen = sidebar + canvas + cliparts (no top toolbars) */
.cpbpwc-main-designer-container .wrapper-memes-main.is-fullscreen,
#product-designer .wrapper-memes-main.is-fullscreen,
.wrapper-memes-main.is-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    max-height: none;
    z-index: 99998;
    background: #fff;
    padding: 52px 20px 24px;
    box-sizing: border-box;
    display: grid;
    grid-template-areas:
        "sidebar preview"
        "assets assets";
    grid-template-columns: 110px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 12px 16px;
    overflow: auto;
    margin: 0;
}

/* Hide both top bars in fullscreen: action icons + undo/zoom/view */
.wrapper-memes-main.is-fullscreen .wrapper-memes-preview-operations,
.wrapper-memes-main.is-fullscreen .cpb-canvas-toolbar-wrap,
.wrapper-memes-main.is-fullscreen .amm-text-boxes {
    display: none;
}

.wrapper-memes-main.is-fullscreen .view-images-memes-ar-amm {
    display: block;
    max-height: none;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 4px;
}

.wrapper-memes-main.is-fullscreen .wrapper-amm-select-merge-images {
    display: block;
    width: 100%;
}

.wrapper-memes-main.is-fullscreen .cpbpwc-fullscreen-trigger {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100001;
}

/* Sit below WP admin bar so top thumbs/canvas are not clipped */
body.admin-bar .wrapper-memes-main.is-fullscreen {
    top: 32px;
    bottom: 0;
    height: auto;
    max-height: none;
    padding-top: 16px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .wrapper-memes-main.is-fullscreen {
        top: 46px;
        padding-top: 12px;
    }
}

body.admin-bar .wrapper-memes-main.is-fullscreen .cpbpwc-fullscreen-trigger {
    top: 48px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .wrapper-memes-main.is-fullscreen .cpbpwc-fullscreen-trigger {
        top: 62px;
    }
}

.wrapper-memes-main.is-fullscreen #wrapper_canvas_background {
    grid-area: preview;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.wrapper-memes-main.is-fullscreen .cpb-canvas-zoom-root {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wrapper-memes-main.is-fullscreen .wrapper_canvas {
    width: auto;
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto;
}

.wrapper-memes-main.is-fullscreen canvas.amm_canvas {
    max-width: 100%;
    max-height: calc(100dvh - 200px);
    width: auto;
    height: auto;
}

body.admin-bar .wrapper-memes-main.is-fullscreen canvas.amm_canvas {
    max-height: calc(100dvh - 232px);
}

.wrapper-memes-main.is-fullscreen .cpbpwc-fullscreen-trigger::after {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 14 10 14 10 20'/%3E%3Cpolyline points='20 10 14 10 14 4'/%3E%3Cline x1='14' y1='10' x2='21' y2='3'/%3E%3Cline x1='3' y1='21' x2='10' y2='14'/%3E%3C/svg%3E");
}

#wrapper_canvas_background {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 280px;
    flex: 1 1 auto;
    height: auto;
    position: relative;
    overflow: hidden;
}

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

/* Logos at Bottom - Horizontal Line */
.wrapper-amm-select-merge-images {
    grid-area: assets;
    border-top: 1px solid #f1f7fe;
    padding-top: 10px;
    margin-top: 0px;
    width: 100%;
}

/* Background fill swatches — under canvas, above cliparts */
.wrapper-memes-main > .cpb-product-fill-panel {
    grid-area: fill;
    width: 100%;
    margin: 8px 0 0;
    box-sizing: border-box;
}

.wrapper-thumbnail-merge-images {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.wrapper-select-merge-image-amm {
    width: 73px;
    height: 69px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.wrapper-select-merge-image-amm:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.cpbpwc-remove-text {
    width: 32px;
    height: 32px;
    background: #ffffff;
    color: #64748b;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    font-weight: bold;
}

/* Text Boxes Container - Show and Style */
.amm-text-boxes {
    grid-area: textboxes;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    margin: 10px 0 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
}

/* Textbox Collapse/Expand Header */
.cpbpwc-textbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    width: 100%;
}

.cpbpwc-textbox-header:hover {
    background: #eff6ff;
    border-color: #3b82f6;
}

.cpbpwc-textbox-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cpbpwc-textbox-toggle {
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cpbpwc-textbox-toggle:hover {
    background: #3b82f6;
    border-color: #3b82f6;
}

.cpbpwc-textbox-toggle::after {
    content: "";
    display: block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(71, 85, 105)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.cpbpwc-textbox-toggle:hover::after {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.cpbpwc-textbox-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: none;
    overflow: visible;
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* Only scroll when many text boxes are stacked */
.cpbpwc-textbox-container:has(.wrapper-text:nth-child(4)) {
    max-height: 360px;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 4px;
    padding-bottom: 8px;
}

.cpbpwc-textbox-container::-webkit-scrollbar {
    width: 6px;
}

.cpbpwc-textbox-container::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 10px;
}

.cpbpwc-textbox-container::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.cpbpwc-textbox-container.collapsed {
    display: none;
}

.amm-text-boxes.collapsed .cpbpwc-textbox-toggle::after {
    transform: rotate(-90deg);
}

/* Individual Text Box Wrapper */
.wrapper-text {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: visible;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    float: none;
    height: auto;
    max-height: none;
}

.wrapper-text:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wrapper-text .clear_both {
    display: none;
}

/* Text Area Styling */
.wrapper-text textarea.amm-text,
.wrapper-text input.amm-text,
.wrapper-text .amm-text {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: none;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    resize: none;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.3;
    background: #fff;
    color: #1e293b;
    overflow: hidden;
}

.wrapper-text textarea.amm-text:focus,
.wrapper-text input.amm-text:focus,
.wrapper-text .amm-text:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #fefefe;
}

/* Color Pickers */
.wrapper-text input[type="color"] {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 8px;
    cursor: pointer;
    padding: 3px;
    margin: 0;
    box-sizing: border-box;
    flex-shrink: 0;
}

.wrapper-text input[type="color"]:hover {
    border-color: #3b82f6;
}

/* Outline Width Input */
.wrapper-text input[type="number"].ow,
.wrapper-text .fontOps .ow {
    width: 34px;
    min-width: 34px;
    height: 32px;
    margin: 0;
    padding: 2px 4px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
    text-align: center;
    flex-shrink: 0;
    background: #ffffff;
    color: #1e293b;
    font-size: 13px;
    line-height: 1.2;
    -moz-appearance: textfield;
    appearance: textfield;
}

.wrapper-text .fontOps .ow::-webkit-outer-spin-button,
.wrapper-text .fontOps .ow::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* More Options Button */
.wrapper-text .moreOption {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    width: 32px;
    min-width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    float: none;
}

.wrapper-text .moreOption:hover,
.wrapper-text .moreOption.opened {
    border-color: #3b82f6;
    background: #f8fbff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wrapper-text .moreOption::before {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(71, 85, 105)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.wrapper-text .moreOption.opened::before {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(59, 130, 246)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/svg%3E");
}

/* Font options — compact control group */
.wrapper-text .fontOps {
    float: none;
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    max-width: none;
    height: 40px;
    max-height: 40px;
    margin: 0;
    padding: 4px 6px 4px 8px;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-sizing: border-box;
    overflow: visible;
}

/* Remove button — sits inside fontOps with the other controls */
.wrapper-text .cpbpwc-remove-text,
.wrapper-text .fontOps .cpbpwc-remove-text {
    position: static;
    top: auto;
    right: auto;
    transform: none;
    width: 32px;
    min-width: 32px;
    height: 32px;
    margin: 0;
    margin-left: 2px;
    padding: 0;
    background: #ffffff;
    color: #64748b;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    font-weight: 600;
    font-size: 0;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    z-index: 2;
    flex-shrink: 0;
    box-sizing: border-box;
}

.wrapper-text .cpbpwc-remove-text svg {
    display: block;
    width: 14px;
    height: 14px;
}

.wrapper-text .cpbpwc-remove-text:hover,
.wrapper-text .fontOps .cpbpwc-remove-text:hover {
	background: #fff5f5;
	border-color: #fca5a5;
	color: #ef4444;
	transform: none;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

@media (max-width: 640px) {
    .wrapper-text {
        flex-wrap: wrap;
        padding: 12px;
        gap: 8px;
    }

    .wrapper-text textarea.amm-text,
    .wrapper-text input.amm-text,
    .wrapper-text .amm-text {
        flex: 1 1 100%;
        width: 100%;
    }

    .wrapper-text .fontOps {
        flex: 1 1 auto;
        width: 100%;
        justify-content: flex-start;
    }
}

/* Simple builder mobile layout */
@media (max-width: 900px) {
    .cpbpwc-main-designer-container,
    #product-designer.cpbpwc-simple-layout-ready,
    #product-designer {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0 8px;
        box-sizing: border-box;
    }

    /*
     * Stack vertically. Beat desktop
     * .cpbpwc-main-designer-container .wrapper-memes-main:not(.is-fullscreen)
     */
    .cpbpwc-main-designer-container .wrapper-memes-main:not(.is-fullscreen),
    #product-designer .wrapper-memes-main:not(.is-fullscreen),
    .wrapper-memes-main.cpbpwc-simple-layout-ready:not(.is-fullscreen),
    html.cpbpwc-mobile-layout .wrapper-memes-main:not(.is-fullscreen),
    body.cpbpwc-mobile-layout .wrapper-memes-main:not(.is-fullscreen) {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        max-width: 100%;
        gap: 8px;
        grid-template-areas: none;
        grid-template-columns: none;
        grid-template-rows: none;
    }

    /* Undo desktop display:contents so flex order works */
    .cpbpwc-main-designer-container .wrapper-memes-main:not(.is-fullscreen) > .wrapper-memes-preview,
    #product-designer .wrapper-memes-main:not(.is-fullscreen) > .wrapper-memes-preview,
    .wrapper-memes-main.cpbpwc-simple-layout-ready:not(.is-fullscreen) > .wrapper-memes-preview,
    html.cpbpwc-mobile-layout .wrapper-memes-main:not(.is-fullscreen) > .wrapper-memes-preview,
    body.cpbpwc-mobile-layout .wrapper-memes-main:not(.is-fullscreen) > .wrapper-memes-preview {
        display: flex;
        flex-direction: column;
        align-items: center;
        order: 2;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 4px 0;
        box-sizing: border-box;
        flex: 0 0 auto;
    }

    /* Empty shell only — hide after JS relocates sidebar/cliparts out of it */
    .cpbpwc-main-designer-container .wrapper-memes-main.cpbpwc-simple-layout-ready:not(.is-fullscreen) > .wrapper-memes-operations,
    #product-designer .wrapper-memes-main.cpbpwc-simple-layout-ready:not(.is-fullscreen) > .wrapper-memes-operations,
    .wrapper-memes-main.cpbpwc-simple-layout-ready:not(.is-fullscreen) > .wrapper-memes-operations {
        display: none;
    }

    /* Icon + canvas toolbars — overflow must stay visible so Front menu is not clipped */
    .cpbpwc-main-designer-container .wrapper-memes-preview-operations,
    #product-designer .wrapper-memes-preview-operations,
    .wrapper-memes-main.cpbpwc-simple-layout-ready > .wrapper-memes-preview-operations,
    html.cpbpwc-mobile-layout .wrapper-memes-preview-operations,
    body.cpbpwc-mobile-layout .wrapper-memes-preview-operations {
        order: 1;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        margin: 0 0 10px;
        padding: 8px 0 10px;
        border-bottom: 1px solid #e2e8f0;
        overflow: visible;
        box-sizing: border-box;
        position: relative;
        z-index: 40;
    }

    /* Touch / mobile: hide hover tooltips (sticky :hover overlaps Front row) */
    .cpbpwc-main-designer-container .wrapper-memes-preview-operations [data-cpb-tooltip]::after,
    #product-designer .wrapper-memes-preview-operations [data-cpb-tooltip]::after,
    html.cpbpwc-mobile-layout .wrapper-memes-preview-operations [data-cpb-tooltip]::after,
    body.cpbpwc-mobile-layout .wrapper-memes-preview-operations [data-cpb-tooltip]::after {
        content: none;
        display: none;
    }

    .cpbpwc-main-designer-container .wrapper-memes-preview-operations::-webkit-scrollbar,
    #product-designer .wrapper-memes-preview-operations::-webkit-scrollbar,
    html.cpbpwc-mobile-layout .wrapper-memes-preview-operations::-webkit-scrollbar,
    body.cpbpwc-mobile-layout .wrapper-memes-preview-operations::-webkit-scrollbar {
        display: none;
    }

    .cpbpwc-main-designer-container .wrapper-memes-preview-operations > .btn,
    .cpbpwc-main-designer-container .wrapper-memes-preview-operations > button,
    .cpbpwc-main-designer-container .wrapper-memes-preview-operations > .add_textbox,
    .cpbpwc-main-designer-container .wrapper-memes-preview-operations > #cpbpwc-back-btn,
    #product-designer .wrapper-memes-preview-operations > .btn,
    #product-designer .wrapper-memes-preview-operations > button,
    #product-designer .wrapper-memes-preview-operations > .add_textbox,
    #product-designer .wrapper-memes-preview-operations > #cpbpwc-back-btn,
    html.cpbpwc-mobile-layout .wrapper-memes-preview-operations > .btn,
    html.cpbpwc-mobile-layout .wrapper-memes-preview-operations > button,
    html.cpbpwc-mobile-layout .wrapper-memes-preview-operations > .add_textbox,
    html.cpbpwc-mobile-layout .wrapper-memes-preview-operations > #cpbpwc-back-btn,
    body.cpbpwc-mobile-layout .wrapper-memes-preview-operations > .btn,
    body.cpbpwc-mobile-layout .wrapper-memes-preview-operations > button,
    body.cpbpwc-mobile-layout .wrapper-memes-preview-operations > .add_textbox,
    body.cpbpwc-mobile-layout .wrapper-memes-preview-operations > #cpbpwc-back-btn {
        width: 40px;
        min-width: 40px;
        max-width: 40px;
        height: 40px;
        min-height: 40px;
        flex: 0 0 40px;
        margin: 0;
    }

    .cpbpwc-main-designer-container .wrapper-memes-preview-operations > .cpb-canvas-toolbar-wrap,
    #product-designer .wrapper-memes-preview-operations > .cpb-canvas-toolbar-wrap,
    html.cpbpwc-mobile-layout .wrapper-memes-preview-operations > .cpb-canvas-toolbar-wrap,
    body.cpbpwc-mobile-layout .wrapper-memes-preview-operations > .cpb-canvas-toolbar-wrap {
        flex: 1 0 100%;
        width: 100%;
        max-width: 100%;
        padding: 8px 0 4px;
        margin: 0 0 4px;
        border: none;
        box-sizing: border-box;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
        z-index: 50;
    }

    .cpbpwc-main-designer-container .cpb-side-select-wrap,
    .cpbpwc-main-designer-container .cpb-side-select-ui,
    .cpbpwc-main-designer-container .cpb-side-select-menu,
    #product-designer .cpb-side-select-wrap,
    #product-designer .cpb-side-select-ui,
    #product-designer .cpb-side-select-menu,
    html.cpbpwc-mobile-layout .cpb-side-select-wrap,
    html.cpbpwc-mobile-layout .cpb-side-select-ui,
    html.cpbpwc-mobile-layout .cpb-side-select-menu,
    body.cpbpwc-mobile-layout .cpb-side-select-wrap,
    body.cpbpwc-mobile-layout .cpb-side-select-ui,
    body.cpbpwc-mobile-layout .cpb-side-select-menu {
        overflow: visible;
        z-index: 60;
    }

    .cpbpwc-main-designer-container .cpb-side-select-menu.is-open,
    #product-designer .cpb-side-select-menu.is-open,
    html.cpbpwc-mobile-layout .cpb-side-select-menu.is-open,
    body.cpbpwc-mobile-layout .cpb-side-select-menu.is-open {
        z-index: 70;
    }

    .cpbpwc-main-designer-container .cpbpwc-new-tag,
    #product-designer .cpbpwc-new-tag,
    html.cpbpwc-mobile-layout .cpbpwc-new-tag,
    body.cpbpwc-mobile-layout .cpbpwc-new-tag {
        top: -4px;
        right: -4px;
        font-size: 7px;
        padding: 1px 3px;
    }

    /* Fullscreen arrow — mobile only hide */
    .cpbpwc-main-designer-container .cpbpwc-fullscreen-trigger,
    #product-designer .cpbpwc-fullscreen-trigger,
    html.cpbpwc-mobile-layout .cpbpwc-fullscreen-trigger,
    body.cpbpwc-mobile-layout .cpbpwc-fullscreen-trigger {
        display: none;
    }

    .cpbpwc-main-designer-container .cpb-tbar-btn,
    #product-designer .cpb-tbar-btn,
    html.cpbpwc-mobile-layout .cpb-tbar-btn,
    body.cpbpwc-mobile-layout .cpb-tbar-btn {
        width: 34px;
        height: 34px;
    }

    .cpbpwc-main-designer-container .cpb-canvas-toolbar .cpb-remove-bg-btn.cpb-tbar-btn,
    #product-designer .cpb-canvas-toolbar .cpb-remove-bg-btn.cpb-tbar-btn,
    html.cpbpwc-mobile-layout .cpb-canvas-toolbar .cpb-remove-bg-btn.cpb-tbar-btn,
    body.cpbpwc-mobile-layout .cpb-canvas-toolbar .cpb-remove-bg-btn.cpb-tbar-btn {
        width: 34px;
        min-width: 34px;
        max-width: 34px;
        height: 34px;
        padding: 0;
        gap: 0;
        flex: 0 0 34px;
        margin: 0;
    }

    .cpbpwc-main-designer-container .cpb-canvas-toolbar .cpb-remove-bg-btn .cpb-remove-bg-label,
    #product-designer .cpb-canvas-toolbar .cpb-remove-bg-btn .cpb-remove-bg-label,
    html.cpbpwc-mobile-layout .cpb-canvas-toolbar .cpb-remove-bg-btn .cpb-remove-bg-label,
    body.cpbpwc-mobile-layout .cpb-canvas-toolbar .cpb-remove-bg-btn .cpb-remove-bg-label {
        display: none;
    }

    .cpbpwc-main-designer-container .cpb-canvas-toolbar,
    #product-designer .cpb-canvas-toolbar,
    html.cpbpwc-mobile-layout .cpb-canvas-toolbar,
    body.cpbpwc-mobile-layout .cpb-canvas-toolbar {
        display: inline-flex;
        flex-wrap: nowrap;
        justify-content: center;
        flex: 0 0 auto;
        width: max-content;
        max-width: none;
        margin: 0 auto;
    }

    .cpbpwc-main-designer-container .wrapper-amm-stop-brushes.show,
    #product-designer .wrapper-amm-stop-brushes.show,
    html.cpbpwc-mobile-layout .wrapper-amm-stop-brushes.show,
    body.cpbpwc-mobile-layout .wrapper-amm-stop-brushes.show {
        height: 40px;
        gap: 8px;
    }

    .cpbpwc-main-designer-container .wrapper-amm-stop-brushes #amm-clear-brush,
    .cpbpwc-main-designer-container .wrapper-amm-stop-brushes #amm-stop-brushing,
    .cpbpwc-main-designer-container .wrapper-amm-stop-brushes .amm-color-picker,
    #product-designer .wrapper-amm-stop-brushes #amm-clear-brush,
    #product-designer .wrapper-amm-stop-brushes #amm-stop-brushing,
    #product-designer .wrapper-amm-stop-brushes .amm-color-picker,
    html.cpbpwc-mobile-layout .wrapper-amm-stop-brushes #amm-clear-brush,
    html.cpbpwc-mobile-layout .wrapper-amm-stop-brushes #amm-stop-brushing,
    html.cpbpwc-mobile-layout .wrapper-amm-stop-brushes .amm-color-picker,
    body.cpbpwc-mobile-layout .wrapper-amm-stop-brushes #amm-clear-brush,
    body.cpbpwc-mobile-layout .wrapper-amm-stop-brushes #amm-stop-brushing,
    body.cpbpwc-mobile-layout .wrapper-amm-stop-brushes .amm-color-picker {
        width: 40px;
        min-width: 40px;
        max-width: 40px;
        height: 40px;
        min-height: 40px;
    }

    /* Canvas stage — full width (not beside thumbs) */
    .cpbpwc-main-designer-container #wrapper_canvas_background,
    #product-designer #wrapper_canvas_background,
    .wrapper-memes-main.cpbpwc-simple-layout-ready #wrapper_canvas_background,
    html.cpbpwc-mobile-layout #wrapper_canvas_background,
    body.cpbpwc-mobile-layout #wrapper_canvas_background {
        grid-area: auto;
        width: 100%;
        max-width: 100%;
        min-height: 220px;
        overflow: hidden;
    }

    .cpbpwc-main-designer-container .wrapper_canvas,
    #product-designer .wrapper_canvas,
    html.cpbpwc-mobile-layout .wrapper_canvas,
    body.cpbpwc-mobile-layout .wrapper_canvas {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }

    .cpbpwc-main-designer-container .wrapper_canvas canvas,
    .cpbpwc-main-designer-container .amm_canvas,
    #product-designer .wrapper_canvas canvas,
    #product-designer .amm_canvas,
    html.cpbpwc-mobile-layout .wrapper_canvas canvas,
    html.cpbpwc-mobile-layout .amm_canvas,
    body.cpbpwc-mobile-layout .wrapper_canvas canvas,
    body.cpbpwc-mobile-layout .amm_canvas {
        max-width: 100%;
        height: auto;
    }

    /* Color thumbs — horizontal strip UNDER canvas */
    .cpbpwc-main-designer-container .view-images-memes-ar-amm,
    #product-designer .view-images-memes-ar-amm,
    .wrapper-memes-main.cpbpwc-simple-layout-ready > .view-images-memes-ar-amm,
    html.cpbpwc-mobile-layout .view-images-memes-ar-amm,
    body.cpbpwc-mobile-layout .view-images-memes-ar-amm {
        order: 3;
        grid-area: auto;
        display: block;
        width: 100%;
        max-width: 100%;
        max-height: none;
        border-right: none;
        border-top: 1px solid #e2e8f0;
        padding: 8px 0;
        margin: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        box-sizing: border-box;
        background: #ffffff;
    }

    .cpbpwc-main-designer-container .wrapper-memes-main > .cpb-product-fill-panel,
    #product-designer .wrapper-memes-main > .cpb-product-fill-panel,
    .wrapper-memes-main.cpbpwc-simple-layout-ready > .cpb-product-fill-panel,
    html.cpbpwc-mobile-layout .wrapper-memes-main > .cpb-product-fill-panel,
    body.cpbpwc-mobile-layout .wrapper-memes-main > .cpb-product-fill-panel {
        order: 4;
        grid-area: auto;
        width: 100%;
        margin: 8px 0;
    }

    .cpbpwc-main-designer-container .view-images-memes-ar-amm::-webkit-scrollbar,
    #product-designer .view-images-memes-ar-amm::-webkit-scrollbar,
    html.cpbpwc-mobile-layout .view-images-memes-ar-amm::-webkit-scrollbar,
    body.cpbpwc-mobile-layout .view-images-memes-ar-amm::-webkit-scrollbar {
        display: none;
    }

    .cpbpwc-main-designer-container .view-images-memes-ar-amm .wrapper_thumbnail_meme,
    #product-designer .view-images-memes-ar-amm .wrapper_thumbnail_meme,
    html.cpbpwc-mobile-layout .view-images-memes-ar-amm .wrapper_thumbnail_meme,
    body.cpbpwc-mobile-layout .view-images-memes-ar-amm .wrapper_thumbnail_meme {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        width: max-content;
        max-width: none;
        padding: 0;
    }

    .cpbpwc-main-designer-container .wrapper_select_image_amm,
    #product-designer .wrapper_select_image_amm,
    html.cpbpwc-mobile-layout .wrapper_select_image_amm,
    body.cpbpwc-mobile-layout .wrapper_select_image_amm {
        flex: 0 0 64px;
        width: 64px;
        min-width: 64px;
        max-width: 64px;
        height: 64px;
        margin: 0;
        box-sizing: border-box;
    }

    .cpbpwc-main-designer-container .wrapper_select_image_amm img,
    #product-designer .wrapper_select_image_amm img,
    html.cpbpwc-mobile-layout .wrapper_select_image_amm img,
    body.cpbpwc-mobile-layout .wrapper_select_image_amm img {
        width: 100%;
        height: 100%;
        max-width: 100%;
        object-fit: contain;
    }

    /* Text boxes */
    .cpbpwc-main-designer-container .amm-text-boxes,
    #product-designer .amm-text-boxes,
    .wrapper-memes-main.cpbpwc-simple-layout-ready > .amm-text-boxes,
    html.cpbpwc-mobile-layout .amm-text-boxes,
    body.cpbpwc-mobile-layout .amm-text-boxes {
        order: 5;
        grid-area: auto;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    .cpbpwc-main-designer-container .cpbpwc-textbox-header,
    #product-designer .cpbpwc-textbox-header,
    html.cpbpwc-mobile-layout .cpbpwc-textbox-header,
    body.cpbpwc-mobile-layout .cpbpwc-textbox-header {
        padding: 10px 12px;
        margin-bottom: 8px;
    }

    .cpbpwc-main-designer-container .wrapper-text,
    #product-designer .wrapper-text,
    html.cpbpwc-mobile-layout .wrapper-text,
    body.cpbpwc-mobile-layout .wrapper-text {
        flex-wrap: wrap;
        padding: 12px;
        gap: 8px;
    }

    .cpbpwc-main-designer-container .wrapper-text textarea.amm-text,
    .cpbpwc-main-designer-container .wrapper-text .amm-text,
    #product-designer .wrapper-text textarea.amm-text,
    #product-designer .wrapper-text .amm-text,
    html.cpbpwc-mobile-layout .wrapper-text textarea.amm-text,
    html.cpbpwc-mobile-layout .wrapper-text .amm-text,
    body.cpbpwc-mobile-layout .wrapper-text textarea.amm-text,
    body.cpbpwc-mobile-layout .wrapper-text .amm-text {
        flex: 1 1 100%;
        width: 100%;
    }

    .cpbpwc-main-designer-container .wrapper-text .fontOps,
    #product-designer .wrapper-text .fontOps,
    html.cpbpwc-mobile-layout .wrapper-text .fontOps,
    body.cpbpwc-mobile-layout .wrapper-text .fontOps {
        flex: 1 1 auto;
        width: auto;
        max-width: 100%;
    }

    /* Clipart grid */
    .cpbpwc-main-designer-container .wrapper-amm-select-merge-images,
    #product-designer .wrapper-amm-select-merge-images,
    .wrapper-memes-main.cpbpwc-simple-layout-ready > .wrapper-amm-select-merge-images,
    html.cpbpwc-mobile-layout .wrapper-amm-select-merge-images,
    body.cpbpwc-mobile-layout .wrapper-amm-select-merge-images {
        order: 6;
        grid-area: auto;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 8px 0;
        border-top: 1px solid #e2e8f0;
        box-sizing: border-box;
    }

    .cpbpwc-main-designer-container .wrapper-thumbnail-merge-images,
    #product-designer .wrapper-thumbnail-merge-images,
    html.cpbpwc-mobile-layout .wrapper-thumbnail-merge-images,
    body.cpbpwc-mobile-layout .wrapper-thumbnail-merge-images {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
        justify-content: stretch;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .cpbpwc-main-designer-container .wrapper-select-merge-image-amm,
    #product-designer .wrapper-select-merge-image-amm,
    html.cpbpwc-mobile-layout .wrapper-select-merge-image-amm,
    body.cpbpwc-mobile-layout .wrapper-select-merge-image-amm {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        min-width: 0;
        padding: 2px;
        box-sizing: border-box;
    }

    .cpbpwc-main-designer-container .wrapper-select-merge-image-amm img,
    #product-designer .wrapper-select-merge-image-amm img,
    html.cpbpwc-mobile-layout .wrapper-select-merge-image-amm img,
    body.cpbpwc-mobile-layout .wrapper-select-merge-image-amm img {
        width: 100%;
        height: 100%;
        max-width: 100%;
        object-fit: contain;
    }

    .cpbpwc-main-designer-container .cpb-side-select-wrap,
    #product-designer .cpb-side-select-wrap,
    html.cpbpwc-mobile-layout .cpb-side-select-wrap,
    body.cpbpwc-mobile-layout .cpb-side-select-wrap {
        max-width: 100%;
    }

    /* Fullscreen mobile — canvas + thumbs + cliparts only */
    .cpbpwc-main-designer-container .wrapper-memes-main.is-fullscreen,
    #product-designer .wrapper-memes-main.is-fullscreen,
    html.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen,
    body.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen {
        display: flex;
        flex-direction: column;
        grid-template-areas: none;
        grid-template-columns: none;
        grid-template-rows: none;
        gap: 8px;
        overflow: auto;
        padding: 10px;
    }

    .cpbpwc-main-designer-container .wrapper-memes-main.is-fullscreen > .wrapper-memes-preview,
    #product-designer .wrapper-memes-main.is-fullscreen > .wrapper-memes-preview,
    html.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen > .wrapper-memes-preview,
    body.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen > .wrapper-memes-preview {
        display: flex;
        flex-direction: column;
        order: 1;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
    }

    .cpbpwc-main-designer-container .wrapper-memes-main.is-fullscreen > .wrapper-memes-operations,
    #product-designer .wrapper-memes-main.is-fullscreen > .wrapper-memes-operations,
    html.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen > .wrapper-memes-operations,
    body.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen > .wrapper-memes-operations {
        display: contents;
    }

    .cpbpwc-main-designer-container .wrapper-memes-main.is-fullscreen .wrapper-memes-preview-operations,
    .cpbpwc-main-designer-container .wrapper-memes-main.is-fullscreen .cpb-canvas-toolbar-wrap,
    .cpbpwc-main-designer-container .wrapper-memes-main.is-fullscreen .amm-text-boxes,
    #product-designer .wrapper-memes-main.is-fullscreen .wrapper-memes-preview-operations,
    #product-designer .wrapper-memes-main.is-fullscreen .cpb-canvas-toolbar-wrap,
    #product-designer .wrapper-memes-main.is-fullscreen .amm-text-boxes,
    html.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen .wrapper-memes-preview-operations,
    html.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen .cpb-canvas-toolbar-wrap,
    html.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen .amm-text-boxes,
    body.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen .wrapper-memes-preview-operations,
    body.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen .cpb-canvas-toolbar-wrap,
    body.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen .amm-text-boxes {
        display: none;
    }

    .cpbpwc-main-designer-container .wrapper-memes-main.is-fullscreen .view-images-memes-ar-amm,
    #product-designer .wrapper-memes-main.is-fullscreen .view-images-memes-ar-amm,
    html.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen .view-images-memes-ar-amm,
    body.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen .view-images-memes-ar-amm {
        order: 2;
        display: block;
        max-height: 88px;
        overflow-x: auto;
        width: 100%;
    }

    .cpbpwc-main-designer-container .wrapper-memes-main.is-fullscreen .wrapper-amm-select-merge-images,
    #product-designer .wrapper-memes-main.is-fullscreen .wrapper-amm-select-merge-images,
    html.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen .wrapper-amm-select-merge-images,
    body.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen .wrapper-amm-select-merge-images {
        order: 3;
        display: block;
        width: 100%;
    }

    .cpbpwc-main-designer-container .wrapper-memes-main.is-fullscreen canvas.amm_canvas,
    #product-designer .wrapper-memes-main.is-fullscreen canvas.amm_canvas,
    html.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen canvas.amm_canvas,
    body.cpbpwc-mobile-layout .wrapper-memes-main.is-fullscreen canvas.amm_canvas {
        max-height: calc(100dvh - 220px);
    }
}

@media (max-width: 480px) {
    .cpbpwc-main-designer-container .wrapper-thumbnail-merge-images,
    #product-designer .wrapper-thumbnail-merge-images,
    html.cpbpwc-mobile-layout .wrapper-thumbnail-merge-images,
    body.cpbpwc-mobile-layout .wrapper-thumbnail-merge-images {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 5px;
    }

    .cpbpwc-main-designer-container .wrapper_select_image_amm,
    #product-designer .wrapper_select_image_amm,
    html.cpbpwc-mobile-layout .wrapper_select_image_amm,
    body.cpbpwc-mobile-layout .wrapper_select_image_amm {
        flex: 0 0 56px;
        width: 56px;
        min-width: 56px;
        max-width: 56px;
        height: 56px;
    }

    .cpbpwc-main-designer-container .wrapper-memes-preview-operations > .btn,
    .cpbpwc-main-designer-container .wrapper-memes-preview-operations > button,
    .cpbpwc-main-designer-container .wrapper-memes-preview-operations > .add_textbox,
    #product-designer .wrapper-memes-preview-operations > .btn,
    #product-designer .wrapper-memes-preview-operations > button,
    #product-designer .wrapper-memes-preview-operations > .add_textbox,
    html.cpbpwc-mobile-layout .wrapper-memes-preview-operations > .btn,
    html.cpbpwc-mobile-layout .wrapper-memes-preview-operations > button,
    html.cpbpwc-mobile-layout .wrapper-memes-preview-operations > .add_textbox,
    body.cpbpwc-mobile-layout .wrapper-memes-preview-operations > .btn,
    body.cpbpwc-mobile-layout .wrapper-memes-preview-operations > button,
    body.cpbpwc-mobile-layout .wrapper-memes-preview-operations > .add_textbox {
        width: 38px;
        min-width: 38px;
        max-width: 38px;
        height: 38px;
        flex: 0 0 38px;
    }
}

/* Order Details & Thank You Page Styles */
.cpbpwc-order-design {
    margin: 20px 0;
    clear: both;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cpbpwc-order-design strong {
    color: #1e293b;
    font-size: 16px;
    display: block;
    margin-bottom: 10px;
}

.cpbpwc-order-design img {
    border-radius: 8px;
    background: #fff;
    transition: transform 0.2s;
    border: 1px solid #e2e8f0;
}

.cpbpwc-order-design img:hover {
    transform: scale(1.01);
}

.cpbpwc-order-item-design-preview {
    display: inline-block;
    vertical-align: top;
    margin-top: 5px;
}

.cpbpwc-order-item-design-preview img {
    border-radius: 4px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

/* More Options Popup - Premium Design */
.wrapperRenderPopupMoreOptions {
    position: fixed;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    padding: 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    min-width: max-content;
    animation: cpbFadeInUp 0.2s ease-out forwards;
    width: auto;
    margin: 0 0 0 98px;
}

@keyframes cpbFadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Common group styling for labels and inputs */
.wrapperRenderPopupMoreOptions>div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

/* Checkbox groups handling */
.wrapperRenderPopupMoreOptions div:has(input[type="checkbox"]) {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding-top: 18px;
    display: flex;
}

/* Handle specific library structure if labels are inside divs with inputs */
.wrapperRenderPopupMoreOptions label {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    margin: 0;
    white-space: nowrap;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Select Styling */
.wrapperRenderPopupMoreOptions select,
.wrapperRenderPopupMoreOptions .InputFontFamily {
    height: 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 13px;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
    min-width: 140px;
    cursor: pointer;
}

/* Number Input Styling */
.wrapperRenderPopupMoreOptions input[type="number"],
.wrapperRenderPopupMoreOptions .InputFontSize {
    height: 36px;
    width: 60px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 8px;
    font-size: 13px;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
}

/* Checkbox Styling */
.wrapperRenderPopupMoreOptions input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
    margin: 0;
}

/* Hover effects for inputs */
.wrapperRenderPopupMoreOptions select:hover,
.wrapperRenderPopupMoreOptions input:hover {
    border-color: #cbd5e1;
}

.wrapperRenderPopupMoreOptions select:focus,
.wrapperRenderPopupMoreOptions input:focus {
    border-color: #3b82f6;
    background: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wrapperRenderPopupMoreOptions {
        flex-wrap: wrap;
        max-width: 300px;
        gap: 15px;
    }
}

/* Block Cart & Checkout Custom Image Support */
.wc-block-cart-item__image img.cpbpwc-designed-image,
.wc-block-components-product-image.cpbpwc-designed-image,
.wc-block-components-order-summary-item__image img,
.wc-block-checkout-order-summary img {
    object-fit: contain;
    max-width: 100%;
    height: auto;
}

/* Spinner Animation */
@keyframes cpbpwc-spin {
    0% {
        transform: rotate(0deg);
    }

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

.cpbpwc-loader {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    animation: cpbpwc-spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    position: relative;
    top: -1px;
}

/* Saved design preview on product page */
.cpbpwc-design-preview-mode {
	position: relative;
	display: inline-block;
	width: 100%;
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 20px;
}

.cpbpwc-design-preview-mode .cpbpwc-design-static-image,
.cpbpwc-design-static-image {
	width: 100%;
	height: auto;
	max-height: 80vh;
	display: block;
	background: #fff;
	object-fit: contain;
}

.cpbpwc-design-preview-mode + #product-designer {
	display: none;
}

/* Reset Cross Button */
.cpbpwc-reset-cross {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 101;
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    color: #ef4444;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    padding-bottom: 2px;
    border: 1px solid #fee2e2;
}

/* AI Creative Icon - by ID */
#amm-ai-creative-responsive::before {
    background-image: url("../images/ai-image-generation-without-bg.svg");
    background-size: 25px 25px;
}

#amm-ai-creative-responsive:hover::before {
    background-image: url("../images/ai-image-generation-without-bg.svg");
    background-size: 25px 25px;
}

.cpbpwc-new-tag {
    background: #ef4444;
    color: white;
    font-size: 8px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    position: absolute;
    top: -6px;
    right: -12px;
    font-weight: 800;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cpbpwc-ai-trigger {
    display: block;
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #887CFD 0%, #6b5dd3 100%);
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(136, 124, 253, 0.28);
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.cpbpwc-ai-trigger:hover {
    opacity: 0.92;
    box-shadow: 0 6px 18px rgba(136, 124, 253, 0.38);
}

/* Reset Loader Button (shown after clicking cross) */
.cpbpwc-reset-loader {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 101;
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: wait;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    pointer-events: none;
}

.cpbpwc-reset-loader .cpbpwc-loader {
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: cpbpwc-spin 1s linear infinite;
    display: inline-block;
    margin: 0;
    top: 0;
}

/* Hide the hover title heading for merge images */
.wrapper-amm-hover-title-merge-images {
    display: none;
}

/* AI Generated Images Section Styling - Integrated */

.cpbpwc-ai-image-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Builder mode chrome (drawing / text) — was injected via front.js */
body.cpb-drawing-mode #amm-merge-image-trigger,
body.cpb-drawing-mode .add_textbox,
body.cpb-drawing-mode #cpbpwc-back-btn,
body.cpb-drawing-mode #amm-brushes,
body.cpb-drawing-mode #amm-preview-responsive,
body.cpb-drawing-mode #amm-upload-image-meme-responsive,
body.cpb-drawing-mode .wrapper-amm-select-merge-images,
body.cpb-drawing-mode .amm-text-boxes,
body.cpb-drawing-mode #amm-download-image-responsive,
body.cpb-drawing-mode #amm-reset-responsive,
body.cpb-drawing-mode #amm-ai-creative-responsive,
body.cpb-drawing-mode .cpb-canvas-toolbar-wrap {
	display: none;
}

body.cpb-drawing-mode .wrapper-memes-preview-operations > .wrapper-amm-stop-brushes.show,
.wrapper-amm-stop-brushes.show {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 44px;
	line-height: 0;
}

body.cpb-text-mode #amm-merge-image-trigger,
body.cpb-text-mode #amm-brushes,
body.cpb-text-mode #amm-preview-responsive,
body.cpb-text-mode #amm-upload-image-meme-responsive,
body.cpb-text-mode .wrapper-amm-select-merge-images,
body.cpb-text-mode #amm-download-image-responsive,
body.cpb-text-mode #amm-reset-responsive,
body.cpb-text-mode #amm-ai-creative-responsive,
body.cpb-text-mode .cpb-canvas-toolbar-wrap {
	display: none;
}

body.cpb-text-mode .add_textbox,
body.cpb-text-mode #cpbpwc-back-btn {
	display: inline-flex;
}

