.wcms-calculator {
    --wcms-theme-primary: var(--gcid-primary-color, #2b87da);
    --wcms-theme-secondary: var(--gcid-secondary-color, #ea580c);
    --wcms-theme-heading: var(--gcid-heading-color, #18212f);
    --wcms-theme-body: var(--gcid-body-color, #5f6f82);
    --wcms-theme-link: var(--gcid-link-color, var(--wcms-theme-primary));
    --wcms-bg: color-mix(in srgb, var(--wcms-theme-primary) 4%, #ffffff);
    --wcms-surface: #ffffff;
    --wcms-surface-alt: color-mix(in srgb, var(--wcms-theme-primary) 3%, #f8fafc);
    --wcms-border: color-mix(in srgb, var(--wcms-theme-body) 18%, #ffffff);
    --wcms-border-strong: color-mix(in srgb, var(--wcms-theme-body) 28%, #ffffff);
    --wcms-text: var(--wcms-theme-heading);
    --wcms-text-muted: var(--wcms-theme-body);
    --wcms-accent: var(--wcms-theme-secondary);
    --wcms-accent-soft: color-mix(in srgb, var(--wcms-accent) 12%, #ffffff);
    --wcms-accent-strong: var(--wcms-accent);
    --wcms-info: var(--wcms-theme-link);
    --wcms-info-soft: color-mix(in srgb, var(--wcms-info) 12%, #ffffff);
    --wcms-preview-surface: color-mix(in srgb, var(--wcms-theme-heading) 18%, #ffffff);
    --wcms-success: #15803d;
    --wcms-success-soft: #edfdf3;
    --wcms-danger: #b42318;
    --wcms-shadow: 0 18px 40px color-mix(in srgb, var(--wcms-theme-heading) 10%, transparent);
    margin: 24px 0;
    padding: 24px;
    background: linear-gradient(180deg, #ffffff 0%, var(--wcms-bg) 100%);
    border: 1px solid var(--wcms-border);
    border-radius: 12px;
    clear: both;
    color: var(--wcms-text);
    box-shadow: var(--wcms-shadow);
    font-family: var(--et_global_body_font, inherit);
    font-size: var(--et_global_body_font_size, 16px);
    line-height: var(--et_global_body_font_height, 1.7);
}

.wcms-calculator h3,
.wcms-calculator h4 {
    margin: 0;
    color: var(--wcms-text);
    font-family: var(--et_global_heading_font, inherit);
    font-weight: var(--et_global_heading_font_weight, 700);
}

.wcms-calculator__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.wcms-calculator__heading {
    display: grid;
    gap: 8px;
}

.wcms-calculator__header h3 {
    font-size: 28px;
    line-height: 1.15;
    padding-bottom: 0;
}

.wcms-calculator__intro {
    max-width: 68ch;
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--wcms-text-muted);
}

.wcms-calculator__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.wcms-workflow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.wcms-workflow__step {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--wcms-border);
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, var(--wcms-surface-alt) 100%);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
}

.wcms-workflow__index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--wcms-info-soft);
    color: var(--wcms-info);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.wcms-workflow__text {
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--wcms-text);
}

.wcms-calculator__badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #fed7aa;
    background: var(--wcms-accent-soft);
    color: var(--wcms-accent-strong);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.wcms-configurator {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) minmax(260px, 320px);
    gap: 18px;
    align-items: start;
}

.wcms-col {
    min-width: 0;
}

.wcms-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
    background: var(--wcms-surface);
    border: 1px solid var(--wcms-border);
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.wcms-panel__header {
    display: grid;
    gap: 6px;
}

.wcms-panel__eyebrow {
    margin: 0;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--wcms-theme-primary);
}

.wcms-panel__header--split {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 16px;
}

.wcms-panel__title {
    font-size: 18px;
    line-height: 1.25;
    padding-bottom: 0;
}

.wcms-panel__description {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--wcms-text-muted);
}

.wcms-input-group {
    margin: 0;
}

.wcms-input-group input[type="file"] {
    width: 100%;
    min-height: 124px;
    padding: 16px;
    border: 1.5px dashed var(--wcms-border-strong);
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, var(--wcms-surface-alt) 100%);
    box-sizing: border-box;
    color: var(--wcms-text-muted);
    cursor: pointer;
}

.wcms-input-group input[type="file"]:hover,
.wcms-input-group input[type="file"]:focus {
    border-color: var(--wcms-info);
    background: #ffffff;
}

.wcms-upload-hint {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.55;
    color: var(--wcms-text-muted);
}

.wcms-file-list {
    margin: 0;
    max-height: 560px;
    overflow-y: auto;
    display: grid;
    gap: 12px;
    padding-right: 4px;
}

.wcms-no-files {
    margin: 0;
    padding: 18px;
    border: 1px dashed var(--wcms-border);
    border-radius: 10px;
    background: var(--wcms-surface-alt);
    color: var(--wcms-text-muted);
    font-size: 13px;
    font-style: normal;
    text-align: center;
}

.wcms-file-entry {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    border: 1px solid var(--wcms-border);
    border-radius: 10px;
    padding: 14px;
    position: relative;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.wcms-file-entry-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.wcms-file-entry-thumb {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border: 1px solid var(--wcms-border);
    border-radius: 8px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--wcms-preview-surface) 84%, #ffffff) 0%, var(--wcms-preview-surface) 100%);
    flex-shrink: 0;
}

.wcms-file-entry-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--wcms-text);
    word-break: break-word;
    flex: 1;
    line-height: 1.35;
}

.wcms-file-remove {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #fecaca;
    background: #fff5f5;
    color: var(--wcms-danger);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.wcms-file-remove:hover,
.wcms-file-remove:focus {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.wcms-field {
    display: grid;
    gap: 6px;
}

.wcms-field-label {
    font-size: 12px;
    color: var(--wcms-text-muted);
    font-weight: 600;
}

.wcms-field-control {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--wcms-border-strong);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    box-sizing: border-box;
    background: #fff;
    color: var(--wcms-text);
}

.wcms-file-entry-title {
    margin-bottom: 10px;
}

.wcms-field-control::placeholder {
    color: #8b98aa;
}

.wcms-field-control:focus {
    border-color: var(--wcms-info);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

.wcms-file-entry-dims {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.wcms-file-entry-dims__separator,
.wcms-file-entry-dims__suffix {
    font-size: 12px;
    color: var(--wcms-text-muted);
    font-weight: 600;
}

.wcms-file-entry-copies {
    margin-bottom: 8px;
    max-width: 148px;
}

.wcms-file-entry-dpi {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    width: fit-content;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: var(--wcms-surface-alt);
    color: var(--wcms-text-muted);
}

.wcms-file-entry-dpi.wcms-dpi-ok {
    color: var(--wcms-success);
    background: var(--wcms-success-soft);
}

.wcms-file-entry-dpi.wcms-dpi-warn {
    color: var(--wcms-danger);
    background: #fff0ef;
}

.wcms-dpi-warning-text {
    font-size: 11px;
    color: var(--wcms-danger);
    margin-top: 6px;
    line-height: 1.45;
}

.wcms-preview-meta {
    display: grid;
    gap: 4px;
    justify-items: end;
    min-width: 128px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--wcms-info) 24%, #ffffff);
    background: var(--wcms-info-soft);
}

.wcms-preview-meta__label {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    text-transform: uppercase;
    color: var(--wcms-info);
}

.wcms-preview-meta__value {
    font-size: 18px;
    line-height: 1.2;
    color: var(--wcms-info);
}

.wcms-preview-container {
    margin: 0;
    text-align: left;
}

.wcms-preview-scroll {
    max-height: 640px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--wcms-border);
    background:
        linear-gradient(0deg, color-mix(in srgb, var(--wcms-info) 6%, transparent), color-mix(in srgb, var(--wcms-info) 6%, transparent)),
        var(--wcms-preview-surface);
    border-radius: 10px;
    padding: 10px;
}

.wcms-preview-scroll canvas {
    display: block;
    background: var(--wcms-preview-surface);
    border-radius: 6px;
}

.wcms-preview-label {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--wcms-text-muted);
}

.wcms-preview-notice {
    margin: 10px 0 0;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--wcms-theme-heading) 16%, #ffffff);
    border-radius: 8px;
    background: color-mix(in srgb, var(--wcms-preview-surface) 70%, #ffffff);
    font-size: 12px;
    line-height: 1.6;
    color: var(--wcms-text);
}

.wcms-preview-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.wcms-preview-legend__item {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--wcms-info) 24%, #ffffff);
    background: var(--wcms-info-soft);
    color: var(--wcms-info);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.wcms-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.wcms-preview-action {
    display: flex;
}

.wcms-preview-btn,
.wcms-optimize-btn,
.wcms-summary-action .wcms-add-to-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.wcms-preview-btn {
    margin: 0;
    border: 1px solid var(--wcms-border-strong);
    background: var(--wcms-surface);
    color: var(--wcms-text);
}

.wcms-optimize-btn {
    margin: 0;
    border: 1px solid color-mix(in srgb, var(--wcms-info) 24%, #ffffff);
    background: var(--wcms-info-soft);
    color: var(--wcms-info);
}

.wcms-preview-btn:hover,
.wcms-optimize-btn:hover,
.wcms-summary-action .wcms-add-to-cart:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.1);
}

