/**
 * Admin styles: product metabox, configure wizard, restriction modal, canvas views.
 *
 * Sections: Metabox · Modals · Wizard · Toggles · Canvas views modal · Woo order edit
 * (search for section comments below, e.g. "Wizard Styles", "Canvas multi-view").
 *
 * @package CustomProductBuilderProWC
 */

:root {
    --cpb-page-gutter: 7%;
    --cpb-accent: #887CFD;
    --cpb-accent-deep: #6b5dd3;
    --cpb-accent-soft: rgba(136, 124, 253, 0.14);
    --cpb-accent-soft-solid: #eeecfe;
    --cpb-accent-gradient: linear-gradient(135deg, #a89bfe 0%, #887CFD 100%);
    --cpb-accent-gradient-btn: linear-gradient(135deg, #887CFD 0%, #6366f1 100%);
    --cpb-pro-badge: #6366f1;
    --cpb-green: #34d399;
    --cpb-bg: #e8eaf4;
    --cpb-glass: rgba(255, 255, 255, 0.58);
    --cpb-glass-strong: rgba(255, 255, 255, 0.92);
    --cpb-glass-border: rgba(255, 255, 255, 0.72);
    --cpb-surface: rgba(255, 255, 255, 0.65);
    --cpb-surface-elevated: #ffffff;
    --cpb-border: rgba(136, 124, 253, 0.12);
    --cpb-border-strong: #e8eaf4;
    --cpb-text: #1e2030;
    --cpb-text-muted: #7b8199;
    --cpb-text-secondary: #64748b;
    --cpb-shadow: 0 8px 32px rgba(136, 124, 253, 0.08), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
    --cpb-shadow-modal: 0 20px 40px rgba(15, 23, 42, 0.16);
    --cpb-shadow-btn: 0 4px 16px rgba(136, 124, 253, 0.35);
    --cpb-radius: 20px;
    --cpb-radius-sm: 12px;
    --cpb-radius-pill: 999px;
    --cpb-blur: blur(20px);
    --cpb-font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Metabox Styles */
.cpb-admin-card {
    background: #fff;
    padding: 5px;
}

.cpb-toggle-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 15px;
}

.cpb-toggle-label {
    font-family: var(--cpb-font-sans);
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
}

.cpb-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    flex-shrink: 0;
}

.cpb-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cpb-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: background-color 0.3s ease;
    border-radius: 34px;
}

.cpb-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: transform 0.3s ease;
    border-radius: 50%;
}

input:checked + .cpb-slider {
    background-color: var(--cpb-accent);
}

input:focus + .cpb-slider {
    outline: 2px solid rgba(136, 124, 253, 0.35);
    outline-offset: 1px;
}

input:checked + .cpb-slider:before {
    transform: translateX(22px);
}

/* Small toggles (text child settings) */
.cpb-switch-sm {
    width: 32px;
    height: 18px;
    flex-shrink: 0;
}

.cpb-switch-sm .cpb-slider:before {
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
}

.cpb-switch-sm input:checked + .cpb-slider:before {
    transform: translateX(14px);
}

.cpb-text-option-row {
    margin-bottom: 12px;
}

.cpb-text-option-row:last-child {
    margin-bottom: 0;
}

.cpb-text-option-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cpb-text-option-label {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.cpb-text-option-desc {
    margin: 6px 0 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    max-width: 420px;
}

.cpb-configure-btn {
    width: 100%;
    padding: 10px 0px 4px 0px;
    background: #fff;
    color: var(--cpb-accent);
    border: 2px solid var(--cpb-accent);
    border-radius: 6px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    margin-top: 10px;
    font-family: var(--cpb-font-sans);
}

.cpb-configure-btn:hover {
    background: var(--cpb-accent);
    color: #fff;
}


#cpb-configure-trigger.is-hidden,
#cpb_config_modal.is-hidden,
#cpb_restrict_modal.is-hidden,
#cpb_config_modal .is-hidden {
    display: none;
}

/* Modal overlay - neutral dim (modal interior keeps gradient mesh) */
#cpb_config_modal.cpb-modal-overlay {
    position: fixed;
    z-index: 99999;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#cpb_config_modal.cpb-modal-overlay.is-hidden {
    display: none;
}

/* Modal Styles */
.cpb-modal-content {
    position: relative;
    background: #fff;
    margin: 0;
    padding: 0;
    border-radius: var(--cpb-radius-sm);
    border: 1px solid var(--cpb-border-strong);
    width: 700px;
    max-width: 90%;
    box-shadow: var(--cpb-shadow-modal);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    font-family: var(--cpb-font-sans);
    color: var(--cpb-text);
}

.cpb-modal-header {
    padding: 18px 35px;
    background: #fff;
    border-bottom: 1px solid var(--cpb-border-strong);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--cpb-font-sans);
}

.cpb-modal-header h2 {
    font-size: 22px;
    margin: 0;
    color: var(--cpb-text);
    font-weight: 600;
    letter-spacing: -0.3px;
    font-family: var(--cpb-font-sans);
}

.cpb-modal-body {
    padding: 25px 35px;
    height: 420px;
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    font-family: var(--cpb-font-sans);
    color: var(--cpb-text);
    background: #fff;
}

/* Custom scrollbar */
.cpb-modal-body::-webkit-scrollbar {
    width: 8px;
}

.cpb-modal-body::-webkit-scrollbar-track {
    background: var(--cpb-accent-soft);
    border-radius: 10px;
}

.cpb-modal-body::-webkit-scrollbar-thumb {
    background: rgba(136, 124, 253, 0.35);
    border-radius: 10px;
}

.cpb-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--cpb-accent);
}

.cpb-modal-footer {
    padding: 0;
    background: #fff;
    border-top: 1px solid var(--cpb-border-strong);
    text-align: right;
}

#cpb_config_modal button.cpb-done-btn,
#cpb_config_modal button.cpb-next-step {
    background: var(--cpb-accent-gradient-btn);
    border: none;
    color: #fff;
    padding: 12px 35px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--cpb-radius-pill);
    cursor: pointer;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--cpb-shadow-btn);
    text-shadow: none;
    height: auto;
    line-height: 1;
    font-family: var(--cpb-font-sans);
}

#cpb_config_modal button.cpb-prev-step {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 12px 35px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--cpb-radius-pill);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    text-shadow: none;
    height: auto;
    line-height: 1;
    font-family: var(--cpb-font-sans);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#cpb_config_modal button.cpb-prev-step:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

