/**
 * Custom Printful Product Editor Styles
 * Scope A: Three-column layout (Layers | Canvas | Controls)
 */

/* Main Editor Container */
#editor-container.custom-printful-editor-container {
    width: 100%;
    min-height: 600px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Three-column layout (with top panel: main area is Canvas | Controls) */
.cppe-layout-three-col .editor-layout {
    display: flex;
    flex-direction: row;
    min-height: 500px;
}

/* Top bar: horizontal customization panel (Layers) */
.cppe-layout-top-panel .editor-top-bar {
    display: flex;
    flex-direction: row;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.cppe-layout-top-panel .editor-top-bar .editor-layers-panel {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    border-right: none;
    padding: 0;
}

.cppe-layout-top-panel .editor-top-bar .editor-panel-title {
    padding: 10px 14px;
    margin: 0;
    border-bottom: none;
    border-right: 1px solid #eee;
    flex-shrink: 0;
}

/* Toolbar row inside top bar: text options + actions in one row */
.editor-layers-toolbar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-bottom: none;
}

.cppe-layout-top-panel .editor-top-bar .editor-layers-text-options {
    padding: 0;
    border-bottom: none;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.cppe-layout-top-panel .editor-top-bar .editor-layers-text-colors {
    margin-bottom: 0;
}

.cppe-layout-top-panel .editor-top-bar .editor-layers-text-row,
.cppe-layout-top-panel .editor-top-bar .editor-layers-primary-row {
    margin: 0;
}

.editor-layers-primary-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.editor-layers-primary-row .editor-layers-font-dropdown {
    min-width: 120px;
}

.editor-layers-label-inline {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.editor-layers-primary-row .editor-select:hover,
.editor-layers-primary-row .editor-layers-font-trigger:hover {
    border-color: #bbb;
}

.editor-layers-primary-row .editor-select:focus,
.editor-layers-primary-row .editor-layers-font-trigger:focus {
    outline: none;
    border-color: #8b5cf6;
}

.cppe-layout-top-panel .editor-top-bar .editor-layers-actions {
    padding: 0;
    border-bottom: none;
}

/* Layers list in top bar: horizontal scrollable strip */
.cppe-layout-top-panel .editor-top-bar .editor-layers-list {
    flex: 1;
    min-height: 0;
    min-width: 120px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    overflow-x: auto;
    overflow-y: hidden;
}

.cppe-layout-top-panel .editor-top-bar .editor-layer-item {
    flex: 0 0 auto;
    margin-bottom: 0;
    min-width: 100px;
}

.cppe-layout-top-panel .editor-top-bar .editor-layers-font-dropdown {
    min-width: 120px;
}

/* Under editor: all placement images with labels */
.editor-images-thumbnails {
    padding: 14px 16px;
    background: #fff;
    border-top: 1px solid #ddd;
}

.editor-images-thumbnails-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.editor-images-thumbnails-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

.editor-images-thumb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.editor-images-thumb-img-wrap {
    position: relative;
    display: block;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.editor-images-thumb-img {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.editor-images-thumb-printarea {
    position: absolute;
    top: 0;
    left: 0;
    box-sizing: border-box;
    border: 2px dashed rgba(139, 92, 246, 0.9);
    pointer-events: none;
}

.editor-images-thumb-label {
    font-size: 11px;
    font-weight: 500;
    color: #555;
    text-align: center;
    max-width: 90px;
    word-break: break-word;
}

.editor-images-thumb-category {
    width: 100%;
    font-size: 12px;
    font-weight: 600;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 12px 0 8px;
    padding: 6px 0;
    border-bottom: 2px solid #e0e0e0;
    flex-basis: 100%;
}

.editor-images-thumb-category:first-child {
    margin-top: 0;
}

.splot-merch-wizard {
    max-width: 1240px;
    margin: 24px auto 48px;
    padding: 0 18px;
    color: #1f2933;
}

.splot-merch-wizard__header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-end;
    margin-bottom: 22px;
}

.splot-merch-wizard__eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6c5ce7;
}

.splot-merch-wizard h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.15;
}

.splot-merch-steps {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.splot-merch-steps li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border: 1px solid #d8dee9;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    color: #52616b;
}

.splot-merch-steps span {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #edf1f7;
    font-weight: 700;
}

.splot-merch-steps li.is-active,
.splot-merch-steps li.is-complete {
    border-color: #6c5ce7;
    color: #26243f;
}

.splot-merch-steps li.is-active span,
.splot-merch-steps li.is-complete span {
    background: #6c5ce7;
    color: #fff;
}

.splot-merch-alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 6px;
    background: #eef7ff;
    color: #164c7a;
}

.splot-merch-alert.is-error {
    background: #fff0f0;
    color: #9b1c1c;
}

.splot-merch-alert.is-success {
    background: #eefbf3;
    color: #116329;
}