.wcms-summary {
    position: sticky;
    top: 24px;
}

.wcms-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid color-mix(in srgb, var(--wcms-theme-body) 12%, #ffffff);
}

.wcms-summary-row:last-of-type {
    border-bottom: 0;
}

.wcms-summary-label {
    color: var(--wcms-text-muted);
}

.wcms-summary-value {
    font-weight: 700;
    color: var(--wcms-text);
    text-align: right;
}

.wcms-total-row {
    margin-top: 4px;
    padding-top: 14px;
    border-top: 2px solid var(--wcms-text);
    border-bottom: 0;
}

.wcms-total-row .wcms-summary-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--wcms-text);
}

.wcms-total-row .wcms-summary-value {
    font-size: 24px;
    line-height: 1.1;
    color: var(--wcms-accent-strong);
}

.wcms-summary-action {
    margin-top: 6px;
}

.wcms-summary-action .wcms-add-to-cart {
    width: 100%;
    text-align: center;
    background: linear-gradient(180deg, color-mix(in srgb, var(--wcms-accent) 82%, #ffffff) 0%, var(--wcms-accent) 100%);
    border: 1px solid var(--wcms-accent);
}

.wcms-summary-note {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--wcms-text-muted);
}

.wcms-min-notice {
    margin: 0;
    padding: 10px 12px;
    background: #fff8e8;
    border: 1px solid #f4d48d;
    font-size: 13px;
    color: #7a5600;
    border-radius: 8px;
}

.wcms-error {
    color: var(--wcms-danger);
    font-weight: 700;
}

.wcms-loading {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--wcms-info-soft);
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    font-size: 13px;
    color: #34548c;
}