#cpb_config_modal button.cpb-done-btn:hover,
#cpb_config_modal button.cpb-next-step:hover {
    opacity: 0.92;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.cpb-close-modal {
    color: var(--cpb-text-muted);
    font-size: 28px;
    font-weight: 400;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.cpb-close-modal:hover {
    color: var(--cpb-text);
}


.cpb-modal-section {
    margin-bottom: 30px;
}

.cpb-modal-section:last-of-type {
    margin-bottom: 15px;
}

.cpb-modal-section h3 {
    font-size: 15px;
    margin-bottom: 10px;
    color: var(--cpb-text);
    display: flex;
    align-items: center;
    font-weight: 700;
    font-family: var(--cpb-font-sans);
}

.cpb-modal-section h3 .dashicons {
    margin-right: 8px;
    color: var(--cpb-accent);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.cpb-images-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.cpb-edit-img {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--cpb-accent-gradient-btn);
    color: transparent;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(136, 124, 253, 0.35);
    box-sizing: border-box;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cpb-edit-img::before {
    content: '';
    width: 12px;
    height: 12px;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E");
}

.cpb-edit-img:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(136, 124, 253, 0.45);
}

.cpb-edit-img:focus {
    outline: 2px solid rgba(136, 124, 253, 0.45);
    outline-offset: 2px;
}

.cpb-restrict-modal {
    position: fixed;
    inset: 0;
    z-index: 100050;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    font-family: var(--cpb-font-sans);
}

.cpb-restrict-modal.is-hidden {
    display: none;
}

.cpb-restrict-modal__content {
    width: min(900px, 96vw);
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    font-family: var(--cpb-font-sans);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.cpb-restrict-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #e8eef4;
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.cpb-restrict-modal__title {
    margin: 0;
    font-family: var(--cpb-font-sans);
    font-size: 17px;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.cpb-restrict-close {
    cursor: pointer;
    font-family: var(--cpb-font-sans);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cpb-restrict-close--icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 22px;
    line-height: 1;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.cpb-restrict-close--icon:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.cpb-restrict-close--icon:focus {
    outline: 2px solid rgba(136, 124, 253, 0.55);
    outline-offset: 2px;
}

.cpb-restrict-modal__body {
    padding: 18px 18px 20px;
    overflow-x: hidden;
    overflow-y: auto;
}

.cpb-restrict-hint {
    margin: 0 0 16px;
    font-family: var(--cpb-font-sans);
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    text-align: center;
    line-height: 1.45;
}

.cpb-restrict-stage {
    position: relative;
    width: 100%;
    height: min(520px, 52vh);
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.cpb-restrict-preview-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
    max-width: min(95%, 480px);
    max-height: 100%;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    vertical-align: middle;
}

.cpb-restrict-image-layer {
    position: relative;
    display: block;
    line-height: 0;
    max-width: 100%;
    overflow: hidden;
}

.cpb-restrict-image-layer img {
    display: block;
    max-width: 100%;
    height: auto;
    pointer-events: none;
    user-select: none;
}

.cpb-restrict-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 252, 0.92);
    z-index: 12;
    border-radius: 12px;
}

.cpb-restrict-loader.is-visible {
    display: flex;
}

.cpb-restrict-loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--cpb-accent-soft-solid);
    border-top-color: var(--cpb-accent);
    border-radius: 50%;
    animation: cpb-restrict-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes cpb-restrict-spin {
    to {
        transform: rotate(360deg);
    }
}

.cpb-restrict-stage img {
    display: block;
    max-width: min(95vw, 480px);
    max-height: min(52vh, 480px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    vertical-align: top;
}

.cpb-restrict-view-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: flex-start;
    margin: 14px 0 4px;
    padding: 0 8px;
}

.cpb-restrict-view-thumbs[hidden] {
    display: none;
}

.cpb-restrict-view-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 6px;
    width: 72px;
    box-sizing: border-box;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cpb-restrict-view-thumb:hover {
    border-color: var(--cpb-accent);
    box-shadow: 0 2px 8px rgba(136, 124, 253, 0.15);
}

.cpb-restrict-view-thumb.is-active {
    border-color: var(--cpb-accent);
    box-shadow: 0 0 0 2px rgba(136, 124, 253, 0.25);
}

.cpb-restrict-view-thumb img {
    width: 56px;
    height: 56px;
    max-width: 56px;
    max-height: 56px;
    object-fit: contain;
    border-radius: 4px;
    background: #f8fafc;
    display: block;
}

.cpb-restrict-view-thumb-label {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    color: #64748b;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cpb-restrict-view-thumb.is-active .cpb-restrict-view-thumb-label {
    color: var(--cpb-accent-deep);
}

.cpb-restrict-box {
    position: absolute !important;
    top: 0;
    left: 0;
    margin: 0;
    border: 2px solid var(--cpb-accent);
    background: rgba(136, 124, 253, 0.15);
    border-radius: 10px;
    cursor: move;
    min-width: 20px;
    min-height: 20px;
    box-sizing: border-box;
    z-index: 20;
    pointer-events: auto;
    touch-action: none;
}

/* Custom jQuery UI resizable handles for the restriction box */
.cpb-restrict-box .ui-resizable-handle {
    width: 10px;
    height: 10px;
    background: #5f5f5f;
    border: 1px solid #0f172a;
    border-radius: 50%;
    position: absolute;
    box-shadow: 0 0 0 1px #f8fafc;
}

.cpb-restrict-box .ui-resizable-nw {
    top: -5px;
    left: -5px;
    cursor: nw-resize;
}

.cpb-restrict-box .ui-resizable-ne {
    top: -5px;
    right: -5px;
    cursor: ne-resize;
}

.cpb-restrict-box .ui-resizable-sw {
    bottom: -5px;
    left: -5px;
    cursor: sw-resize;
}

.cpb-restrict-box .ui-resizable-se {
    bottom: -5px;
    right: -5px;
    cursor: se-resize;
}

.cpb-restrict-box .ui-resizable-n {
    top: -5px;
    left: 50%;
    margin-left: -5px;
    cursor: n-resize;
}

.cpb-restrict-box .ui-resizable-s {
    bottom: -5px;
    left: 50%;
    margin-left: -5px;
    cursor: s-resize;
}

.cpb-restrict-box .ui-resizable-e {
    top: 50%;
    right: -5px;
    margin-top: -5px;
    cursor: e-resize;
}

.cpb-restrict-box .ui-resizable-w {
    top: 50%;
    left: -5px;
    margin-top: -5px;
    cursor: w-resize;
}


.cpb-restrict-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-top: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cpb-restrict-fields label {
    font-family: var(--cpb-font-sans);
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cpb-restrict-fields input {
    font-family: var(--cpb-font-sans);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    background: #f8fafc;
}

.cpb-restrict-modal__footer {
    padding: 20px 24px;
    border-top: 1px solid #e8eef4;
    background: #fff;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

#cpb_restrict_modal .cpb-restrict-close--footer,
#cpb_restrict_modal .cpb-restrict-reset,
#cpb_restrict_modal .cpb-restrict-save {
    min-width: 160px;
    min-height: 44px;
    padding: 12px 28px;
    border-radius: var(--cpb-radius-pill);
    font-family: var(--cpb-font-sans);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.cpb-restrict-close--footer,
.cpb-restrict-reset {
    color: #475569;
    background: #fff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    width: auto;
    height: auto;
}

.cpb-restrict-close--footer:hover,
.cpb-restrict-reset:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.cpb-restrict-close--footer:focus,
.cpb-restrict-reset:focus {
    outline: 2px solid rgba(136, 124, 253, 0.55);
    outline-offset: 2px;
}

.cpb-restrict-save {
    background: var(--cpb-accent-gradient-btn);
    color: #fff;
    border: none;
    box-shadow: var(--cpb-shadow-btn);
}

.cpb-restrict-save:hover {
    color: #fff;
    opacity: 0.92;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.cpb-restrict-save:focus {
    outline: 2px solid rgba(136, 124, 253, 0.55);
    outline-offset: 3px;
}

@media (max-height: 820px) {
    .cpb-restrict-stage {
        height: min(520px, 42vh);
    }

    .cpb-restrict-stage img {
        max-height: min(420px, 38vh);
    }
}

@media (max-width: 640px) {
    .cpb-restrict-modal {
        padding: 10px;
    }

    .cpb-restrict-modal__content {
        width: 100%;
        max-height: calc(100vh - 20px);
    }

    .cpb-restrict-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 16px;
    }
}

.cpb-upload-placeholder {
    border: 2px dashed rgba(136, 124, 253, 0.35);
    border-radius: 10px;
    height: 108px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--cpb-accent);
    background: var(--cpb-accent-soft);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.cpb-upload-placeholder:hover {
    border-color: var(--cpb-accent);
    color: var(--cpb-accent-deep);
    background: var(--cpb-accent-soft-solid);
}


/* Wizard Styles */
#cpb_config_modal .cpb-modal-content.cpb-wizard-modal {
    max-width: 800px;
    width: 90%;
}

.cpb-wizard-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 32px 18px;
    background: #fff;
    border-bottom: 1px solid var(--cpb-border-strong);
    position: relative;
    gap: 0;
}

.cpb-wizard-steps::before {
    content: '';
    position: absolute;
    top: 44px;
    left: 16.666%;
    right: 16.666%;
    height: 2px;
    background: #e8eaf4;
    z-index: 0;
    border-radius: 999px;
}

.cpb-wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
    flex: 1;
    min-width: 0;
}

.cpb-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #d8dce8;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    font-family: var(--cpb-font-sans);
    transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}

.cpb-wizard-step.active .cpb-step-number {
    background: #fff;
    border-color: var(--cpb-accent);
    color: var(--cpb-accent-deep);
    box-shadow:
        0 0 0 4px rgba(136, 124, 253, 0.16),
        0 0 0 10px rgba(136, 124, 253, 0.08);
}

.cpb-wizard-step.completed .cpb-step-number {
    background: var(--cpb-accent-soft-solid);
    border-color: rgba(136, 124, 253, 0.42);
    color: transparent;
    font-size: 0;
    box-shadow: none;
}