.splot-merch-step {
    display: none;
    background: #fff;
    border: 1px solid #dfe5ec;
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.splot-merch-step.is-active {
    display: block;
}

.splot-merch-step__intro {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
    margin-bottom: 18px;
}

.splot-merch-step__intro h2 {
    margin: 0;
    font-size: 22px;
}

.splot-merch-step__intro p {
    max-width: 560px;
    margin: 0;
    color: #64748b;
    line-height: 1.5;
}

.splot-artwork-grid,
.splot-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.splot-artwork-card,
.splot-product-card {
    position: relative;
    min-height: 220px;
    padding: 0;
    border: 1px solid #dfe5ec;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.splot-artwork-card:hover,
.splot-product-card:hover,
.splot-artwork-card.selected,
.splot-product-card.selected {
    border-color: #6c5ce7;
    box-shadow: 0 12px 24px rgba(108, 92, 231, 0.15);
    transform: translateY(-1px);
}

.splot-artwork-card .checkmark,
.splot-product-card .checkmark {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: none;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 50%;
    background: #6c5ce7;
    color: #fff;
    font-weight: 700;
}

.splot-artwork-card.selected .checkmark,
.splot-product-card.selected .checkmark {
    display: grid;
}

.splot-artwork-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #f3f6fa;
}

.splot-artwork-card__title {
    display: block;
    padding: 12px;
    font-weight: 700;
    color: #243447;
}

.splot-artwork-card__empty,
.splot-product-card__visual {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #eef2f7;
    color: #6c5ce7;
    font-size: 48px;
    font-weight: 800;
}

.splot-product-card__image-wrap {
    overflow: hidden;
    background: #f6f8fb;
}

.splot-product-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.splot-product-card {
    display: flex;
    flex-direction: column;
}

.splot-product-card__body {
    display: grid;
    gap: 7px;
    padding: 13px;
}

.splot-product-card__body strong {
    font-size: 16px;
}

.splot-product-card__body span,
.splot-product-card__body em {
    color: #64748b;
    font-size: 13px;
    font-style: normal;
    line-height: 1.4;
}

.splot-product-card__action {
    margin: auto 13px 13px;
    padding: 9px 10px;
    border-radius: 6px;
    background: #101828;
    color: #fff;
    text-align: center;
    font-weight: 700;
}

.splot-full-catalogue-toggle {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.splot-full-catalogue {
    margin-top: 18px;
    border-top: 1px solid #e2e8f0;
    padding-top: 18px;
}

.splot-full-catalogue__header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 14px;
}

.splot-full-catalogue__header h3 {
    margin: 0;
    font-size: 18px;
}

.splot-full-catalogue__header p,
.splot-catalog-status {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.splot-full-catalogue__body {
    display: grid;
    grid-template-columns: minmax(190px, 240px) 1fr;
    gap: 18px;
}

.splot-catalog-categories {
    max-height: 620px;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px;
}

.splot-catalog-categories ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.splot-catalog-categories ul ul {
    padding-left: 10px;
}

.splot-catalog-categories .category-item.has-children > ul {
    display: none;
}

.splot-catalog-categories .category-item.has-children.is-open > ul {
    display: block;
}

.splot-catalog-categories .category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 9px;
    border-radius: 6px;
    color: #243447;
    cursor: pointer;
    font-size: 13px;
}

.splot-catalog-categories .toggle-icon {
    transition: transform 0.15s ease;
}

.splot-catalog-categories .category-item.has-children.is-open > .category-header .toggle-icon {
    transform: rotate(180deg);
}

.splot-catalog-categories .category-item.is-active > .category-header,
.splot-catalog-categories .category-header:hover {
    background: #e8f0ff;
    color: #1f3a8a;
}

.splot-catalog-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    grid-auto-rows: 470px;
    gap: 14px;
    min-height: 220px;
}

.splot-catalog-products .card {
    position: relative;
    display: grid;
    grid-template-rows: minmax(0, 212px) 1fr;
    height: 100%;
    border: 1px solid #dfe5ec;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.splot-catalog-products .card:hover,
.splot-catalog-products .card.selected {
    border-color: #6c5ce7;
    box-shadow: 0 12px 24px rgba(108, 92, 231, 0.15);
    transform: translateY(-1px);
}

.splot-catalog-products .main-img {
    display: block;
    width: 100%;
    height: 212px;
    object-fit: cover;
    background: #f3f6fa;
}

.splot-catalog-products .card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 14px;
}

.splot-catalog-products .title {
    display: -webkit-box;
    overflow: hidden;
    font-weight: 700;
    color: #243447;
    font-size: 14px;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.splot-catalog-products .sizes,
.splot-catalog-products .price {
    color: #64748b;
    font-size: 12px;
}

.splot-catalog-products .catalog-card-content {
    display: grid;
    gap: 8px;
    align-content: start;
}

.splot-catalog-products .catalog-card-meta {
    display: grid;
    align-content: start;
    gap: 5px;
}

.splot-catalog-products .catalog-card-price {
    justify-self: start;
    align-self: flex-start;
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(139, 156, 255, 0.14);
    color: #bfd2ff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.splot-catalog-products .catalog-card-action {
    width: 100%;
    min-height: 34px;
    margin-top: auto;
    border: 1px solid #7c8cff;
    border-radius: 6px;
    background: #6c5ce7;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.splot-catalog-products .catalog-card-action:hover,
.splot-catalog-products .catalog-card-action:focus {
    background: #7b6cff;
    border-color: #9ba7ff;
    outline: none;
}

.splot-catalog-products .colors {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 38px;
    overflow: hidden;
}

.splot-catalog-products .swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid #d0d7e2;
}

.splot-catalog-pagination {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.splot-loading-panel,
.splot-empty-state {
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    text-align: center;
}

.splot-loading-dot {
    width: 28px;
    height: 28px;
    border: 3px solid #d8dee9;
    border-top-color: #6c5ce7;
    border-radius: 50%;
    animation: cppe-spin 0.8s linear infinite;
}

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

.splot-step-loading-overlay {
    position: fixed;
    left: 50%;
    bottom: 92px;
    z-index: 80;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 10px 16px;
    border: 1px solid rgba(139, 156, 255, 0.42);
    border-radius: 8px;
    background: rgba(16, 23, 34, 0.96);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
    color: #edf4ff;
    font-size: 13px;
    font-weight: 800;
    transform: translateX(-50%);
}

.splot-step-loading-overlay[hidden] {
    display: none;
}

.splot-step-loading-dot {
    width: 22px;
    height: 22px;
    border-color: rgba(216, 222, 233, 0.35);
    border-top-color: #8ebcff;
}

.splot-merch-wizard__footer {
    position: sticky;
    bottom: 0;
    z-index: 30;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
    padding: 14px 0;
    background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0));
}

.splot-wizard-btn {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-weight: 800;
    cursor: pointer;
}

.splot-wizard-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.splot-wizard-btn--primary {
    border-color: #6c5ce7;
    background: #6c5ce7;
    color: #fff;
}

.splot-wizard-btn--secondary {
    background: #fff;
    color: #243447;
}

.splot-product-container #productDetail > .sidebar,
.splot-product-container #productDetail > .main > .footer,
.splot-product-container #preview-original,
.splot-product-container #thumbnails {
    display: none !important;
}

.splot-merch-wizard .splot-product-container #productDetail.container {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.splot-merch-wizard .splot-product-container #productDetail > .product-detail-product-type,
.splot-merch-wizard .splot-product-container #productDetail > .sidebar {
    display: none !important;
}

.splot-merch-wizard .splot-product-container #productDetail > .main {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.splot-product-container #productDetail,
.splot-product-detail-panel #productDetail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}

.splot-product-container #productDetail > .product-detail-product-type,
.splot-product-detail-panel #productDetail > .product-detail-product-type {
    grid-column: 1 / -1;
    max-width: 980px;
    margin: 0;
    color: var(--splot-dark-text);
    font-size: clamp(22px, 2.5vw, 34px);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: 0;
}

.splot-product-container #productDetail > .main,
.splot-product-detail-panel #productDetail > .main {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
    max-width: none;
}