.wcms-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #dcdcde;
    border-top-color: var(--wcms-info);
    border-radius: 50%;
    animation: wcms-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

.wcms-from-price {
    color: var(--wcms-text-muted);
    font-size: 14px;
}

.wcms-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.78);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.wcms-lightbox-overlay.active {
    display: flex;
}

.wcms-lightbox-modal {
    background: #fff;
    border-radius: 12px;
    padding: 40px 24px 24px;
    max-width: 95vw;
    max-height: 92vh;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    overflow: auto;
}

.wcms-lightbox-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #667085;
    background: #f5f7fa;
    border: 1px solid var(--wcms-border);
    padding: 0;
    z-index: 10;
}

.wcms-lightbox-close:hover,
.wcms-lightbox-close:focus {
    color: var(--wcms-text);
    background: #ffffff;
}

.wcms-lightbox-modal canvas {
    display: block;
}

@media (max-width: 1080px) {
    .wcms-workflow {
        grid-template-columns: 1fr;
    }

    .wcms-configurator {
        grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    }

    .wcms-col-right {
        grid-column: 1 / -1;
    }

    .wcms-summary {
        position: static;
    }
}

@media (max-width: 767px) {
    .wcms-calculator {
        padding: 18px;
        border-radius: 10px;
    }

    .wcms-calculator__header,
    .wcms-panel__header--split {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .wcms-calculator__header h3 {
        font-size: 24px;
    }

    .wcms-calculator__badges {
        justify-content: flex-start;
    }

    .wcms-workflow__step {
        padding: 11px 12px;
    }

    .wcms-configurator {
        grid-template-columns: 1fr;
    }

    .wcms-panel,
    .wcms-summary {
        padding: 16px;
    }

    .wcms-file-entry-dims {
        grid-template-columns: 1fr;
    }

    .wcms-file-entry-copies {
        max-width: none;
    }

    .wcms-preview-actions {
        flex-direction: column;
    }

    .wcms-preview-btn,
    .wcms-optimize-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wcms-spinner,
    .wcms-preview-btn,
    .wcms-optimize-btn,
    .wcms-summary-action .wcms-add-to-cart,
    .wcms-file-remove {
        animation: none !important;
        transition: none !important;
    }
}