.cpb-wizard-step.completed .cpb-step-number::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    border: none;
    transform: none;
    top: 0;
    left: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    color: var(--cpb-accent-deep);
    font-family: var(--cpb-font-sans);
}

.cpb-step-label {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    text-align: center;
    white-space: nowrap;
    font-family: var(--cpb-font-sans);
    transition: color 0.25s ease;
}

.cpb-wizard-step.active .cpb-step-label {
    color: var(--cpb-accent-deep);
    font-weight: 700;
}

.cpb-wizard-step.completed .cpb-step-label {
    color: var(--cpb-accent);
    font-weight: 700;
}

/* Progress line filled dynamically */
.cpb-wizard-progress-fill {
    position: absolute;
    top: 44px;
    left: 16.666%;
    height: 2px;
    background: var(--cpb-accent);
    z-index: 1;
    transition: width 0.3s ease;
    pointer-events: none;
    border-radius: 999px;
}

.cpb-wizard-content {
    display: none;
    min-height: 350px;
    overflow: visible;
}

.cpb-wizard-content.active {
    display: block;
    overflow: visible;
}

.cpb-image-item-with-price {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.cpb-images-container .cpb-asset-price-wrap {
    width: 100%;
}


.cpb-asset-price-wrap .cpbpwc-variation-price,
.cpb-asset-price-field,
.cpb-variation-price-field,
.cpb-cv-variations-search {
    width: 100%;
    padding: 8px 10px;
    font-size: 12px;
    font-family: var(--cpb-font-sans);
    font-weight: 500;
    color: #1e293b;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: none;
    box-sizing: border-box;
    min-height: 36px;
    line-height: 1.35;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cpb-asset-price-wrap .cpbpwc-variation-price:focus,
.cpb-asset-price-field:focus,
.cpb-variation-price-field:focus,
.cpb-cv-variations-search:focus {
    border-color: var(--cpb-accent);
    box-shadow: 0 0 0 3px rgba(136, 124, 253, 0.12);
    outline: none;
}

.cpb-asset-price-wrap .cpbpwc-variation-price::placeholder,
.cpb-asset-price-field::placeholder,
.cpb-variation-price-field::placeholder,
.cpb-cv-variations-search::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.cpb-variation-heading,
.cpb-cv-price-heading,
.cpb-cv-label-heading,
.cpb-cv-variations-heading {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 4px;
    font-family: var(--cpb-font-sans);
}

.cpb-toggle-info .cpb-button-label-input,
#cpb_config_modal .cpb-button-label-input {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: 10px;
    margin-bottom: 0;
    padding: 10px 12px;
    font-size: 13px;
    font-family: var(--cpb-font-sans);
    font-weight: 500;
    color: #1e293b;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: none;
    box-sizing: border-box;
    min-height: 40px;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cpb-toggle-info .cpb-button-label-input:focus,
#cpb_config_modal .cpb-button-label-input:focus {
    border-color: var(--cpb-accent);
    box-shadow: 0 0 0 3px rgba(136, 124, 253, 0.12);
    outline: none;
}

.cpb-toggle-info .cpb-button-label-input::placeholder,
#cpb_config_modal .cpb-button-label-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.cpb-asset-price-wrap,
.cpb-asset-price-wrap.cpb-advanced-only {
    display: block;
}

.cpb-ai-creative-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.cpb-ai-creative-label {
    font-size: 11px;
    margin-top: 5px;
    font-weight: 600;
}

/* Builder Type Options */
.cpb-builder-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px 0;
    align-items: stretch;
}

.cpb-builder-option {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

.cpb-builder-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.cpb-builder-card {
    border: 2px solid var(--cpb-border-strong);
    border-radius: var(--cpb-radius-sm);
    padding: 40px 30px;
    text-align: center;
    transition: all 0.3s;
    background: #fff;
    box-shadow: none;
    flex: 1;
    width: 100%;
    min-height: 300px;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.cpb-advanced-builder-type-gif {
    position: fixed;
    top: 240px;
    left: 60%;
    transform: translate(-50%, -50%);
    height: 202px;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
    z-index: 2;
    border: 1px solid #2897ff;
    border-radius: 10px;
}

.cpb-builder-option:hover .cpb-advanced-builder-type-gif {
    opacity: 1;
}

.cpb-builder-type-gif {
    position: fixed;
    top: 240px;
    left: 40%;
    transform: translate(-50%, -50%);
    height: 202px;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
    z-index: 2;
    border: 1px solid #2897ff;
    border-radius: 10px;
}

.cpb-builder-option:hover .cpb-builder-type-gif {
    opacity: 1;
}

@media (max-width: 700px) {
    .cpb-builder-type-gif {
        width: 90px;
        height: 90px;
    }
}

.cpb-builder-card .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--cpb-text-muted);
    margin: 0 auto 15px;
    display: block;
    transition: all 0.3s;
}

.cpb-builder-card h3 {
    font-size: 18px;
    margin: 0 0 10px;
    color: var(--cpb-text);
    font-weight: 600;
    font-family: var(--cpb-font-sans);
}

.cpb-builder-card p {
    font-size: 13px;
    color: var(--cpb-text-muted);
    margin: 0;
    line-height: 1.5;
    font-family: var(--cpb-font-sans);
}

.cpb-builder-option:hover .cpb-builder-card {
    border-color: var(--cpb-accent);
    box-shadow: 0 10px 25px rgba(136, 124, 253, 0.12);
}

.cpb-builder-option:hover .cpb-builder-card .dashicons {
    color: var(--cpb-accent);
}

.cpb-builder-option.selected .cpb-builder-card {
    border-color: var(--cpb-accent);
    background: var(--cpb-accent-soft-solid);
    box-shadow: 0 4px 16px rgba(136, 124, 253, 0.12);
}

.cpb-builder-option.selected .cpb-builder-card .dashicons {
    color: var(--cpb-accent);
}

.cpb-builder-option.selected .cpb-builder-card h3 {
    color: var(--cpb-accent);
}


.cpb-image-item {
    aspect-ratio: 1;
    padding: 0;
    border-radius: 10px;
    border: 1px dashed rgba(136, 124, 253, 0.35);
    overflow: hidden;
    position: relative;
    background-color: var(--cpb-accent-soft-solid);
    background-image:
        linear-gradient(45deg, rgba(136, 124, 253, 0.06) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(136, 124, 253, 0.06) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(136, 124, 253, 0.06) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(136, 124, 253, 0.06) 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.cpb-images-container .cpb-image-item-with-price:hover .cpb-image-item,
.cpb-canvas-bg-item:hover .cpb-image-item {
    border-color: rgba(136, 124, 253, 0.65);
    background-color: #fff;
}

.cpb-image-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: transparent;
}

.cpb-remove-img {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: transparent;
    font-size: 0;
    line-height: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
    box-sizing: border-box;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cpb-remove-img::before {
    content: '';
    width: 10px;
    height: 10px;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.8' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
}

.cpb-remove-img:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.42);
}

.cpb-remove-img:focus {
    outline: 2px solid rgba(239, 68, 68, 0.45);
    outline-offset: 2px;
}


.cpb-toggle-item {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid var(--cpb-border-strong);
    border-radius: 12px;
    transition: border-color 0.2s ease, background 0.2s ease;
    margin-bottom: 0;
    z-index: 1;
}

.cpb-toggle-item:hover {
    background: #fafbff;
    border-color: rgba(136, 124, 253, 0.35);
}

/* Keep open dropdown above sibling feature rows (avoids nested-trigger illusion). */
.cpb-toggle-item.is-dropdown-open {
    z-index: 80;
}

.cpb-wizard-content-advanced .cpb-toggle-action {
    padding-top: 4px;
    flex-shrink: 0;
    align-self: flex-start;
}

.cpb-toggle-item[data-builder-feature] {
    align-items: flex-start;
}

.cpb-feature-visibility {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 148px;
    z-index: 1;
}

.cpb-feature-visibility.is-open {
    z-index: 40;
}

/* Native select kept for form submit / a11y; UI is the custom trigger + menu. */
.cpb-feature-visibility-select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