.splot-product-container #productDetail .sidebar,
.splot-product-container #productDetail .main,
.splot-product-detail-panel #productDetail .sidebar,
.splot-product-detail-panel #productDetail .main {
    width: auto;
}

.splot-product-detail-panel .preview img,
.splot-review-media img {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 8px;
}

.splot-product-detail-panel .splot-preview-price-layout {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 430px);
    gap: 20px;
    align-items: start;
    width: 100%;
    margin: 0;
}

.splot-preview-price-media,
.splot-preview-price-card {
    border: 1px solid var(--splot-dark-border);
    border-radius: 8px;
    background: var(--splot-dark-surface);
    color: var(--splot-dark-text);
}

.splot-preview-price-media {
    padding: 14px;
}

.splot-preview-price-main {
    display: grid;
    place-items: center;
    min-height: 420px;
    border-radius: 6px;
    background: #0b111b;
    overflow: hidden;
}

.splot-product-detail-panel .splot-preview-price-main img {
    display: block;
    width: 100%;
    max-height: 640px;
    object-fit: contain;
    border-radius: 6px;
    background: #f8fafc;
}

.splot-preview-price-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.splot-preview-price-thumbnails .thumb {
    width: 64px;
    height: 64px;
    padding: 0;
    border: 1px solid var(--splot-dark-border);
    border-radius: 6px;
    background: #0b111b;
    overflow: hidden;
    cursor: pointer;
}

.splot-preview-price-thumbnails .thumb:hover,
.splot-preview-price-thumbnails .thumb:focus,
.splot-preview-price-thumbnails .thumb.active {
    border-color: var(--splot-dark-accent);
    box-shadow: 0 0 0 2px rgba(139, 156, 255, 0.35);
    outline: none;
}

.splot-preview-price-thumbnails .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.splot-preview-price-details {
    display: grid;
    gap: 14px;
}

.splot-preview-price-card {
    padding: 16px;
}

.splot-preview-price-card h3 {
    margin: 0 0 14px;
    color: var(--splot-dark-text);
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
}

.splot-preview-price-card .king-form-group {
    margin: 0 0 14px;
}

.splot-preview-price-card label {
    display: block;
    margin: 0 0 7px;
    color: var(--splot-dark-muted);
    font-size: 12px;
    font-weight: 800;
}

.splot-preview-price-card label span {
    color: #8ebcff;
}

.splot-preview-price-card input[type="text"],
.splot-preview-price-card textarea,
.splot-preview-price-card input[type="number"] {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--splot-dark-border);
    border-radius: 6px;
    background: #0d1420;
    color: var(--splot-dark-text) !important;
    box-shadow: none;
    -webkit-text-fill-color: var(--splot-dark-text);
}

.splot-preview-price-card textarea {
    min-height: 118px;
    resize: vertical;
}

.splot-preview-price-card input[type="text"]::placeholder,
.splot-preview-price-card textarea::placeholder,
.splot-preview-price-card input[type="number"]::placeholder {
    color: var(--splot-dark-muted);
    -webkit-text-fill-color: var(--splot-dark-muted);
}

.splot-price-table {
    display: grid;
    gap: 8px;
    margin: 0;
    font-family: inherit;
}

.splot-price-row {
    display: grid !important;
    grid-template-columns: minmax(52px, 0.8fr) minmax(72px, 1fr) minmax(110px, 1.2fr);
    gap: 10px;
    align-items: center;
    min-height: 44px;
    padding: 8px 0 !important;
    border-bottom: 1px solid var(--splot-dark-border) !important;
}

.splot-price-row:last-child {
    border-bottom: 0 !important;
}

.splot-price-head {
    min-height: 32px;
    color: var(--splot-dark-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.splot-price-row .size {
    color: var(--splot-dark-text);
    font-weight: 800;
}

.splot-price-row .original-price {
    color: var(--splot-dark-muted);
    font-weight: 800;
}

.splot-price-row .price-input {
    min-width: 0;
    text-align: right;
    font-weight: 800;
}

.splot-review-grid {
    display: grid;
    grid-template-columns: minmax(260px, 420px) 1fr;
    gap: 24px;
}

.splot-review-copy dl {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px 14px;
    margin: 0 0 18px;
}

.splot-review-copy dt {
    color: #64748b;
    font-weight: 700;
}

.splot-review-copy dd {
    margin: 0;
}

.splot-review-prices {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.splot-review-prices li {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #dfe5ec;
    border-radius: 6px;
}

.cppe-simple-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border-bottom: 1px solid #dfe5ec;
    background: #fff;
}

.cppe-simple-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #52616b;
}

.cppe-simple-toolbar input[type="range"] {
    width: 130px;
}

.cppe-simple-toolbar input[type="number"] {
    width: 72px;
    min-height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 8px;
}

.cppe-advanced-panel {
    background: #fbfcfe;
    border-bottom: 1px solid #dfe5ec;
    padding: 10px 14px;
}

.cppe-advanced-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-weight: 800;
    color: #243447;
    list-style: none;
}

.cppe-advanced-toggle::-webkit-details-marker {
    display: none;
}

.cppe-advanced-toggle::before {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6c5ce7;
    color: #fff;
    font-size: 13px;
    line-height: 1;
}

.cppe-advanced-panel[open] .cppe-advanced-toggle::before {
    content: "-";
}

.cppe-advanced-panel[open] .cppe-advanced-toggle {
    border-color: #2fb8c6;
    background: #e7fbfd;
    color: #12343a;
}

.cppe-advanced-panel[open] .cppe-advanced-toggle::before {
    background: #2fb8c6;
    color: #061315;
}

.cppe-advanced-panel:not([open]) + .editor-layout #editor-controls-panel {
    display: none;
}

.cppe-advanced-panel:not([open]) + .editor-layout .editor-center {
    width: 100%;
}

/* Create merch dark mode */
.splot-merch-wizard {
    --splot-dark-bg: #070b12;
    --splot-dark-surface: #101722;
    --splot-dark-surface-2: #151f2d;
    --splot-dark-border: #263447;
    --splot-dark-text: #edf4ff;
    --splot-dark-muted: #a7b4c6;
    --splot-dark-accent: #8b9cff;
    --splot-dark-accent-strong: #a78bfa;
    color-scheme: dark;
    color: var(--splot-dark-text);
}

.splot-merch-wizard,
.splot-merch-wizard__footer {
    background: var(--splot-dark-bg);
}