/* Mode colours: Global = violet, Individual = sky, Disable = slate. */
.cpb-feature-visibility,
.cpb-feature-visibility-option {
    --cpb-fv-dot: #7c6cf6;
    --cpb-fv-ring: rgba(124, 108, 246, 0.18);
}

.cpb-feature-visibility.is-mode-individual,
.cpb-feature-visibility-option.is-mode-individual {
    --cpb-fv-dot: #0ea5e9;
    --cpb-fv-ring: rgba(14, 165, 233, 0.18);
}

.cpb-feature-visibility.is-mode-disable,
.cpb-feature-visibility-option.is-mode-disable {
    --cpb-fv-dot: #94a3b8;
    --cpb-fv-ring: rgba(148, 163, 184, 0.22);
}

.cpb-feature-visibility-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 148px;
    max-width: 168px;
    height: 38px;
    margin: 0;
    padding: 0 9px 0 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-family: var(--cpb-font-sans);
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.cpb-feature-visibility-trigger:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.cpb-feature-visibility-trigger:focus {
    outline: none;
}

.cpb-feature-visibility-trigger:focus-visible,
.cpb-feature-visibility.is-open .cpb-feature-visibility-trigger {
    outline: none;
    border-color: var(--cpb-fv-dot);
    background: #fff;
    box-shadow: 0 0 0 3px var(--cpb-fv-ring);
}

.cpb-feature-visibility-trigger__dot,
.cpb-feature-visibility-option__dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cpb-fv-dot);
    box-shadow: 0 0 0 3px var(--cpb-fv-ring);
}

.cpb-feature-visibility-trigger__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cpb-feature-visibility.is-mode-disable .cpb-feature-visibility-trigger__label {
    color: #64748b;
}

.cpb-feature-visibility-trigger__chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background-color: #f1f5f9;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23475569' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px 6px;
    transition: transform 0.2s ease, background-color 0.18s ease;
}

.cpb-feature-visibility-trigger:hover .cpb-feature-visibility-trigger__chevron {
    background-color: #e2e8f0;
}

.cpb-feature-visibility.is-open .cpb-feature-visibility-trigger__chevron {
    transform: rotate(180deg);
}

.cpb-feature-visibility-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    z-index: 50;
    display: none;
    width: 280px;
    max-width: calc(100vw - 32px);
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.2), 0 4px 10px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
    transform-origin: top right;
}

.cpb-feature-visibility.is-drop-up .cpb-feature-visibility-menu {
    top: auto;
    bottom: calc(100% + 6px);
    transform-origin: bottom right;
}

.cpb-feature-visibility-menu > li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cpb-feature-visibility-menu > li + li {
    margin-top: 2px;
}

.cpb-feature-visibility.is-open .cpb-feature-visibility-menu {
    display: block;
    animation: cpbFvMenuIn 0.14s ease-out;
}

.cpb-feature-visibility.is-drop-up.is-open .cpb-feature-visibility-menu {
    animation-name: cpbFvMenuUp;
}

@keyframes cpbFvMenuIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes cpbFvMenuUp {
    from {
        opacity: 0;
        transform: translateY(4px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.cpb-feature-visibility-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-family: var(--cpb-font-sans);
    color: #334155;
    text-align: left;
    line-height: 1.3;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 0.12s ease;
}

.cpb-feature-visibility-option__dot {
    margin-top: 5px;
}

.cpb-feature-visibility-option__text {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.cpb-feature-visibility-option__title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.cpb-feature-visibility-option__desc {
    font-size: 12px;
    font-weight: 400;
    color: #64748b;
    white-space: normal;
}

.cpb-feature-visibility-option__pro {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #887cfd, #6b5dd3);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.5;
}

.cpb-feature-visibility-option__check {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.5L6.5 11.5L12.5 4.5' stroke='%236b5dd3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
    opacity: 0;
}

.cpb-feature-visibility-option:hover,
.cpb-feature-visibility-option:focus {
    outline: none;
    background: #f1f5f9;
}

.cpb-feature-visibility-option:focus-visible {
    box-shadow: inset 0 0 0 2px var(--cpb-accent, #887cfd);
}

.cpb-feature-visibility-option.is-selected {
    background: #f5f3ff;
}

.cpb-feature-visibility-option.is-selected:hover,
.cpb-feature-visibility-option.is-selected:focus {
    background: #ede9fe;
}

.cpb-feature-visibility-option.is-selected .cpb-feature-visibility-option__title {
    color: #5b21b6;
}

.cpb-feature-visibility-option.is-selected .cpb-feature-visibility-option__check {
    opacity: 1;
}

.cpb-feature-visibility-option.is-pro-locked .cpb-feature-visibility-option__desc {
    opacity: 0.8;
}

@media (max-width: 600px) {
    /* Phones: text on top, full-width dropdown underneath. */
    .cpb-toggle-item[data-builder-feature] {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }

    .cpb-wizard-content-advanced .cpb-toggle-item[data-builder-feature] .cpb-toggle-action {
        align-self: stretch;
        padding-top: 0;
    }

    .cpb-toggle-item[data-builder-feature] .cpb-feature-visibility,
    .cpb-toggle-item[data-builder-feature] .cpb-feature-visibility-trigger {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .cpb-feature-visibility-menu {
        left: 0;
        right: 0;
        width: auto;
        max-width: none;
    }

    .cpb-feature-visibility-option {
        padding: 11px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cpb-feature-visibility.is-open .cpb-feature-visibility-menu {
        animation: none;
    }

    .cpb-feature-visibility-trigger__chevron {
        transition: none;
    }
}

.cpb-toggle-info strong.cpb-toggle-title-row {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.cpb-toggle-title-row .cpb-feature-mode-tag--title {
    margin-left: 0;
    font-family: var(--cpb-font-sans);
}

.cpb-feature-mode-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.2;
    border: 1px solid transparent;
}

.cpb-feature-mode-tag--global,
.cpb-feature-mode-tag--title.cpb-feature-mode-tag--global {
    background: #ede9fe;
    color: #5b21b6;
    border-color: #ddd6fe;
}

.cpb-feature-mode-tag--individual,
.cpb-feature-mode-tag--title.cpb-feature-mode-tag--individual {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.cpb-feature-mode-tag--disable,
.cpb-feature-mode-tag--title.cpb-feature-mode-tag--disable {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}

.cpb-pro-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.3;
    color: #fff;
    background: var(--cpb-pro-badge, #6366f1);
    vertical-align: middle;
}

.cpb-pro-badge--link {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    margin-left: 6px;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.cpb-pro-badge--link:hover,
.cpb-pro-badge--link:focus-visible {
    filter: brightness(1.08);
    transform: translateY(-1px);
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
}

.cpb-pro-advanced-notice {
    display: none !important;
}

.cpb-pro-advanced-locked {
    position: relative;
}

.cpb-pro-advanced-locked .cpb-custom-price-head,
.cpb-pro-advanced-locked .cpb-text-option-head {
    cursor: pointer;
}

.cpb-pro-advanced-locked .cpb-custom-price-fields,
.cpb-pro-advanced-locked .cpb-text-option-desc {
    cursor: pointer;
}

.cpb-pro-advanced-locked input:disabled + .cpb-slider,
.cpb-pro-advanced-locked .cpb-switch input:disabled + .cpb-slider {
    opacity: 0.55;
    cursor: not-allowed;
}

.cpb-pro-advanced-locked .cpb-pro-advanced-notice + * {
    opacity: 1;
}

.cpb-toggle-item[data-builder-feature].is-mode-disable {
    opacity: 0.92;
    background: #f8fafc;
}

.cpb-toggle-item[data-builder-feature].is-mode-disable .cpb-toggle-info .dashicons,
.cpb-toggle-item[data-builder-feature].is-mode-disable .cpb-toggle-info .cpb-toggle-icon-img {
    opacity: 0.65;
}

/* No toolkit modules — Step 3 empty state */
.cpb-toolkit-empty-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid #f0c36d;
    border-radius: 10px;
    background: #fff8e5;
    color: #6b4e16;
    box-shadow: 0 1px 2px rgba(146, 97, 10, 0.08);
}

.cpb-toolkit-empty-notice[hidden] {
    display: none !important;
}

.cpb-toolkit-empty-notice__icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    font-size: 22px;
    line-height: 1;
    color: #d97706;
    margin-top: 1px;
}

.cpb-toolkit-empty-notice__body {
    flex: 1;
    min-width: 0;
}

.cpb-toolkit-empty-notice__body strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 4px;
}

.cpb-toolkit-empty-notice__body p {
    margin: 0 0 10px;
    font-size: 12px;
    line-height: 1.45;
    color: #78550f;
}

.cpb-toolkit-empty-notice__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #7c3aed;
    text-decoration: none;
}

.cpb-toolkit-empty-notice__link:hover,
.cpb-toolkit-empty-notice__link:focus {
    color: #5b21b6;
    text-decoration: underline;
}

/* Toggle List Styles */
.cpb-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.cpb-toggle-info {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

.cpb-toggle-info .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: var(--cpb-accent);
    background: var(--cpb-accent-soft);
    padding: 10px;
    border-radius: 10px;
    box-sizing: content-box;
}

.cpb-toggle-info .cpb-toggle-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    background: var(--cpb-accent-soft);
    padding: 10px;
    border-radius: 10px;
    display: block;
    box-sizing: content-box;
}

.cpb-toggle-info strong {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    display: block;
    line-height: 1.35;
    font-family: var(--cpb-font-sans);
}

.cpb-toggle-info > .dashicons,
.cpb-toggle-info > .cpb-toggle-icon-img {
    flex-shrink: 0;
    margin-top: 2px;
}

.cpb-toggle-info p {
    margin: 6px 0 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.45;
    font-family: var(--cpb-font-sans);
}

.cpb-toggle-info p a {
    color: var(--cpb-accent, #887cfd);
    font-weight: 600;
    text-decoration: none;
}

.cpb-toggle-info p a:hover {
    text-decoration: underline;
}

.cpb-ai-api-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #fcd34d;
    background: #fffbeb;
    color: #92400e;
    font-size: 12px;
    line-height: 1.45;
    font-family: var(--cpb-font-sans);
}

.cpb-ai-api-warning .dashicons {
    color: #d97706;
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.cpb-ai-api-warning a {
    color: #b45309;
    font-weight: 600;
}

.cpb-text-colors-settings {
    width: 100%;
}

.cpb-text-colors-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cpb-text-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cpb-text-color-row .cpb-text-color-input {
    width: 40px;
    height: 32px;
    padding: 2px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
}

.cpb-text-color-row .cpb-remove-text-color {
    color: #64748b;
    text-decoration: none;
}

.cpb-text-color-row .cpb-remove-text-color:hover {
    color: #ef4444;
}

.cpb-toggle-child-settings {
    width: 100%;
    margin-top: 14px;
}

.cpb-toggle-info > div {
    flex: 1;
    min-width: 0;
    width: 100%;
}

/* Nested settings box (custom price, text options) */
.cpb-nested-settings-box,
.cpb-custom-price-panel {
    margin-top: 0;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--cpb-border-strong);
    border-radius: 10px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.cpb-custom-price-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0;
}

.cpb-custom-price-fields {
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #e8f0f8;
}

.cpb-custom-price-head strong {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    letter-spacing: -0.01em;
}

#cpb_config_modal .cpb-currency-input-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: 220px;
}

#cpb_config_modal .cpb-currency-symbol {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
}

#cpb_config_modal .cpb-custom-price-input {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 12px 8px 40px;
    min-height: 40px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--cpb-font-sans);
    color: #1e293b;
    line-height: 1.4;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#cpb_config_modal .cpb-custom-price-input:focus {
    border-color: var(--cpb-accent);
    box-shadow: 0 0 0 3px rgba(136, 124, 253, 0.12);
    outline: none;
}