.splot-merch-wizard h1,
.splot-merch-wizard h2,
.splot-merch-wizard h3,
.splot-merch-wizard strong,
.splot-merch-wizard .title,
.splot-merch-wizard .splot-artwork-card__title,
.splot-merch-wizard .splot-product-card__body strong,
.splot-merch-wizard .splot-catalog-products .title,
.splot-merch-wizard .cppe-advanced-toggle,
.splot-merch-wizard .editor-panel-title,
.splot-merch-wizard .editor-object-section-title,
.splot-merch-wizard .editor-product-name,
.splot-merch-wizard .editor-product-color,
.splot-merch-wizard .editor-product-size {
    color: var(--splot-dark-text);
}

.splot-merch-wizard__eyebrow,
.splot-merch-step__intro p,
.splot-product-card__body span,
.splot-product-card__body em,
.splot-full-catalogue__header p,
.splot-catalog-status,
.splot-catalog-products .sizes,
.splot-catalog-products .price,
.splot-review-copy dt,
.cppe-simple-toolbar label,
.splot-merch-wizard .editor-object-placeholder,
.splot-merch-wizard .editor-product-summary,
.splot-merch-wizard .editor-zoom-window-label {
    color: var(--splot-dark-muted);
}

.splot-merch-steps li,
.splot-merch-step,
.splot-artwork-card,
.splot-product-card,
.splot-catalog-categories,
.splot-catalog-products .card,
.splot-loading-panel,
.splot-empty-state,
.splot-review-prices li,
.cppe-simple-toolbar,
.cppe-advanced-panel,
.splot-merch-wizard .custom-printful-editor-container,
.splot-merch-wizard .editor-panel,
.splot-merch-wizard .editor-center,
.splot-merch-wizard .editor-controls-panel,
.splot-merch-wizard .editor-controls-body,
.splot-merch-wizard .editor-product-summary,
.splot-merch-wizard .editor-zoom-window,
.splot-merch-wizard .editor-object-fields,
.splot-merch-wizard .editor-object-list,
.splot-merch-wizard .editor-product-mockups,
.splot-merch-wizard .editor-product-mockup-main-wrap {
    background: var(--splot-dark-surface);
    border-color: var(--splot-dark-border);
    color: var(--splot-dark-text);
}

.splot-merch-wizard .editor-controls-tabs,
.splot-merch-wizard .custom-printful-editor-toolbar,
.splot-merch-wizard #editor-canvas-wrapper,
.splot-merch-wizard #editor-canvas-container,
.splot-merch-wizard .editor-object-tab-section,
.splot-full-catalogue {
    background: var(--splot-dark-surface-2);
    border-color: var(--splot-dark-border);
}

.splot-merch-wizard #editor-toolbar.custom-printful-editor-toolbar {
    display: none !important;
}

.splot-merch-wizard #editor-canvas-wrapper.custom-printful-editor-canvas-wrapper {
    padding: 0;
    background: #fff;
}

.splot-merch-steps li,
.splot-wizard-btn--secondary,
.splot-merch-wizard .editor-btn,
.splot-merch-wizard .editor-tab,
.splot-merch-wizard .editor-select,
.splot-merch-wizard .editor-input,
.splot-merch-wizard input[type="number"],
.splot-merch-wizard input[type="text"],
.splot-merch-wizard textarea {
    background: #0d1420;
    border-color: var(--splot-dark-border);
    color: var(--splot-dark-text);
}

.splot-merch-steps span,
.splot-artwork-card__empty,
.splot-product-card__visual,
.splot-product-card__image-wrap,
.splot-catalog-products .main-img,
.splot-product-detail-panel .preview img,
.splot-review-media img {
    background: #0b111b;
}

.splot-merch-steps li.is-active,
.splot-merch-steps li.is-complete,
.splot-artwork-card:hover,
.splot-product-card:hover,
.splot-artwork-card.selected,
.splot-product-card.selected,
.splot-catalog-products .card:hover,
.splot-catalog-products .card.selected {
    border-color: var(--splot-dark-accent);
    box-shadow: 0 14px 30px rgba(139, 156, 255, 0.18);
}

.splot-merch-steps li.is-active,
.splot-merch-steps li.is-complete {
    color: var(--splot-dark-text);
}

.splot-merch-steps li.is-active span,
.splot-merch-steps li.is-complete span,
.splot-artwork-card .checkmark,
.splot-product-card .checkmark,
.splot-wizard-btn--primary {
    background: var(--splot-dark-accent);
    border-color: var(--splot-dark-accent);
    color: #07101f;
}

.splot-product-card__action {
    background: #24304a;
    color: var(--splot-dark-text);
}

.splot-catalog-categories .category-item.is-active > .category-header,
.splot-catalog-categories .category-header:hover,
.splot-merch-wizard .editor-tab.active {
    background: #24304a;
    color: var(--splot-dark-text);
}

.splot-merch-alert {
    background: #10243a;
    color: #bfdbfe;
}

.splot-merch-alert.is-error {
    background: #3b1016;
    color: #fecdd3;
}

.splot-merch-alert.is-success {
    background: #0f2f21;
    color: #bbf7d0;
}

.splot-merch-wizard .canvas-container,
.splot-merch-wizard canvas {
    background: #111827;
}

.splot-merch-wizard__footer {
    background: linear-gradient(to top, var(--splot-dark-bg) 70%, rgba(7, 11, 18, 0));
}

@media (max-width: 800px) {
    .splot-merch-wizard {
        padding: 0 12px;
        margin-top: 14px;
    }

    .splot-merch-wizard__header,
    .splot-merch-step__intro,
    .splot-product-detail-panel #productDetail,
    .splot-product-detail-panel .splot-preview-price-layout,
    .splot-review-grid {
        display: block;
    }

    .splot-preview-price-media,
    .splot-preview-price-details {
        margin-bottom: 14px;
    }

    .splot-preview-price-main {
        min-height: 280px;
    }

    .splot-price-row {
        grid-template-columns: 48px 72px minmax(100px, 1fr);
    }

    .splot-merch-steps {
        justify-content: flex-start;
        margin-top: 14px;
    }

    .splot-merch-steps li {
        flex: 1 1 120px;
    }

    .splot-merch-step {
        padding: 16px;
    }

    .splot-artwork-grid,
    .splot-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .splot-full-catalogue__header,
    .splot-full-catalogue__body {
        display: block;
    }

    .splot-catalog-categories {
        max-height: 260px;
        margin-bottom: 14px;
    }

    .splot-catalog-products {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    }

    .cppe-simple-toolbar {
        align-items: stretch;
    }

    .cppe-simple-toolbar label,
    .cppe-simple-toolbar .editor-btn {
        width: 100%;
        justify-content: space-between;
    }

    .cppe-layout-three-col .editor-layout {
        flex-direction: column;
    }

    .cppe-advanced-panel[open] + .editor-layout #editor-controls-panel {
        display: block;
        width: 100%;
        border-left: none;
        border-top: 1px solid #dfe5ec;
    }

    .splot-merch-wizard__footer {
        justify-content: stretch;
    }

    .splot-wizard-btn {
        flex: 1;
    }
}

/* Side panels */
.editor-panel {
    background: #fff;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.editor-panel:last-of-type {
    border-right: none;
    border-left: 1px solid #ddd;
}

.editor-panel-title {
    margin: 0;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #eee;
}

/* Left: Layers Panel */
.editor-layers-panel {
    width: 220px;
    min-width: 180px;
}

/* Layers panel: text options (colors, font, style, size) */
.editor-layers-text-options {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
}
.editor-layers-text-colors {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}
.editor-layers-color-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.editor-layers-color-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.editor-layers-color {
    width: 32px;
    height: 28px;
    padding: 2px;
    border: 2px solid #555;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
    outline: 1px solid #333;
    box-sizing: border-box;
}
.editor-layers-color:hover {
    border-color: #8b5cf6;
    outline-color: #8b5cf6;
}
/* Background checkbox + color in same row */
.editor-layers-bg-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.editor-layers-bg-use {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}
.editor-layers-bg-label {
    font-size: 11px;
    color: #555;
    flex-shrink: 0;
}

.editor-layers-text-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
/* Custom font dropdown: trigger looks like a select */
.editor-layers-font-dropdown {
    position: relative;
    flex: 1;
    min-width: 0;
}
.editor-layers-font-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    text-align: left;
}
.editor-layers-font-trigger:hover {
    border-color: #bbb;
}
.editor-layers-font-trigger[aria-expanded="true"] {
    border-color: #8b5cf6;
    outline: none;
}
.editor-layers-font-trigger-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.editor-layers-font-arrow {
    flex-shrink: 0;
    color: #666;
    font-size: 10px;
}
.editor-layers-font-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 2px 0 0;
    padding: 4px 0;
    max-height: 220px;
    overflow-y: auto;
    list-style: none;
    background: #fff;
    color: #222;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    display: none;
}
.editor-layers-font-dropdown.is-open .editor-layers-font-list {
    display: block;
}
.editor-layers-font-list li {
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #222;
}
.editor-layers-font-list li:hover {
    background: #f0f0f0;
    color: #222;
}
.editor-layers-font-list li.selected {
    background: #ede9fe;
    color: #5b21b6;
}
.editor-layers-font-select {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
}
.editor-layers-style-select,
.editor-layers-size-select {
    width: 72px;
    flex-shrink: 0;
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
}
.editor-layers-text-row .editor-select:hover {
    border-color: #bbb;
}
.editor-layers-text-row .editor-select:focus {
    outline: none;
    border-color: #8b5cf6;
}
.editor-btn-icon {
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.editor-btn-icon .editor-icon-text {
    display: block;
}

.editor-layers-actions {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
}

.editor-layers-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 120px;
}

.editor-layers-empty {
    margin: 0;
    padding: 12px;
    font-size: 13px;
    color: #999;
    text-align: center;
}

.editor-layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 4px;
    cursor: pointer;
    background: #f9f9f9;
    border: 1px solid transparent;
}

.editor-layer-item:hover {
    background: #f0f0f0;
}

.editor-layer-item.active {
    background: #ede9fe;
    border-color: #8b5cf6;
}

.editor-layer-item .layer-icon {
    flex-shrink: 0;
    font-size: 16px;
}

.editor-layer-item .layer-label {
    flex: 1;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-layer-item .layer-actions {
    display: flex;
    gap: 2px;
}

.editor-layer-item .layer-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.editor-layer-item .layer-btn:hover {
    background: #e5e5e5;
    color: #333;
}

.editor-layer-item .layer-btn.hidden {
    opacity: 0.4;
}

/* Center: Canvas column - min-height so flex never collapses to 0 */
.editor-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 1100px;
}

.editor-center .custom-printful-editor-toolbar {
    flex-shrink: 0;
}

.editor-center .custom-printful-editor-canvas-wrapper {
    flex: 1;
    min-height: 1000px;
    position: sticky;
    top: 55px;
    align-self: stretch;
}

/* Right: Controls Panel */
.editor-controls-panel {
    width: 520px;
    min-width: 440px;
}

.editor-controls-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
}

.editor-controls-tabs .editor-tab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
}

.editor-controls-tabs .editor-tab:hover {
    background: #eee;
    color: #333;
}

.editor-controls-tabs .editor-tab.active {
    background: #fff;
    color: #8b5cf6;
    border-bottom: 2px solid #8b5cf6;
    margin-bottom: -1px;
}

.editor-controls-body {
    padding: 14px;
    overflow-y: auto;
    display: none;
}

.editor-controls-body.active {
    display: block;
}

.editor-product-summary p {
    margin: 0 0 10px;
    font-size: 13px;
    color: #555;
}

.editor-product-summary .editor-product-color {
    display: flex;
    align-items: center;
    gap: 7px;
}

.editor-product-color-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border-radius: 50%;
    border: 1px solid #d0d7e2;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.editor-product-options {
    display: grid;
    gap: 12px;
    margin: 12px 0 16px;
}

.editor-product-option-label {
    margin-bottom: 7px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #687588;
}

.editor-product-option-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.editor-product-color-option {
    width: 14px;
    height: 14px;
    padding: 0;
    border: 1px solid #d0d7e2;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.editor-product-color-option.is-selected {
    border-color: #7c8cff;
    box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.28);
}

.editor-product-size-option {
    min-width: 38px;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #243447;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.editor-product-size-option.is-selected {
    border-color: #7c8cff;
    background: #6c5ce7;
    color: #fff;
}

.editor-product-summary .editor-product-name span,
.editor-product-summary .editor-product-color span,
.editor-product-summary .editor-product-size span {
    font-weight: 500;
    color: #333;
}

/* Object tab: ensure text is visible (overrides theme/global white text) */
#editor-controls-object {
    color: #333;
    background: #fff;
}

#editor-controls-object .editor-control-input,
#editor-controls-object .editor-select,
#editor-controls-object .editor-input,
#editor-controls-object option {
    color: #333;
    background: #fff;
    border-color: #ccc;
}