.cpb-limit-panel--spaced {
    margin-top: 12px;
}

/* Character Limit sits inside an already-bordered text settings box */
.cpb-text-child-settings > .cpb-limit-panel--in-text,
.cpb-clipart-child-settings > .cpb-panel--in-group,
.cpb-templates-child-settings > .cpb-panel--in-group {
    margin: 0 0 14px;
    padding: 0 0 14px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #e8f0f8;
    border-radius: 0;
    box-shadow: none;
}

.cpb-text-child-settings > .cpb-limit-panel--in-text .cpb-custom-price-fields,
.cpb-clipart-child-settings > .cpb-panel--in-group .cpb-custom-price-fields,
.cpb-templates-child-settings > .cpb-panel--in-group .cpb-custom-price-fields {
    border-top: 1px solid #e8f0f8;
}

#cpb_config_modal .cpb-limit-input {
    display: block;
    width: 100%;
    max-width: 220px;
    height: 38px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #1e293b;
    background: #fff;
    box-sizing: border-box;
}

#cpb_config_modal .cpb-limit-input:focus {
    outline: none;
    border-color: #887cfd;
    box-shadow: 0 0 0 3px rgba(136, 124, 253, 0.15);
}

.cpb-custom-price-desc {
    margin: 10px 0 0;
    font-size: 11px;
    color: #64748b;
    line-height: 1.45;
}

.cpb-text-child-settings.cpb-nested-settings-box,
.cpb-clipart-child-settings.cpb-nested-settings-box,
.cpb-templates-child-settings.cpb-nested-settings-box {
    margin-top: 14px;
}

.cpb-wizard-content-advanced .cpb-title-flex h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    font-family: var(--cpb-font-sans);
    margin: 0;
}

.cpb-wizard-content-advanced .cpb-button-toggles > p,
.cpb-wizard-content-advanced > .cpb-button-toggles > p {
    font-size: 12px;
    color: #64748b;
    margin: 8px 0 0;
    line-height: 1.5;
    font-family: var(--cpb-font-sans);
}

.cpb-wizard-content-advanced .cpb-button-toggles {
    padding: 4px 0 0;
}

.cpb-wizard-content-advanced > p {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 16px;
}

.cpb-modal-footer.cpb-wizard-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 20px 40px;
    gap: 15px;
    font-family: var(--cpb-font-sans);
    background: #fff;
    border-top: 1px solid var(--cpb-border-strong);
}

.cpb-wizard-footer button.cpb-prev-step {
    margin-right: auto;
}

.cpb-wizard-footer--first-step {
    justify-content: flex-end;
}

.cpb-wizard-footer--first-step .cpb-prev-step,
#cpb_config_modal .cpb-wizard-footer button.cpb-prev-step.is-hidden {
    display: none;
}

/* Variation Step */
.cpb-variation-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.cpb-variation-thumb {
    width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 6px;
    background: #fff;
}

.cpb-variation-price-field {
    text-align: center;
    margin-top: 8px;
}


/* Canvas multi-view configuration modal */
.cpb-canvas-views-modal {
    position: fixed;
    z-index: 100050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    font-family: var(--cpb-font-sans);
}

.cpb-canvas-views-modal__content {
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--cpb-border-strong);
    max-width: min(980px, 98vw);
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--cpb-shadow-modal);
    font-family: var(--cpb-font-sans);
}

.cpb-canvas-views-modal button,
.cpb-canvas-views-modal input,
.cpb-canvas-views-modal select,
.cpb-canvas-views-modal textarea {
    font-family: inherit;
}

.cpb-canvas-views-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.cpb-canvas-views-modal__header-text {
    flex: 1;
    min-width: 0;
}