/* Object tab: top = Object layers, bottom = Object properties */
.editor-controls-object-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
}

.editor-object-tab-section {
    flex: 0 0 auto;
    min-height: 0;
}

.editor-object-layers-section {
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.editor-object-section-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #666;
}

#editor-controls-object .editor-object-section-title {
    color: #555;
}

.editor-object-list {
    min-width: 0;
    overflow-y: auto;
    padding: 4px 0 0;
    max-height: 200px;
}

.editor-object-properties-section {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.editor-object-list-empty {
    margin: 0;
    padding: 12px 0;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.editor-object-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 4px;
    cursor: pointer;
    background: #f5f5f5;
    border: 1px solid transparent;
    color: #333;
}

.editor-object-list-item:hover {
    background: #eee;
    color: #222;
}

.editor-object-list-item.active {
    background: #ede9fe;
    border-color: #8b5cf6;
    color: #5b21b6;
}

.editor-object-list-item .editor-object-list-icon {
    flex-shrink: 0;
    font-size: 16px;
}

.editor-object-list-item .editor-object-list-label {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-object-list-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.editor-object-list-item .layer-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
}

.editor-object-list-item .layer-btn:hover {
    background: #e5e5e5;
    color: #222;
}

.editor-object-placeholder {
    font-size: 13px;
    color: #666;
    padding: 10px 0;
}

.editor-object-fields label {
    display: block;
    margin-bottom: 12px;
    font-size: 12px;
    color: #333;
}

.editor-object-fields .editor-control-input {
    margin-top: 4px;
    width: 100%;
    box-sizing: border-box;
}

#editor-controls-object #control-opacity-value {
    color: #333;
    margin-left: 6px;
}

.splot-merch-wizard .cppe-advanced-toggle {
    background: #0d1420;
    border-color: var(--splot-dark-border);
    color: var(--splot-dark-text);
}

.splot-merch-wizard .cppe-advanced-toggle:hover,
.splot-merch-wizard .cppe-advanced-toggle:focus {
    background: #18243a;
    border-color: var(--splot-dark-accent);
    outline: none;
}

.splot-merch-wizard .cppe-advanced-toggle::before {
    background: var(--splot-dark-accent);
    color: #07101f;
}

.splot-merch-wizard #editor-controls-object,
.splot-merch-wizard #editor-controls-product,
.splot-merch-wizard .editor-controls-body,
.splot-merch-wizard .editor-product-summary,
.splot-merch-wizard .editor-object-tab-section,
.splot-merch-wizard .editor-object-fields {
    background: var(--splot-dark-surface);
    color: var(--splot-dark-text);
}

.splot-merch-wizard .editor-product-summary p,
.splot-merch-wizard .editor-object-fields label,
.splot-merch-wizard #editor-controls-object #control-opacity-value,
.splot-merch-wizard .editor-object-placeholder,
.splot-merch-wizard .editor-object-list-empty {
    color: var(--splot-dark-muted);
}

.splot-merch-wizard .editor-product-summary .editor-product-color,
.splot-merch-wizard .editor-product-summary .editor-product-size {
    display: none;
}

.splot-merch-wizard .editor-product-summary .editor-product-color {
    justify-content: flex-start;
    color: var(--splot-dark-text);
}

.splot-merch-wizard .editor-product-color-swatch {
    border-color: rgba(208, 215, 226, 0.9);
    box-shadow: 0 0 0 1px rgba(5, 10, 20, 0.45);
}

.splot-merch-wizard .editor-product-option-label {
    color: var(--splot-dark-muted);
}

.splot-merch-wizard .editor-product-color-option {
    border-color: rgba(208, 215, 226, 0.9);
    box-shadow: 0 0 0 1px rgba(5, 10, 20, 0.45);
}

.splot-merch-wizard .editor-product-color-option.is-selected {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px rgba(139, 156, 255, 0.82), 0 0 14px rgba(139, 156, 255, 0.72);
}

.splot-merch-wizard .editor-product-size-option {
    background: #0d1420;
    border-color: var(--splot-dark-border);
    color: var(--splot-dark-text);
}

.splot-merch-wizard .editor-product-size-option.is-selected {
    background: #6c5ce7;
    border-color: #9ba7ff;
    color: #fff;
}

.splot-merch-wizard .editor-product-summary .editor-product-name span,
.splot-merch-wizard .editor-product-summary .editor-product-color span,
.splot-merch-wizard .editor-product-summary .editor-product-size span,
.splot-merch-wizard .editor-object-section-title,
.splot-merch-wizard .editor-object-list-item,
.splot-merch-wizard .editor-object-list-label {
    color: var(--splot-dark-text);
}

.splot-merch-wizard #editor-controls-object .editor-control-input,
.splot-merch-wizard #editor-controls-object .editor-select,
.splot-merch-wizard #editor-controls-object .editor-input,
.splot-merch-wizard #editor-controls-object option {
    background: #0d1420;
    border-color: var(--splot-dark-border);
    color: var(--splot-dark-text);
}

.editor-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Toolbar */
#editor-toolbar.custom-printful-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #ffffff;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
}

.editor-toolbar-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.editor-btn {
    padding: 8px 16px;
    background: #0073aa;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.editor-btn:hover {
    background: #005a87;
}

.editor-btn:active {
    background: #004a6f;
}

.editor-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.editor-btn .spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.editor-btn.active {
    background: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.editor-btn.active:hover {
    background: #7c3aed;
}

/* Toolbar form elements */
.editor-select,
.editor-input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: #ffffff;
    color: #333;
    min-width: 120px;
}

.editor-select:focus,
.editor-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Snap to grid toggle (editor-layers-actions) */
.editor-snap-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 4px 0;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    user-select: none;
}
.editor-snap-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}
.editor-snap-text {
    white-space: nowrap;
}

/* Font select dropdown - each option in its own font */
.font-select option {
    font-family: inherit;
}

.font-select option[value="Arial"] { font-family: Arial, sans-serif; }
.font-select option[value="Helvetica"] { font-family: Helvetica, sans-serif; }
.font-select option[value="Times New Roman"] { font-family: "Times New Roman", serif; }
.font-select option[value="Courier New"] { font-family: "Courier New", monospace; }
.font-select option[value="Verdana"] { font-family: Verdana, sans-serif; }
.font-select option[value="Georgia"] { font-family: Georgia, serif; }
.font-select option[value="Palatino"] { font-family: Palatino, serif; }
.font-select option[value="Garamond"] { font-family: Garamond, serif; }
.font-select option[value="Bookman"] { font-family: Bookman, serif; }
.font-select option[value="Comic Sans MS"] { font-family: "Comic Sans MS", cursive; }
.font-select option[value="Trebuchet MS"] { font-family: "Trebuchet MS", sans-serif; }
.font-select option[value="Arial Black"] { font-family: "Arial Black", sans-serif; }
.font-select option[value="Impact"] { font-family: Impact, sans-serif; }
.font-select option[value="Lucida Console"] { font-family: "Lucida Console", monospace; }
.font-select option[value="Tahoma"] { font-family: Tahoma, sans-serif; }
.font-select option[value="Roboto"] { font-family: "Roboto", sans-serif; }
.font-select option[value="Open Sans"] { font-family: "Open Sans", sans-serif; }
.font-select option[value="Lato"] { font-family: "Lato", sans-serif; }
.font-select option[value="Montserrat"] { font-family: "Montserrat", sans-serif; }
.font-select option[value="Oswald"] { font-family: "Oswald", sans-serif; }
.font-select option[value="Raleway"] { font-family: "Raleway", sans-serif; }
.font-select option[value="Playfair Display"] { font-family: "Playfair Display", serif; }
.font-select option[value="Merriweather"] { font-family: "Merriweather", serif; }
.font-select option[value="Ubuntu"] { font-family: "Ubuntu", sans-serif; }
.font-select option[value="Poppins"] { font-family: "Poppins", sans-serif; }

.editor-input {
    width: 60px;
    min-width: 60px;
}

.editor-color-picker {
    width: 50px;
    height: 36px;
    padding: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: #ffffff;
}

.editor-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.editor-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

/* Canvas Wrapper – zoom window left, canvas center; top aligned, enlarged */
#editor-canvas-wrapper.custom-printful-editor-canvas-wrapper {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    background: #fafafa;
    overflow: auto;
    min-height: 1000px;
    position: relative;
    gap: 16px;
}

/* Zoom window – in Product tab at top; shows magnified area under cursor */
#editor-zoom-window.editor-zoom-window {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding: 10px 0 14px;
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

#editor-zoom-window .editor-zoom-window-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#editor-zoom-window .editor-zoom-canvas {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #f5f5f5;
    cursor: default;
}

/* Canvas container: white background, no border. Top aligned. Fits expanded template. */
#editor-canvas-container.custom-printful-editor-canvas-container {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 1000px;
    width: 100%;
    min-width: 320px;
    background: #ffffff;
    border: none;
    box-shadow: none;
}

/* Fabric.js .canvas-container wrapper - no border, ensure visible and non-zero size */
#editor-canvas-container .canvas-container {
    position: relative;
    display: block;
    background: #ffffff;
    border: none;
    box-shadow: none;
    flex-shrink: 0;
    min-width: 960px;
    min-height: 960px;
    visibility: visible;
    opacity: 1;
}

/* Fabric lower/upper canvas - ensure visible; upper must be transparent so lower shows through */
#editor-canvas-container .canvas-container .lower-canvas,
#editor-canvas-container .canvas-container .upper-canvas,
#editor-canvas-container .canvas-container canvas {
    visibility: visible !important;
    opacity: 1 !important;
}
#editor-canvas-container .canvas-container .upper-canvas {
    background: transparent !important;
}

/* Canvas elements - no border, visible */
#editor-canvas-container .canvas-container canvas,
#editor-canvas.custom-printful-editor-canvas {
    border: none;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
    cursor: crosshair;
    display: block;
}

/* Loading Spinner */
.editor-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
}

.editor-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.editor-loading-text {
    margin-top: 12px;
    color: #666;
    font-size: 14px;
}

/* Responsive: top bar wraps; main layout stacks on small screens */
@media (max-width: 992px) {
    .cppe-layout-three-col .editor-layout {
        flex-wrap: wrap;
    }
    .cppe-layout-top-panel .editor-top-bar .editor-layers-panel {
        flex-direction: column;
        align-items: stretch;
    }
    .cppe-layout-top-panel .editor-top-bar .editor-panel-title {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    .editor-layers-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .editor-center {
        width: 100%;
    }
    .editor-controls-panel {
        width: 100%;
        max-height: 220px;
        border-left: none;
        border-top: 1px solid #ddd;
    }
}

@media (max-width: 768px) {
    #editor-container.custom-printful-editor-container {
        min-height: 400px;
    }
    .editor-layers-panel,
    .editor-controls-panel {
        min-width: 0;
    }
    #editor-canvas-wrapper.custom-printful-editor-canvas-wrapper {
        padding: 10px;
        min-height: 300px;
        position: relative;
        top: 0;
    }
    #editor-toolbar.custom-printful-editor-toolbar {
        padding: 8px 12px;
    }
    .editor-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Preview modal */
.editor-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.editor-preview-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.editor-preview-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    max-width: 95vw;
    max-height: 95vh;
    overflow: auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.editor-preview-modal-content img {
    max-width: 100%;
    height: auto;
    display: block;
}

.editor-preview-modal-close {
    flex-shrink: 0;
}

.editor-preview-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
}
.editor-preview-modal-loading p {
    margin: 0;
    color: #555;
}
.editor-preview-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: editor-preview-spin 0.7s linear infinite;
}
@keyframes editor-preview-spin {
    to { transform: rotate(360deg); }
}
.editor-preview-modal-error {
    padding: 24px;
    color: #b91c1c;
}
.editor-preview-modal-error p {
    margin: 0;
}
.editor-preview-modal-mockups {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 12px 0;
}
.editor-preview-modal-mockups img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.editor-preview-mockup-item {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.editor-preview-mockup-label {
    margin: 6px 0 0;
    font-size: 12px;
    text-transform: capitalize;
    color: #64748b;
}

/* Success/Info Notifications */
.editor-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 300px;
}

.editor-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.editor-notification-success {
    background: #10b981;
    color: #ffffff;
    border-left: 4px solid #059669;
}

.editor-notification-info {
    background: #3b82f6;
    color: #ffffff;
    border-left: 4px solid #2563eb;
}

.editor-notification-warning {
    background: #f59e0b;
    color: #ffffff;
    border-left: 4px solid #d97706;
}