.cpb-canvas-views-modal__header-text h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.cpb-canvas-views-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cpb-canvas-views-close:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.cpb-canvas-views-modal__body {
    padding: 16px 20px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.cpb-canvas-views-hint {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.cpb-cv-modal-warning {
    display: none;
    align-items: flex-start;
    gap: 8px;
    margin: 14px 20px 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #fcd34d;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
    line-height: 1.45;
    font-family: var(--cpb-font-sans);
}

.cpb-cv-modal-warning.is-visible {
    display: flex;
}

.cpb-cv-modal-warning .dashicons {
    color: #d97706;
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.cpb-cv-row.is-validation-error {
    border-color: #f59e0b;
    box-shadow: inset 0 0 0 1px #fcd34d;
}

.cpb-cv-row.is-validation-error .cpb-cv-label-select-wrap select.cpb-cv-label,
#cpb_canvas_views_modal .cpb-cv-row.is-validation-error .cpb-cv-label-select-wrap select.cpb-cv-label {
    border-color: #f59e0b;
}

/* Exactly 4 view cards per row; wider modal so each .cpb-cv-row cell has room */
.cpb-canvas-views-rows {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
    align-items: start;
}

@media (max-width: 640px) {
    .cpb-canvas-views-rows {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.cpb-cv-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.cpb-cv-row:hover {
    border-color: rgba(136, 124, 253, 0.45);
}

.cpb-cv-upload-wrap {
    position: relative;
    width: 100%;
}

/* Same corner treatment as .cpb-remove-img on canvas thumbnails */
.cpb-cv-upload-wrap .cpb-cv-remove-row {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    font-size: 0;
    line-height: 0;
    color: transparent;
    border: 2px solid #fff;
    border-radius: 50%;
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
    box-sizing: border-box;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cpb-cv-upload-wrap .cpb-cv-remove-row::before {
    content: '';
    width: 10px;
    height: 10px;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.8' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
}

.cpb-cv-upload-wrap .cpb-cv-remove-row:hover {
    color: transparent;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.42);
    border-color: #fff;
}

.cpb-cv-upload-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    aspect-ratio: 1;
    margin: 0;
    padding: 6px 4px;
    box-sizing: border-box;
    overflow: hidden;
    background: var(--cpb-accent-soft);
    border: 1px dashed rgba(136, 124, 253, 0.35);
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.cpb-cv-upload-loader {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 2;
    align-items: center;
    justify-content: center;
    background: var(--cpb-accent-soft);
    border-radius: 7px;
    pointer-events: none;
}

.cpb-cv-upload-zone.is-loading .cpb-cv-upload-empty {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.cpb-cv-upload-zone.is-loading .cpb-cv-upload-img {
    visibility: hidden;
}

.cpb-cv-upload-loader::after {
    content: '';
    width: 26px;
    height: 26px;
    border: 2px solid #cbd5e1;
    border-top-color: var(--cpb-accent);
    border-radius: 50%;
    animation: cpb-cv-loader-spin 0.65s linear infinite;
    box-sizing: border-box;
}

.cpb-cv-upload-zone.is-loading .cpb-cv-upload-loader {
    display: flex;
}

.cpb-cv-upload-zone.is-loading {
    pointer-events: none;
}

@keyframes cpb-cv-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

.cpb-cv-upload-zone:hover {
    border-color: var(--cpb-accent);
    background: rgba(136, 124, 253, 0.1);
}

.cpb-cv-upload-zone:focus {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(136, 124, 253, 0.45);
}

.cpb-cv-upload-zone.has-image {
    padding: 0;
    min-height: 0;
    border-style: solid;
    border-color: #e2e8f0;
}

.cpb-cv-upload-zone.has-image:hover {
    border-color: rgba(136, 124, 253, 0.55);
}

.cpb-cv-upload-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    max-width: 100%;
    padding: 0 2px;
}

.cpb-cv-upload-zone.has-image .cpb-cv-upload-empty {
    display: none;
}

.cpb-cv-upload-icon {
    display: block;
    width: 28px;
    height: 28px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' fill='none' stroke='%23338eef' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E");
}

.cpb-cv-upload-text {
    font-size: 10px;
    font-weight: 500;
    color: #338eef;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
}

.cpb-cv-upload-img {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
}

.cpb-cv-upload-zone.has-image .cpb-cv-upload-img {
    display: block;
}

.cpb-cv-upload-zone.has-image {
    background-color: var(--cpb-accent-soft-solid);
    background-image:
        linear-gradient(45deg, rgba(136, 124, 253, 0.06) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(136, 124, 253, 0.06) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(136, 124, 253, 0.06) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(136, 124, 253, 0.06) 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
}

.cpb-cv-row-bottom {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.cpb-cv-price-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.cpb-canvas-views-modal .cpb-cv-price,
#cpb_canvas_views_modal .cpb-cv-price {
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    font-size: 12px;
    font-family: var(--cpb-font-sans);
    font-weight: 500;
    color: #1e293b;
    line-height: 1.35;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: none;
    min-height: 36px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cpb-canvas-views-modal .cpb-cv-price:focus,
#cpb_canvas_views_modal .cpb-cv-price:focus {
    border-color: var(--cpb-accent);
    box-shadow: 0 0 0 3px rgba(136, 124, 253, 0.12);
    outline: none;
}

/* Mapped Variation search — match Set Variation field; override WP admin text input styles */
.cpb-canvas-views-modal .cpb-cv-variations-search,
#cpb_canvas_views_modal .cpb-cv-variations-search,
.cpb-canvas-views-modal .cpb-cv-variations-toolbar input[type="text"],
#cpb_canvas_views_modal .cpb-cv-variations-toolbar input[type="text"] {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 8px 10px;
    font-size: 12px;
    font-family: var(--cpb-font-sans);
    font-weight: 500;
    color: #1e293b;
    line-height: 1.35;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    background-image: none;
    box-shadow: none;
    min-height: 36px;
    height: 36px;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cpb-canvas-views-modal .cpb-cv-variations-search:focus,
#cpb_canvas_views_modal .cpb-cv-variations-search:focus,
.cpb-canvas-views-modal .cpb-cv-variations-toolbar input[type="text"]:focus,
#cpb_canvas_views_modal .cpb-cv-variations-toolbar input[type="text"]:focus {
    border-color: var(--cpb-accent);
    box-shadow: 0 0 0 3px rgba(136, 124, 253, 0.12);
    outline: none;
}

.cpb-canvas-views-modal .cpb-cv-variations-search::placeholder,
#cpb_canvas_views_modal .cpb-cv-variations-search::placeholder,
.cpb-canvas-views-modal .cpb-cv-variations-toolbar input[type="text"]::placeholder,
#cpb_canvas_views_modal .cpb-cv-variations-toolbar input[type="text"]::placeholder {
    color: #94a3b8;
    font-weight: 400;
    opacity: 1;
}

.cpb-cv-label-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.cpb-cv-label-select-wrap {
    flex: 1;
    min-width: 0;
}

.cpb-canvas-views-modal .cpb-cv-label-select-wrap select.cpb-cv-label,
#cpb_canvas_views_modal .cpb-cv-label-select-wrap select.cpb-cv-label {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 8px 28px 8px 10px;
    font-size: 12px;
    font-family: var(--cpb-font-sans);
    font-weight: 500;
    color: #1e293b;
    line-height: 1.35;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: none;
    min-height: 36px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cpb-canvas-views-modal .cpb-cv-label-select-wrap select.cpb-cv-label:focus,
#cpb_canvas_views_modal .cpb-cv-label-select-wrap select.cpb-cv-label:focus {
    border-color: var(--cpb-accent);
    box-shadow: 0 0 0 3px rgba(136, 124, 253, 0.12);
    outline: none;
}

.cpb-cv-label-add-panel {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.cpb-cv-label-add-panel.is-visible {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.cpb-canvas-views-modal .cpb-cv-label-new-input,
#cpb_canvas_views_modal .cpb-cv-label-new-input {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 8px 10px;
    font-size: 12px;
    font-family: var(--cpb-font-sans);
    font-weight: 500;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    box-sizing: border-box;
    min-height: 36px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cpb-canvas-views-modal .cpb-cv-label-new-input:focus,
#cpb_canvas_views_modal .cpb-cv-label-new-input:focus {
    border-color: var(--cpb-accent);
    box-shadow: 0 0 0 3px rgba(136, 124, 253, 0.12);
    outline: none;
}

.cpb-cv-label-add-btn {
    flex-shrink: 0;
    margin: 0;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--cpb-font-sans);
    color: #fff;
    background: var(--cpb-accent-gradient-btn);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: var(--cpb-shadow-btn);
    line-height: 1.2;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.cpb-cv-label-add-btn:hover {
    opacity: 0.92;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.cpb-cv-label-add-btn:focus {
    outline: 2px solid rgba(136, 124, 253, 0.55);
    outline-offset: 2px;
}

/* ---- Mapped Variation multi-select (Canvas views modal) ---- */

.cpb-cv-variations-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 4px;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    background: var(--cpb-accent-soft-solid);
    border: 1px solid var(--cpb-border);
    border-radius: var(--cpb-radius-sm);
}

.cpb-cv-variations-heading {
    margin-bottom: 0;
}

.cpb-cv-variations-list {
    width: 100%;
    max-height: 148px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-sizing: border-box;
}

/* Toolbar: "Check all" toggle + full-width search */
.cpb-cv-variations-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
}

.cpb-cv-variations-checkall {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--cpb-font-sans);
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    align-self: flex-start;
}

.cpb-cv-variations-checkall input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--cpb-accent);
    cursor: pointer;
    flex-shrink: 0;
}