/* Product tab: Preview section and mockups (main image + thumbnails) */
.editor-product-preview-section { margin-top: 1rem; }
#editor-product-mockups { margin-top: 0.75rem; }
#editor-product-mockups-loading,
#editor-product-mockups-error { margin-bottom: 0.5rem; }
.editor-product-mockups-loading-text,
.editor-product-mockups-error-text { font-size: 0.9em; color: #666; }
#editor-product-mockups .editor-product-mockup-main-wrap { margin-bottom: 0.5rem; max-width: 100%; overflow: hidden; border-radius: 4px; background: #f5f5f5; }
#editor-product-mockups #editor-product-mockup-main {
    display: block;
    max-width: 100%;
    height: auto;
    min-height: 0;
    cursor: pointer;
}
#editor-product-mockups #editor-product-mockup-main:hover { opacity: 0.9; }
/* Thumbnails: force small size so they never expand to main image size */
#editor-product-mockups .editor-product-mockup-thumbnails { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
#editor-product-mockups .editor-product-mockup-thumb {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    background: #f0f0f0;
    flex: 0 0 56px;
    width: 56px;
    min-width: 56px;
    height: 56px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
#editor-product-mockups .editor-product-mockup-thumb:hover { border-color: #ccc; }
#editor-product-mockups .editor-product-mockup-thumb.active { border-color: #0073aa; }
#editor-product-mockups .editor-product-mockup-thumb img {
    display: block;
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    object-fit: cover;
}

.splot-merch-wizard .cppe-simple-toolbar .editor-btn,
.splot-merch-wizard .editor-product-preview-section .editor-btn,
.splot-merch-wizard #cppe-simple-fit,
.splot-merch-wizard #cppe-simple-preview,
.splot-merch-wizard #btn-preview-product {
    border: 1px solid #7c8cff !important;
    background: #6c5ce7 !important;
    color: #fff !important;
    font-weight: 800 !important;
}

.splot-merch-wizard .cppe-simple-toolbar .editor-btn:hover,
.splot-merch-wizard .cppe-simple-toolbar .editor-btn:focus,
.splot-merch-wizard .editor-product-preview-section .editor-btn:hover,
.splot-merch-wizard .editor-product-preview-section .editor-btn:focus,
.splot-merch-wizard #cppe-simple-fit:hover,
.splot-merch-wizard #cppe-simple-fit:focus,
.splot-merch-wizard #cppe-simple-preview:hover,
.splot-merch-wizard #cppe-simple-preview:focus,
.splot-merch-wizard #btn-preview-product:hover,
.splot-merch-wizard #btn-preview-product:focus {
    background: #7b6cff !important;
    border-color: #9ba7ff !important;
    outline: none;
}

.splot-merch-wizard #editor-zoom-window .editor-zoom-window-label,
.splot-merch-wizard .editor-zoom-window-label {
    color: var(--splot-dark-text) !important;
}

.splot-merch-wizard .editor-product-mockups-loading,
.splot-merch-wizard #editor-product-mockups-loading {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 120px;
    text-align: center;
}

.splot-merch-wizard .editor-product-mockups-loading.is-active,
.splot-merch-wizard #editor-product-mockups-loading.is-active {
    display: flex !important;
}

.splot-merch-wizard .editor-product-mockups-loading-text,
.splot-merch-wizard .editor-product-mockups-error-text {
    color: var(--splot-dark-muted);
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    #editor-container.custom-printful-editor-container {
        background: #1a1a1a;
        border-color: #333;
    }
    
    #editor-toolbar.custom-printful-editor-toolbar {
        background: #2a2a2a;
        border-bottom-color: #333;
    }
    
    #editor-canvas-wrapper.custom-printful-editor-canvas-wrapper {
        background: #1f1f1f;
    }
    
    #editor-canvas.custom-printful-editor-canvas {
        background: #ffffff;
    }
}

.splot-merch-wizard .cppe-advanced-panel > summary.cppe-advanced-toggle {
    min-height: 38px !important;
    border: 1px solid #2fb8c6 !important;
    border-radius: 6px !important;
    background: #12343a !important;
    color: #dffcff !important;
    font-weight: 800 !important;
}

.splot-merch-wizard .cppe-advanced-panel > summary.cppe-advanced-toggle::before {
    background: #2fb8c6 !important;
    color: #061315 !important;
}

.splot-merch-wizard .cppe-advanced-panel > summary.cppe-advanced-toggle:hover,
.splot-merch-wizard .cppe-advanced-panel > summary.cppe-advanced-toggle:focus {
    background: #16444b !important;
    border-color: #5be3ef !important;
    outline: none !important;
}

.splot-merch-wizard .editor-controls-tabs {
    gap: 8px !important;
    padding: 10px !important;
    border-bottom: 1px solid var(--splot-dark-border) !important;
}

.splot-merch-wizard .editor-controls-tabs > button.editor-tab {
    min-height: 38px !important;
    border: 1px solid var(--splot-dark-border) !important;
    border-radius: 6px !important;
    background: #24304a !important;
    color: var(--splot-dark-text) !important;
    font-weight: 800 !important;
}

.splot-merch-wizard .editor-controls-tabs > button.editor-tab.active,
.splot-merch-wizard .editor-controls-tabs > button.editor-tab:hover,
.splot-merch-wizard .editor-controls-tabs > button.editor-tab:focus {
    border-color: #7c8cff !important;
    background: #6c5ce7 !important;
    color: #fff !important;
    outline: none !important;
}

.splot-merch-wizard #editor-object-list .editor-object-list-item {
    border: 1px solid var(--splot-dark-border) !important;
    background: #0d1420 !important;
    color: var(--splot-dark-text) !important;
}

.splot-merch-wizard #editor-object-list .editor-object-list-item:hover {
    border-color: #7c8cff !important;
    background: #18243a !important;
    color: #fff !important;
}

.splot-merch-wizard #editor-object-list .editor-object-list-item.active {
    border-color: #7c8cff !important;
    background: #24304a !important;
    color: #fff !important;
}

.splot-merch-wizard #editor-object-list .editor-object-list-label,
.splot-merch-wizard #editor-object-list .editor-object-list-icon {
    color: inherit !important;
}

.splot-merch-wizard #editor-object-list .layer-btn {
    border: 1px solid var(--splot-dark-border) !important;
    background: #151f2d !important;
    color: var(--splot-dark-text) !important;
}

.splot-merch-wizard #editor-object-list .layer-btn:hover,
.splot-merch-wizard #editor-object-list .layer-btn:focus {
    border-color: #9ba7ff !important;
    background: #6c5ce7 !important;
    color: #fff !important;
    outline: none !important;
}