.cpb-cv-variations-search-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

.cpb-cv-variation-option.is-hidden {
    display: none !important;
}

.cpb-cv-variations-list:focus-within {
    border-color: var(--cpb-accent);
    box-shadow: 0 0 0 3px rgba(136, 124, 253, 0.12);
}

.cpb-cv-variation-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 12px;
    font-family: var(--cpb-font-sans);
    font-weight: 500;
    color: #1e293b;
    box-sizing: border-box;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.cpb-cv-variation-option:hover {
    background: #f1f5f9;
}

.cpb-cv-variation-option:has(input:checked) {
    background: var(--cpb-accent-soft);
    border: 1px solid rgba(136, 124, 253, 0.28);
}

.cpb-cv-variation-option input[type="checkbox"] {
    margin: 2px 0 0;
    width: 16px;
    height: 16px;
    accent-color: var(--cpb-accent);
    cursor: pointer;
    flex-shrink: 0;
}

.cpb-cv-variation-label {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
    overflow: visible;
}

.cpb-cv-variations-empty {
    margin: 0;
    padding: 8px 4px;
    font-size: 12px;
    font-style: italic;
    color: #94a3b8;
    font-family: var(--cpb-font-sans);
}

.cpb-cv-remove-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

/* Grid tile: dashed square + spacer (matches .cpb-cv-row layout), same row as view cards */
.cpb-cv-add-slot.cpb-canvas-views-add-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    padding: 8px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.cpb-cv-add-slot.cpb-canvas-views-add-row:hover {
    border-color: #3498db;
}

.cpb-cv-add-slot-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    aspect-ratio: 1;
    min-height: 0;
    padding: 8px 6px;
    box-sizing: border-box;
    background: #fff;
    border: 1px dashed #94a3b8;
    border-radius: 8px;
    color: #94a3b8;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.cpb-cv-add-slot:hover .cpb-cv-add-slot-visual {
    border-color: #338eef;
    background: #f8fafc;
    color: #64748b;
}

.cpb-cv-add-slot-icon {
    display: block;
    width: 32px;
    height: 32px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 28px 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' fill='none' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M7 16a4 4 0 0 1 0-8 5 5 0 0 1 9.9-1A4 4 0 0 1 21 12'/%3E%3Cpath d='M12 12v9'/%3E%3Cpath d='m9 15 3-3 3 3'/%3E%3C/svg%3E");
}

.cpb-cv-add-slot:hover .cpb-cv-add-slot-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' fill='none' stroke='%23338eef' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M7 16a4 4 0 0 1 0-8 5 5 0 0 1 9.9-1A4 4 0 0 1 21 12'/%3E%3Cpath d='M12 12v9'/%3E%3Cpath d='m9 15 3-3 3 3'/%3E%3C/svg%3E");
}

.cpb-cv-add-slot-text {
    display: block;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    color: inherit;
}

.cpb-cv-add-slot-label-spacer {
    display: block;
    flex: 0 0 auto;
    min-height: 58px;
}

.cpb-cv-add-slot.cpb-canvas-views-add-row:focus {
    outline: none;
}

.cpb-cv-add-slot.cpb-canvas-views-add-row:focus-visible {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #338eef;
}

.cpb-canvas-views-modal__footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 14px 20px 16px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.cpb-canvas-views-cancel {
    margin: 0;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: var(--cpb-radius-pill);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    line-height: 1;
}

.cpb-canvas-views-cancel:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.cpb-canvas-views-cancel:focus {
    outline: 2px solid rgba(136, 124, 253, 0.55);
    outline-offset: 2px;
}

.cpb-canvas-views-apply {
    margin: 0;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--cpb-accent-gradient-btn);
    border: none;
    border-radius: var(--cpb-radius-pill);
    cursor: pointer;
    box-shadow: var(--cpb-shadow-btn);
    line-height: 1;
}

.cpb-canvas-views-apply:hover {
    opacity: 0.92;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.cpb-canvas-views-apply:focus {
    outline: 2px solid rgba(136, 124, 253, 0.55);
    outline-offset: 3px;
}

.cpb-canvas-bg-item .cpb-canvas-slot-single {
    width: 100%;
}

.cpb-canvas-bg-item .cpb-open-design-area,
.cpb-canvas-bg-item .cpb-open-canvas-views-modal {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin-top: 2px;
    padding: 4px 0;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--cpb-font-sans);
    text-decoration: none;
    color: var(--cpb-accent);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.cpb-canvas-bg-item .cpb-open-design-area:hover,
.cpb-canvas-bg-item .cpb-open-canvas-views-modal:hover {
    color: var(--cpb-accent-deep);
    text-decoration: underline;
}

#cpb-canvas-list .cpb-upload-placeholder,
#cpb-builders-list .cpb-upload-placeholder {
    height: auto;
    aspect-ratio: 1;
    border: 2px dashed rgba(136, 124, 253, 0.35);
    border-radius: 10px;
    color: var(--cpb-accent);
    background: var(--cpb-accent-soft);
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

#cpb-canvas-list .cpb-upload-placeholder .dashicons,
#cpb-builders-list .cpb-upload-placeholder .dashicons {
    color: var(--cpb-accent);
    font-size: 28px;
    width: 28px;
    height: 28px;
}

#cpb-canvas-list .cpb-upload-placeholder:hover,
#cpb-builders-list .cpb-upload-placeholder:hover {
    border-color: var(--cpb-accent);
    background: var(--cpb-accent-soft-solid);
    color: var(--cpb-accent-deep);
}

.cpb-ai-clipart-price-box .cpb-upload-placeholder {
    height: auto;
    aspect-ratio: 1;
    border: 2px dashed rgba(136, 124, 253, 0.35);
    border-radius: 10px;
    background: var(--cpb-accent-soft);
    color: var(--cpb-accent);
}

.cpb-ai-clipart-price-box .cpb-upload-placeholder:hover {
    border-color: var(--cpb-accent);
    background: var(--cpb-accent-soft-solid);
}

.cpb-ai-clipart-price-box .cpb-ai-creative-label {
    color: var(--cpb-accent);
    font-family: var(--cpb-font-sans);
}

.cpb-print-export-fields {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.cpb-print-export-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
}

.cpb-print-export-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}

.cpb-print-export-grid input,
.cpb-print-export-grid select {
    width: 100%;
    max-width: 100%;
    height: 40px;
    margin: 0;
    padding: 0 12px;
    box-sizing: border-box;
    border: 1px solid rgba(136, 124, 253, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    font-family: var(--cpb-font-sans);
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.35;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.cpb-print-export-grid select {
    padding-right: 36px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2364748b' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 8px;
}

.cpb-print-export-grid input:hover,
.cpb-print-export-grid select:hover {
    border-color: #cbd5e1;
    background-color: #fafbff;
}

.cpb-print-export-grid input:focus,
.cpb-print-export-grid select:focus {
    outline: none;
    border-color: var(--cpb-accent, #887cfd);
    box-shadow: 0 0 0 3px rgba(136, 124, 253, 0.18);
}

/* WooCommerce order edit */
.postbox#cpbpwc-order-assets .cpbpwc-order-assets-mv-row,
.woocommerce-layout__primary .cpbpwc-order-assets-mv-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 0 12px;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.postbox#cpbpwc-order-assets .cpbpwc-order-assets-mv-row .cpbpwc-order-assets-mv-cell,
.woocommerce-layout__primary .cpbpwc-order-assets-mv-row .cpbpwc-order-assets-mv-cell {
    flex: 0 0 auto;
    text-align: center;
    width: 104px;
    max-width: 104px;
}

.postbox#cpbpwc-order-assets .cpbpwc-order-assets-mv-row .cpbpwc-order-assets-mv-cell a,
.woocommerce-layout__primary .cpbpwc-order-assets-mv-row .cpbpwc-order-assets-mv-cell a {
    display: block;
}

.postbox#cpbpwc-order-assets .cpbpwc-order-assets-mv-row .cpbpwc-order-assets-mv-cell img,
.woocommerce-layout__primary .cpbpwc-order-assets-mv-row .cpbpwc-order-assets-mv-cell img {
    display: block;
    margin: 0 auto;
    width: 100px;
    height: 100px;
    object-fit: contain;
    border: 1px solid #ddd;
    padding: 4px;
    background: #fff;
    border-radius: 4px;
    box-sizing: border-box;
}

.postbox#cpbpwc-order-assets .cpbpwc-order-assets-mv-row .cpbpwc-order-assets-mv-cell small,
.woocommerce-layout__primary .cpbpwc-order-assets-mv-row .cpbpwc-order-assets-mv-cell small {
    display: block;
    margin-top: 6px;
    color: #555;
    line-height: 1.25;
}

/* ---------- Free plan: Pro-only options ---------- */

/* Advanced Builder card: visibly locked, PRO badge in the corner. */
.cpb-builder-option.is-pro-locked {
    cursor: not-allowed;
}

.cpb-builder-option.is-pro-locked .cpb-builder-card {
    background: #f8fafc;
    border-style: dashed;
    filter: grayscale(0.6);
    opacity: 0.75;
}

.cpb-builder-option.is-pro-locked:hover .cpb-builder-card {
    border-color: var(--cpb-pro-badge, #6366f1);
    opacity: 0.9;
}

.cpb-builder-option.is-pro-locked .cpb-advanced-builder-type-gif {
    display: none !important;
}

.cpb-builder-pro-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    filter: none;
}

/* Locked Pro switches read as "off": the stored value is kept for an
   upgrade, but nothing applies on the free plan. */
.cpb-pro-advanced-locked .cpb-switch input + .cpb-slider,
.cpb-pro-advanced-locked .cpb-switch input:checked + .cpb-slider {
    background-color: #cbd5e0;
    opacity: 0.55;
    cursor: not-allowed;
}

.cpb-pro-advanced-locked .cpb-switch input:checked + .cpb-slider:before {
    transform: none;
}

/* Fields that only matter when a Pro switch is on. */
.cpb-pro-advanced-locked .cpb-custom-price-fields,
.cpb-pro-advanced-locked .cpb-print-export-fields,
.cpb-pro-advanced-locked .cpb-text-colors-palette {
    display: none !important;
}

.cpb-pro-advanced-locked .cpb-text-option-label,
.cpb-pro-advanced-locked .cpb-custom-price-head > strong,
.cpb-pro-advanced-locked .cpb-text-option-desc {
    color: #94a3b8;
}

/* Free plan: Restrict Area is Pro-only. */
.cpb-canvas-bg-item .cpb-open-design-area .cpb-pro-badge {
    margin-left: 4px;
    font-size: 9px;
    padding: 1px 6px;
}

/* PRO tags open the pricing page in a new tab. */
.cpb-pro-badge {
    cursor: pointer;
}

.cpb-pro-badge:hover {
    filter: brightness(1.12);
}

/* ------------------------------------------------------------------
   Free plan: locked Pro option rows (Character Limit, Shadow, ...).
   ------------------------------------------------------------------ */

/* WP core sets disabled checkboxes to opacity .7, which makes the hidden
   input show through the switch as a dash. Keep it hidden. */
.cpb-switch input[type="checkbox"],
.cpb-switch input[type="checkbox"]:disabled {
    opacity: 0;
}

/* PRO tag sits right after the label; the switch stays on the far right. */
.cpb-custom-price-head > .cpb-pro-badge--link,
.cpb-text-option-head > .cpb-pro-badge--link {
    margin-left: 8px;
    margin-right: auto;
    flex-shrink: 0;
}

.cpb-pro-advanced-locked .cpb-custom-price-head,
.cpb-pro-advanced-locked .cpb-text-option-head {
    justify-content: flex-start;
    gap: 0;
    min-height: 22px;
}

/* Locked switch: plain grey track, knob on the left with a small lock. */
.cpb-pro-advanced-locked .cpb-switch input + .cpb-slider,
.cpb-pro-advanced-locked .cpb-switch input:checked + .cpb-slider {
    background-color: #e2e8f0;
    box-shadow: inset 0 0 0 1px #d5dce6;
    opacity: 1;
    cursor: not-allowed;
}

.cpb-pro-advanced-locked .cpb-switch .cpb-slider:before,
.cpb-pro-advanced-locked .cpb-switch input:checked + .cpb-slider:before {
    transform: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8' fill='none'%3E%3Crect x='1.25' y='3.5' width='5.5' height='4' rx='0.8' fill='%2394a3b8'/%3E%3Cpath d='M2.5 3.5V2.4a1.5 1.5 0 0 1 3 0v1.1' stroke='%2394a3b8' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 8px 8px;
}

.cpb-pro-advanced-locked .cpb-switch input:focus + .cpb-slider {
    outline: none;
}

/* Readable but clearly inactive text. */
.cpb-pro-advanced-locked .cpb-text-option-label,
.cpb-pro-advanced-locked .cpb-custom-price-head > strong {
    color: #64748b;
}

.cpb-pro-advanced-locked .cpb-text-option-desc {
    margin-top: 4px;
    max-width: none;
    padding-right: 48px;
    color: #94a3b8;
}

/* Even rows with thin dividers. */
.cpb-pro-advanced-locked > .cpb-custom-price-panel,
.cpb-pro-advanced-locked > .cpb-text-option-row,
.cpb-pro-advanced-locked > .cpb-text-colors-settings {
    margin: 0;
    padding: 12px 0;
    border: 0;
    border-top: 1px solid #e8edf4;
}

.cpb-pro-advanced-locked > :first-child {
    padding-top: 2px;
    border-top: 0;
}

.cpb-pro-advanced-locked > :last-child,
.cpb-pro-advanced-locked > .cpb-text-colors-settings .cpb-text-option-row {
    padding-bottom: 0;
    margin-bottom: 0;
}

.cpb-pro-advanced-locked.cpb-nested-settings-box:not(.cpb-custom-price-panel) {
    padding: 12px 16px 14px;
}

/* The whole row opens pricing, so give it a gentle hover. */
.cpb-pro-advanced-locked .cpb-custom-price-head:hover .cpb-pro-badge--link,
.cpb-pro-advanced-locked .cpb-text-option-head:hover .cpb-pro-badge--link {
    filter: brightness(1.1);
}

.cpb-nested-settings-box.cpb-pro-advanced-locked > .cpb-text-colors-settings {
    margin-top: 0 !important; /* beats the inline margin in the template */
}

.cpb-pro-advanced-locked .cpb-text-option-label,
.cpb-pro-advanced-locked .cpb-custom-price-head > strong {
    min-width: 0;
}

.cpb-pro-advanced-locked .cpb-text-option-head > .cpb-switch,
.cpb-pro-advanced-locked .cpb-custom-price-head > .cpb-switch {
    margin-left: 10px;
}

@media (max-width: 600px) {
    #cpb_config_modal .cpb-modal-body {
        padding: 18px 16px;
    }

    .cpb-toggle-item[data-builder-feature] .cpb-toggle-info {
        gap: 10px;
    }

    .cpb-toggle-item[data-builder-feature] .cpb-toggle-info .dashicons {
        width: 18px;
        height: 18px;
        padding: 7px;
        font-size: 18px;
    }

    .cpb-toggle-item[data-builder-feature] .cpb-toggle-info .cpb-toggle-icon-img {
        width: 18px;
        height: 18px;
        padding: 7px;
    }

    /* Settings boxes use the full row width, under the 32px icon. */
    .cpb-toggle-item[data-builder-feature] .cpb-toggle-info > div > .cpb-nested-settings-box,
    .cpb-toggle-item[data-builder-feature] .cpb-toggle-info > div > .cpb-toggle-child-settings {
        margin-left: -42px;
        width: calc(100% + 42px);
        max-width: none;
        box-sizing: border-box;
    }

    .cpb-pro-advanced-locked.cpb-nested-settings-box:not(.cpb-custom-price-panel) {
        padding: 10px 12px 12px;
    }

    .cpb-pro-advanced-locked .cpb-text-option-desc {
        padding-right: 0;
    }
}
