/**
 * Custom Sticker Designer - Frontend Styles
 *
 * @package CustomStickerDesigner
 */

/* Main Container */
.csd-designer {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 20px 20px;
}

/* Section Titles */
.csd-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.csd-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #0073aa;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
}

/* Shape Selection */
.csd-shape-section {
    margin-bottom: 30px;
}

.csd-shapes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.csd-shape-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 20px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.csd-shape-btn:hover {
    border-color: #0073aa;
    background: #f8f9fa;
}

.csd-shape-btn.active {
    border-color: #0073aa;
    background: #e7f3ff;
}

.csd-shape-btn svg {
    width: 40px;
    height: 40px;
}

.csd-shape-btn span {
    font-size: 12px;
    color: #666;
}

/* Main Area Layout */
.csd-main-area {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
}

/* Canvas Section */
.csd-canvas-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.csd-canvas-container {
    position: relative;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#csd-canvas {
    display: block;
    max-width: 100%;
}

/* Resize Handles */
.csd-resize-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #0073aa;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: none;
}

.csd-resize-nw { top: -7px; left: -7px; cursor: nw-resize; }
.csd-resize-ne { top: -7px; right: -7px; cursor: ne-resize; }
.csd-resize-sw { bottom: -7px; left: -7px; cursor: sw-resize; }
.csd-resize-se { bottom: -7px; right: -7px; cursor: se-resize; }

/* Canvas Overlays */
.csd-canvas-overlay,
.csd-upload-overlay,
/* Loading Modal Popup */
.csd-loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
}

.csd-loading-modal.active {
    display: flex;
}

.csd-loading-modal-content {
    background: #fff;
    padding: 40px 50px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    min-width: 250px;
}

.csd-loading-modal-content p {
    color: #333;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    margin: 0;
}

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

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

.csd-canvas-overlay p {
    color: #666;
    font-size: 16px;
}

/* Upload Area */
.csd-upload-area {
    text-align: center;
    padding: 40px;
}

.csd-upload-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #0073aa;
}

.csd-upload-area p {
    margin: 10px 0;
    color: #666;
}

.csd-upload-or {
    font-size: 12px;
    color: #999;
}

.csd-upload-btn {
    margin-top: 10px !important;
}

.csd-upload-info {
    font-size: 12px !important;
    color: #999 !important;
    margin-top: 15px !important;
}

/* Canvas Legend */
.csd-canvas-legend {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.csd-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
}

.csd-legend-line {
    width: 20px;
    height: 2px;
}

.csd-legend-cut .csd-legend-line {
    background: #e74c3c;
}

.csd-legend-bleed .csd-legend-line {
    background: #3498db;
    border-style: dashed;
}

/* Image Controls */
.csd-image-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.csd-image-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.csd-image-btn {
    padding: 5px 10px !important;
}

.csd-image-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Zoom Control */
.csd-zoom-control {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.csd-zoom-control > label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.csd-zoom-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.csd-zoom-slider-row input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

.csd-zoom-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.csd-zoom-slider-row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.csd-zoom-label-min,
.csd-zoom-label-max {
    font-size: 11px;
    color: #999;
    min-width: 35px;
}

.csd-zoom-label-min {
    text-align: right;
}

.csd-zoom-label-max {
    text-align: left;
}

.csd-zoom-value {
    font-size: 13px;
    color: #333;
    text-align: center;
    font-weight: 500;
}

.csd-image-hint {
    font-size: 12px;
    color: #999;
    text-align: center;
}

/* Size Controls */
.csd-size-controls {
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.csd-size-inputs {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.csd-size-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.csd-size-field label {
    font-size: 12px;
    color: #666;
}

.csd-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.csd-input-group input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.csd-input-suffix {
    color: #666;
    font-size: 14px;
}

.csd-size-x {
    font-size: 18px;
    color: #999;
    padding-bottom: 8px;
}

.csd-rotation-field select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 80px;
}

/* Rotation Controls */
.csd-rotation-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.csd-rotation-controls > label {
    display: block;
    font-size: 12px;
    color: #666;
    font-weight: 500;
    margin-bottom: 8px;
}

.csd-rotation-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.csd-rotation-slider-row input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

.csd-rotation-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.csd-rotation-slider-row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.csd-rotation-input-group {
    display: flex;
    align-items: center;
    min-width: 70px;
}

.csd-rotation-input-group input {
    width: 50px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    text-align: center;
}

.csd-rotation-suffix {
    padding: 6px 8px;
    background: #eee;
    border: 1px solid #ddd;
    border-left: none;
    border-radius: 0 4px 4px 0;
    color: #666;
    font-size: 14px;
}

.csd-rotation-snaps {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

.csd-snap-btn {
    flex: 1;
    padding: 6px 2px;
    font-size: 11px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.csd-snap-btn:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.csd-snap-btn.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.csd-size-info {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

.csd-size-info strong {
    color: #333;
}

/* Design Notes */
.csd-design-notes {
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
}

/* Options Section */
.csd-options-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Mockup Preview */
.csd-mockup-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.csd-mockup-preview {
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
}

#csd-mockup-canvas {
    display: block;
    width: 100%;
    height: auto;
}

.csd-mockup-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.csd-mockup-btn {
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.csd-mockup-btn:hover {
    background: #eee;
}

.csd-mockup-btn.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.csd-mockup-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Order Section */
.csd-order-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

/* Quantity Field */
.csd-quantity-field {
    margin-bottom: 20px;
}

.csd-quantity-field > label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.csd-quantity-simple {
    width: 100px;
    height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background: #fff;
    color: #333;
    padding: 0 10px;
}

.csd-quantity-simple:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.csd-qty-hint {
    margin-top: 5px;
    font-size: 12px;
    color: #999;
}

/* Contour Cut */
.csd-contour-field {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.csd-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.csd-checkbox-label input {
    margin-top: 3px;
}

.csd-checkbox-text {
    font-weight: 500;
}

.csd-contour-fee {
    color: #666;
    font-weight: normal;
}

.csd-contour-hint {
    margin: 8px 0 0 24px;
    font-size: 12px;
    color: #666;
}

/* Pricing Display */
.csd-pricing-display {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.csd-price-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.csd-price-label {
    color: #666;
}

.csd-price-value {
    font-weight: 500;
}

.csd-price-subtotal {
    border-top: 1px solid #ddd;
    padding-top: 12px;
    margin-top: 4px;
}

.csd-price-total {
    border-top: 2px solid #333;
    padding-top: 12px;
    margin-top: 4px;
    font-size: 18px;
}

.csd-price-total .csd-price-value {
    color: #0073aa;
}

/* Pricing Tiers Toggle */
.csd-pricing-tiers {
    margin-bottom: 15px;
}

.csd-tiers-toggle {
    background: none;
    border: none;
    color: #0073aa;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.csd-tiers-toggle:hover {
    text-decoration: underline;
}

.csd-tiers-toggle .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.csd-tiers-list {
    margin-top: 10px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
}

.csd-tier-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
}

.csd-tier-row.active {
    font-weight: 600;
    color: #0073aa;
}

/* Cart Section */
.csd-cart-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

/* Final Preview */
.csd-final-preview {
    margin-bottom: 20px;
}

.csd-final-preview h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.csd-final-preview-canvas {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    text-align: center;
}

#csd-preview-canvas {
    max-width: 100%;
    height: auto;
}

/* Approval */
.csd-approval {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 4px;
}

.csd-approval-label {
    font-weight: 600;
}

.csd-approval-note {
    margin: 8px 0 0 24px;
    font-size: 12px;
    color: #856404;
}

/* Resolution Warning */
.csd-resolution-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 15px;
    background: #f8d7da;
    border-radius: 4px;
    margin-bottom: 20px;
    color: #721c24;
}

.csd-resolution-warning .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.csd-resolution-warning p {
    margin: 0;
    font-size: 13px;
}

/* Add to Cart Button */
.csd-add-to-cart {
    width: 100%;
    padding: 15px 20px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.csd-add-to-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive */
@media screen and (max-width: 900px) {
    .csd-main-area {
        grid-template-columns: 1fr;
    }
    
    .csd-options-section {
        order: 2;
    }
}

@media screen and (max-width: 600px) {
    .csd-designer {
        padding: 10px;
    }
    
    .csd-shapes-list {
        justify-content: center;
    }
    
    .csd-shape-btn {
        min-width: 70px;
        padding: 10px 15px;
    }
    
    .csd-size-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .csd-size-x {
        display: none;
    }
    
    .csd-input-group input {
        width: 100%;
    }
}

/* Moderation Overlay */
.csd-moderation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
}

.csd-moderation-content {
    max-width: 500px;
    width: 100%;
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.csd-moderation-message {
    text-align: center;
    margin-bottom: 25px;
}

.csd-moderation-message .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #f0ad4e;
    margin-bottom: 15px;
}

.csd-moderation-message h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #333;
}

.csd-moderation-message p {
    color: #666;
    margin: 0 0 10px;
    line-height: 1.5;
}

.csd-moderation-message p.csd-moderation-help {
    margin-top: 15px;
    font-style: italic;
}

.csd-moderation-reasons {
    text-align: left;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    padding: 15px 15px 15px 35px;
    margin: 15px 0;
    list-style-type: disc;
}

.csd-moderation-reasons li {
    color: #5d4037;
    margin-bottom: 8px;
    line-height: 1.4;
}

.csd-moderation-reasons li:last-child {
    margin-bottom: 0;
}

/* Review Form */
.csd-review-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.csd-form-field {
    margin-bottom: 15px;
}

.csd-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.csd-form-field label .required {
    color: #c00;
}

.csd-form-field input[type="text"],
.csd-form-field input[type="email"],
.csd-form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.csd-form-field input:focus,
.csd-form-field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.csd-field-hint {
    margin: 5px 0 0;
    font-size: 12px;
    color: #888;
}

.csd-review-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.csd-review-actions .button {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    text-align: center;
}

.csd-submit-review {
    background: #0073aa;
    color: #fff;
    border: none;
}

.csd-submit-review:hover {
    background: #005177;
}

.csd-try-different {
    background: #f7f7f7;
    border: 1px solid #ddd;
    color: #333;
}

/* Review Submitted State */
.csd-review-submitted {
    text-align: center;
    padding: 30px 20px;
}

.csd-review-submitted .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #46b450;
    margin-bottom: 15px;
}

.csd-review-submitted h3 {
    margin: 0 0 10px;
    color: #46b450;
}

.csd-review-submitted p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Expedited Processing */
.csd-expedited-field {
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3c4 100%);
    border-radius: 8px;
    border: 1px solid #ffc107;
}

.csd-expedited-field .csd-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}

.csd-expedited-field input[type="checkbox"] {
    margin-top: 3px;
    margin-right: 10px;
}

.csd-expedited-field .csd-checkbox-text {
    font-weight: 600;
    color: #333;
}

.csd-expedited-fee {
    color: #856404;
    font-weight: 500;
}

.csd-expedited-hint {
    margin: 8px 0 0 24px;
    font-size: 13px;
    color: #856404;
}

/* Processing Time Display */
.csd-processing-time {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: #f0f8ff;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #d4e9f7;
}

.csd-processing-time .dashicons {
    color: #0073aa;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.csd-processing-label {
    color: #666;
    font-size: 13px;
}

.csd-processing-value {
    font-weight: 600;
    color: #333;
}

.csd-processing-time.expedited {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #81c784;
}

.csd-processing-time.expedited .dashicons {
    color: #388e3c;
}

.csd-processing-time.expedited .csd-processing-value {
    color: #2e7d32;
}

/* Expedited Price Row */
.csd-price-expedited {
    color: #856404;
}

.csd-price-expedited .csd-price-value {
    color: #856404;
}

/* ============================================
   V2 LAYOUT - Side by Side (Compact)
   ============================================ */

.csd-designer-v2 {
    max-width: 100%;
    padding: 10px 0;
}

/* Main Layout - 70/30 split */
.csd-main-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* Canvas Panel - 70% */
.csd-canvas-panel {
    flex: 1 1 70%;
    min-width: 0;
}

.csd-designer-v2 .csd-canvas-container {
    position: relative;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.csd-designer-v2 .csd-canvas-legend {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 10px;
}

.csd-legend-dashed {
    border-top: 2px dashed;
    height: 0 !important;
    background: transparent !important;
}

/* Controls Panel - 30% */
.csd-controls-panel {
    flex: 0 0 280px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Control Groups - Tight */
.csd-control-group {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 8px 10px;
}

.csd-control-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.csd-control-header h3 {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

/* Control Labels */
.csd-control-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

/* Info Button */
.csd-info-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #ccc;
    transition: color 0.2s;
    position: relative;
}

.csd-info-btn:hover {
    color: #0073aa;
}

.csd-info-btn .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

/* Tooltip */
.csd-info-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 400;
    white-space: normal;
    width: 150px;
    text-align: center;
    z-index: 100;
    margin-bottom: 5px;
    line-height: 1.3;
}

.csd-info-btn[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #333;
    margin-bottom: -3px;
    z-index: 100;
}

/* Combined Shape & Size Group */
.csd-shape-size-group .csd-control-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.csd-shape-col {
    flex: 0 0 90px;
}

.csd-size-col {
    flex: 1;
}

.csd-size-inputs-compact {
    display: flex;
    align-items: center;
    gap: 3px;
}

.csd-size-inputs-compact input {
    width: 55px;
    padding: 5px 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.csd-size-inputs-compact .csd-size-x {
    color: #999;
    font-size: 11px;
    padding: 0;
}

.csd-size-inputs-compact .csd-size-unit {
    color: #888;
    font-size: 11px;
    margin-left: 2px;
}

.csd-size-info-compact {
    margin-top: 6px;
    font-size: 11px;
    color: #888;
    text-align: center;
    padding-top: 6px;
    border-top: 1px solid #eee;
}

/* Shape Dropdown - Compact */
.csd-shape-dropdown {
    position: relative;
}

.csd-shape-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 6px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.csd-shape-selected:hover {
    border-color: #0073aa;
}

.csd-shape-selected-inner {
    display: flex;
    align-items: center;
    gap: 5px;
}

.csd-shape-selected svg {
    width: 16px;
    height: 16px;
}

.csd-shape-selected-name {
    font-size: 11px;
    color: #333;
}

.csd-shape-selected .dashicons {
    color: #888;
    font-size: 12px;
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}

.csd-shape-dropdown.open .csd-shape-selected .dashicons {
    transform: rotate(180deg);
}

.csd-shape-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 50;
    margin-top: 2px;
    display: none;
    max-height: 180px;
    overflow-y: auto;
}

.csd-shape-dropdown.open .csd-shape-options {
    display: block;
}

.csd-shape-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.csd-shape-option:hover {
    background: #f5f5f5;
}

.csd-shape-option.active {
    background: #e7f3ff;
}

.csd-shape-option svg {
    width: 14px;
    height: 14px;
}

.csd-shape-option span {
    font-size: 11px;
    color: #333;
}

/* Legacy shapes grid - hidden */
.csd-designer-v2 .csd-shapes-grid {
    display: none;
}

/* v1.19.39: Shape list (replaces dropdown) */
.csd-shape-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.csd-shape-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.csd-shape-list-item:hover {
    background: #e8f4fc;
    border-color: #b3d7f0;
}

.csd-shape-list-item.active {
    background: #e8f4fc;
    border-color: #0073aa;
}

.csd-shape-list-item svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.csd-shape-list-item svg path,
.csd-shape-list-item svg circle,
.csd-shape-list-item svg rect,
.csd-shape-list-item svg ellipse {
    fill: #0073aa;
    transition: fill 0.15s ease;
}

.csd-shape-list-item:hover svg path,
.csd-shape-list-item:hover svg circle,
.csd-shape-list-item:hover svg rect,
.csd-shape-list-item:hover svg ellipse {
    fill: #005a87;
}

.csd-shape-list-item .csd-shape-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    flex-grow: 1;
}

.csd-shape-list-item .csd-shape-price {
    font-size: 11px;
    color: #666;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
}

.csd-shape-list-item.active .csd-shape-price {
    background: #cce5ff;
    color: #004085;
}

/* Image Controls - Compact */
.csd-image-actions {
    display: flex;
    gap: 4px;
}

.csd-icon-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.csd-icon-btn:hover {
    background: #e8f4fc;
    border-color: #0073aa;
    color: #0073aa;
}

.csd-icon-btn .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

/* Sliders - Compact */
.csd-slider-control {
    margin-bottom: 8px;
}

.csd-slider-control:last-child {
    margin-bottom: 0;
}

.csd-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.csd-slider-header label {
    font-size: 11px;
    color: #555;
}

.csd-slider-value {
    font-size: 11px;
    font-weight: 600;
    color: #0073aa;
}

.csd-slider-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.csd-slider-min,
.csd-slider-max {
    font-size: 9px;
    color: #aaa;
    min-width: 20px;
}

.csd-slider-max {
    text-align: right;
}

.csd-slider-control input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
}

.csd-slider-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.csd-slider-control input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Rotation Value Input - Compact */
.csd-rotation-value-group {
    display: flex;
    align-items: center;
    gap: 1px;
}

.csd-rotation-value-group input {
    width: 36px;
    padding: 2px 3px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 11px;
    text-align: center;
}

.csd-rotation-value-group span {
    color: #888;
    font-size: 11px;
}

/* Rotation Snap Buttons - Compact */
.csd-designer-v2 .csd-rotation-snaps {
    display: flex;
    gap: 3px;
    margin-top: 4px;
}

.csd-designer-v2 .csd-snap-btn {
    flex: 1;
    padding: 3px 4px;
    font-size: 9px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.csd-designer-v2 .csd-snap-btn:hover {
    background: #e8f4fc;
    border-color: #0073aa;
}

.csd-designer-v2 .csd-snap-btn.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* Hint Text - Compact */
.csd-hint {
    margin: 4px 0 0 0;
    font-size: 10px;
    color: #999;
    font-style: italic;
}

/* Quantity Input - Compact */
.csd-quantity-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.csd-quantity-input {
    width: 60px;
    padding: 5px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

.csd-quantity-label {
    color: #888;
    font-size: 11px;
}

/* Tiers Toggle - Compact */
.csd-tiers-toggle-wrap {
    margin-top: 4px;
}

.csd-designer-v2 .csd-tiers-toggle {
    background: none;
    border: none;
    color: #0073aa;
    font-size: 10px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

.csd-designer-v2 .csd-tiers-toggle:hover {
    text-decoration: underline;
}

.csd-designer-v2 .csd-tiers-toggle .dashicons {
    font-size: 10px;
    width: 10px;
    height: 10px;
    transition: transform 0.2s;
}

.csd-designer-v2 .csd-tiers-toggle.open .dashicons {
    transform: rotate(180deg);
}

.csd-designer-v2 .csd-tiers-list {
    margin-top: 6px;
    padding: 6px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 10px;
}

/* Option Checkboxes - Compact */
.csd-option-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #f9f9f9;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 4px;
}

.csd-option-checkbox:last-child {
    margin-bottom: 0;
}

.csd-option-checkbox:hover {
    background: #f0f0f0;
}

.csd-option-checkbox input[type="checkbox"] {
    margin: 0;
    width: 12px;
    height: 12px;
}

.csd-option-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.csd-option-label {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #333;
}

.csd-option-price {
    font-weight: 600;
    color: #666;
    font-size: 11px;
}

/* Pricing Group - Compact */
.csd-pricing-group {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #dee2e6;
    padding: 8px 10px;
}

.csd-pricing-rows {
    margin-bottom: 6px;
}

.csd-designer-v2 .csd-price-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 11px;
}

.csd-designer-v2 .csd-price-row.csd-price-total {
    border-top: 1px solid #dee2e6;
    margin-top: 4px;
    padding-top: 6px;
    font-size: 13px;
}

.csd-designer-v2 .csd-price-total .csd-price-label,
.csd-designer-v2 .csd-price-total .csd-price-value {
    font-weight: 700;
    color: #333;
}

.csd-designer-v2 .csd-price-total .csd-price-value {
    color: #0073aa;
    font-size: 14px;
}

.csd-designer-v2 .csd-processing-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #666;
    padding: 4px 6px;
    background: #fff;
    border-radius: 3px;
}

.csd-designer-v2 .csd-processing-time .dashicons {
    font-size: 10px;
    width: 10px;
    height: 10px;
}

/* Upload Overlay V2 */
.csd-designer-v2 .csd-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.98);
    z-index: 5;
}

.csd-designer-v2 .csd-upload-area {
    text-align: center;
    padding: 30px;
}

.csd-upload-icon .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #0073aa;
    margin-bottom: 10px;
}

.csd-upload-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
}

.csd-upload-subtitle {
    font-size: 12px;
    color: #666;
    margin: 0 0 12px 0;
}

.csd-designer-v2 .csd-upload-btn {
    padding: 8px 20px;
    font-size: 12px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.csd-designer-v2 .csd-upload-btn:hover {
    background: #005a87;
}

.csd-upload-info {
    margin-top: 8px;
    font-size: 10px;
    color: #999;
}

/* Below Fold Section */
.csd-below-fold {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e5e5e5;
}

.csd-preview-section h3,
.csd-approval-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

.csd-mockup-container {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.csd-designer-v2 .csd-mockup-preview {
    flex: 0 0 250px;
    background: #f8f9fa;
    border-radius: 6px;
    overflow: hidden;
}

.csd-designer-v2 .csd-mockup-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Approval Section - Compact */
.csd-approval-section {
    margin-top: 24px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.csd-designer-v2 .csd-final-preview {
    max-width: 350px;
    margin: 0 auto 16px;
}

.csd-designer-v2 .csd-final-preview-canvas {
    background: #f8f9fa;
    border-radius: 6px;
    overflow: hidden;
}

.csd-approval-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.csd-approval-note {
    font-size: 12px;
    color: #666;
    margin: 0 0 12px 0;
}

.csd-designer-v2 .csd-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
}

.csd-designer-v2 .csd-add-to-cart .dashicons {
    font-size: 16px;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .csd-main-layout {
        flex-direction: column;
    }
    
    .csd-canvas-panel,
    .csd-controls-panel {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    .csd-designer-v2 .csd-canvas-container {
        min-height: 300px;
    }
    
    .csd-mockup-container {
        flex-direction: column;
    }
    
    .csd-designer-v2 .csd-mockup-preview {
        flex: 1 1 auto;
        width: 100%;
    }
}

@media (max-width: 600px) {
    .csd-designer-v2 {
        padding: 10px;
    }
    
    .csd-control-group {
        padding: 10px;
    }
    
    .csd-designer-v2 .csd-size-inputs {
        flex-wrap: wrap;
    }
    
    .csd-designer-v2 .csd-size-field {
        flex: 1 1 45%;
    }
    
    .csd-size-x {
        flex: 0 0 10%;
        text-align: center;
        padding-top: 14px;
    }
}

/* ============================================
   V3 LAYOUT - With Text Support
   ============================================ */

.csd-designer-v3 {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Break out of Flatsome container */
.csd-designer-v3 .csd-main-layout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    width: 100%;
}

/* Canvas Panel */
.csd-designer-v3 .csd-canvas-panel {
    flex: 1;
    min-width: 0;
}

.csd-designer-v3 .csd-canvas-container {
    position: relative;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.csd-designer-v3 .csd-canvas-legend {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 10px;
    color: #888;
}

.csd-designer-v3 .csd-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.csd-designer-v3 .csd-legend-line {
    width: 16px;
    height: 2px;
}

.csd-designer-v3 .csd-legend-solid {
    background: #0073aa;
}

.csd-designer-v3 .csd-legend-dashed {
    background: repeating-linear-gradient(90deg, #ff6b6b 0, #ff6b6b 4px, transparent 4px, transparent 8px);
}

/* Controls Panel */
.csd-designer-v3 .csd-controls-panel {
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* Terms Modal */
.csd-designer-v3 .csd-terms-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 20px;
}

.csd-designer-v3 .csd-terms-modal.visible {
    display: flex;
}

.csd-designer-v3 .csd-terms-content {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.csd-designer-v3 .csd-terms-content h2 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: #333;
    text-align: center;
}

.csd-designer-v3 .csd-terms-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.csd-designer-v3 .csd-terms-section:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.csd-designer-v3 .csd-terms-section h3 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #333;
}

.csd-designer-v3 .csd-terms-section p {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #555;
}

.csd-designer-v3 .csd-terms-section ul {
    margin: 0 0 15px 0;
    padding-left: 20px;
}

.csd-designer-v3 .csd-terms-section li {
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
}

.csd-designer-v3 .csd-terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
}

.csd-designer-v3 .csd-terms-checkbox input {
    margin-top: 2px;
    flex-shrink: 0;
}

.csd-designer-v3 .csd-terms-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.csd-designer-v3 .csd-terms-back {
    flex: 1;
    padding: 14px 24px;
    font-size: 15px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.csd-designer-v3 .csd-terms-back:hover {
    background: #005a87;
}

.csd-designer-v3 .csd-terms-continue {
    flex: 1;
    padding: 14px 24px;
    font-size: 15px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.csd-designer-v3 .csd-terms-continue:hover:not(:disabled) {
    background: #005a87;
}

.csd-designer-v3 .csd-terms-continue:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Cards - Accordion Style */
.csd-designer-v3 .csd-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    position: relative;
}

/* First card needs higher z-index for dropdown */
.csd-designer-v3 .csd-card[data-card="shape"] {
    z-index: 100;
}

.csd-designer-v3 .csd-card-header {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: #f9f9f9;
    cursor: pointer;
    user-select: none;
}

.csd-designer-v3 .csd-card-header:hover {
    background: #f0f0f0;
}

.csd-designer-v3 .csd-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.csd-designer-v3 .csd-card-preview {
    font-size: 11px;
    color: #666;
    margin-right: 8px;
}

.csd-designer-v3 .csd-card-toggle {
    color: #888;
    font-size: 14px;
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}

.csd-designer-v3 .csd-accordion.open .csd-card-toggle {
    transform: rotate(180deg);
}

.csd-designer-v3 .csd-accordion .csd-card-body {
    display: none;
    padding: 8px 10px;
    border-top: 1px solid #eee;
}

.csd-designer-v3 .csd-accordion.open .csd-card-body {
    display: block;
}

/* Product Options */
#csd-product-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.csd-designer-v3 .csd-checkbox,
.csd-designer-v3 .csd-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    padding: 6px 0;
}

.csd-designer-v3 .csd-checkbox input,
.csd-designer-v3 .csd-radio input {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.csd-designer-v3 .csd-option-price {
    margin-left: auto;
    color: #666;
    font-size: 11px;
}

.csd-designer-v3 .csd-option-tooltip {
    color: #999;
    font-size: 14px;
    cursor: help;
}

.csd-designer-v3 .csd-option-group {
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 8px;
    margin-top: 4px;
}

.csd-designer-v3 .csd-option-group-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.csd-designer-v3 .csd-no-options {
    font-size: 12px;
    color: #999;
    font-style: italic;
    margin: 0;
}

.csd-designer-v3 .csd-option-price-row {
    font-size: 11px;
}

.csd-designer-v3 .csd-color-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1px solid #ddd;
    border-radius: 3px;
    vertical-align: middle;
}

.csd-designer-v3 .csd-card-status {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #f0f0f0;
}

/* Edit Mode Radios */
.csd-designer-v3 .csd-edit-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.csd-designer-v3 .csd-edit-radio input[type="radio"] {
    margin: 0;
    width: 14px;
    height: 14px;
}

/* Labels */
.csd-designer-v3 .csd-label {
    display: block;
    font-size: 10px;
    color: #666;
    margin-bottom: 3px;
    text-transform: uppercase;
}

/* Rows and Columns */
.csd-designer-v3 .csd-row {
    display: flex;
    gap: 8px;
}

.csd-designer-v3 .csd-col {
    flex: 1;
}

.csd-designer-v3 .csd-col-size {
    flex: 1.5;
}

/* Shape Dropdown */
.csd-designer-v3 .csd-shape-dropdown {
    position: relative;
    min-width: 120px;
}

.csd-designer-v3 .csd-shape-selected {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    min-width: 100px;
}

.csd-designer-v3 .csd-shape-selected:hover {
    border-color: #0073aa;
}

.csd-designer-v3 .csd-shape-selected svg {
    width: 20px;
    height: 14px;
    flex-shrink: 0;
}

.csd-designer-v3 .csd-shape-selected .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
    margin-left: auto;
    color: #888;
}

.csd-designer-v3 .csd-shape-options {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 130px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.csd-designer-v3 .csd-shape-dropdown {
    position: relative;
    z-index: 10;
}

.csd-designer-v3 .csd-shape-dropdown.open {
    z-index: 1001;
}

.csd-designer-v3 .csd-shape-dropdown.open .csd-shape-options {
    display: block;
}

.csd-designer-v3 .csd-shape-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.csd-designer-v3 .csd-shape-option:hover {
    background: #f5f5f5;
}

.csd-designer-v3 .csd-shape-option.active {
    background: #e7f3ff;
}

.csd-designer-v3 .csd-shape-option svg {
    width: 16px;
    width: 20px;
    height: 14px;
    flex-shrink: 0;
}

.csd-designer-v3 .csd-shape-option svg path {
    fill: #0073aa;
}

/* Size Inputs */
.csd-designer-v3 .csd-size-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.csd-designer-v3 .csd-size-row input {
    width: 42px;
    padding: 4px 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.csd-designer-v3 .csd-size-row span {
    color: #888;
    font-size: 11px;
}

.csd-designer-v3 .csd-lock-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.csd-designer-v3 .csd-lock-btn:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.csd-designer-v3 .csd-lock-btn.locked {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.csd-designer-v3 .csd-lock-btn .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
    line-height: 12px;
}

.csd-designer-v3 .csd-size-info {
    font-size: 10px;
    color: #888;
    text-align: center;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #eee;
}

/* Color Picker */
.csd-designer-v3 .csd-color-picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.csd-designer-v3 .csd-color-picker-row .csd-label {
    margin: 0;
    min-width: 35px;
}

.csd-designer-v3 .csd-color-picker-inline {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Color Picker Trigger Button */
.csd-designer-v3 .csd-color-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s;
}

.csd-designer-v3 .csd-color-trigger:hover {
    border-color: #0073aa;
}

.csd-designer-v3 .csd-color-trigger .csd-color-preview {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.15);
}

.csd-designer-v3 .csd-color-trigger .csd-color-hex {
    font-size: 12px;
    font-family: monospace;
    color: #666;
}

.csd-designer-v3 .csd-color-trigger-small {
    padding: 4px 8px;
    gap: 6px;
}

.csd-designer-v3 .csd-color-trigger-small .csd-color-preview {
    width: 18px;
    height: 18px;
}

.csd-designer-v3 .csd-color-trigger-small .csd-color-hex {
    font-size: 11px;
}

/* Color Picker Popup */
.csd-color-popup {
    position: fixed;
    z-index: 100001;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    padding: 8px;
}

.csd-color-popup-content {
    display: flex;
    flex-direction: column;
}

/* Color Grid in Popup */
.csd-color-popup .csd-color-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.csd-color-popup .csd-grid-row {
    display: flex;
    gap: 2px;
}

.csd-color-popup .csd-grid-cell {
    width: 22px;
    height: 22px;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    outline: none;
    border-radius: 2px;
}

.csd-color-popup .csd-grid-cell:hover {
    transform: scale(1.25);
    z-index: 10;
    box-shadow: 0 0 8px rgba(0,0,0,0.4);
}

.csd-color-popup .csd-grid-cell-light {
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
}

.csd-color-popup .csd-grid-cell-gray {
    margin-left: 4px;
}

.csd-designer-v3 .csd-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.csd-designer-v3 .csd-slider-row input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 2px;
    outline: none;
}

.csd-designer-v3 .csd-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.csd-designer-v3 .csd-slider-row input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.csd-designer-v3 .csd-slider-row input[type="number"] {
    width: 50px;
    text-align: center;
}

.csd-designer-v3 .csd-corner-radius-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.csd-designer-v3 .csd-corner-radius-row .csd-slider-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.csd-designer-v3 .csd-corner-radius-row .csd-slider-row input[type="number"] {
    width: 45px;
    padding: 4px;
    font-size: 12px;
}

.csd-designer-v3 .csd-unit {
    font-size: 11px;
    color: #666;
    margin-left: -4px;
}

.csd-designer-v3 .csd-style-btns-inline {
    display: flex;
    gap: 4px;
}

.csd-designer-v3 .csd-style-btns-inline .csd-style-btn {
    width: 28px;
    height: 28px;
}

.csd-designer-v3 input[type="color"] {
    width: 32px;
    height: 24px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.csd-designer-v3 .csd-color-hex {
    font-size: 11px;
    color: #666;
    font-family: monospace;
}

/* Buttons */
.csd-designer-v3 .csd-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 11px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
}

.csd-designer-v3 .csd-btn:hover {
    border-color: #0073aa;
    color: #0073aa;
}

.csd-designer-v3 .csd-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.csd-designer-v3 .csd-btn-small {
    padding: 4px 8px;
    font-size: 10px;
}

.csd-designer-v3 .csd-btn-small .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

.csd-designer-v3 .csd-btn-upload {
    width: 100%;
    justify-content: center;
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.csd-designer-v3 .csd-btn-upload:hover {
    background: #005a87;
    border-color: #005a87;
    color: #fff;
}

.csd-designer-v3 .csd-btn-full {
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
}

.csd-designer-v3 .csd-btn-remove {
    color: #d63638;
    border-color: #d63638;
}

.csd-designer-v3 .csd-btn-remove:hover {
    background: #d63638;
    color: #fff;
}

.csd-designer-v3 .csd-link-btn {
    background: none;
    border: none;
    color: #0073aa;
    font-size: 10px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

.csd-designer-v3 .csd-link-btn:hover {
    text-decoration: underline;
}

.csd-designer-v3 .csd-link-btn .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

/* Upload Row */
.csd-designer-v3 .csd-upload-row {
    text-align: center;
}

.csd-designer-v3 .csd-upload-hint {
    display: block;
    font-size: 9px;
    color: #999;
    margin-top: 4px;
}

/* Image Controls */
.csd-designer-v3 .csd-image-controls,
.csd-designer-v3 .csd-text-controls {
    margin-top: 8px;
}

.csd-designer-v3 .csd-control-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.csd-designer-v3 .csd-control-row label {
    font-size: 10px;
    color: #666;
    min-width: 40px;
}

.csd-designer-v3 .csd-control-row input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: #e0e0e0;
    border-radius: 2px;
}

.csd-designer-v3 .csd-control-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
}

.csd-designer-v3 .csd-control-row input[type="number"] {
    width: 40px;
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 11px;
    text-align: center;
}

.csd-designer-v3 .csd-snap-btns {
    display: flex;
    gap: 3px;
    margin-bottom: 6px;
}

.csd-designer-v3 .csd-snap-btn {
    flex: 1;
    padding: 3px;
    font-size: 9px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #f9f9f9;
    cursor: pointer;
}

.csd-designer-v3 .csd-snap-btn:hover {
    border-color: #0073aa;
}

.csd-designer-v3 .csd-snap-btn.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Text Controls */
.csd-designer-v3 #csd-text-font {
    width: 100%;
    padding: 6px 8px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.csd-designer-v3 #csd-text-font option {
    padding: 8px;
    font-size: 16px;
}

.csd-designer-v3 .csd-text-list {
    max-height: 80px;
    overflow-y: auto;
    margin-bottom: 6px;
}

.csd-designer-v3 .csd-no-text {
    font-size: 10px;
    color: #999;
    text-align: center;
    margin: 0;
    padding: 8px 0;
}

.csd-designer-v3 .csd-text-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    margin-bottom: 3px;
    background: #f9f9f9;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
}

.csd-designer-v3 .csd-text-item:hover {
    background: #e7f3ff;
}

.csd-designer-v3 .csd-text-item.selected {
    background: #e7f3ff;
    border: 1px solid #0073aa;
}

.csd-designer-v3 .csd-text-item-preview {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.csd-designer-v3 .csd-text-item-actions {
    display: flex;
    align-items: center;
    gap: 1px;
    flex-shrink: 0;
}

.csd-designer-v3 .csd-text-layer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 2px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.csd-designer-v3 .csd-text-layer-btn:hover:not(:disabled) {
    background: #ddd;
    color: #333;
}

.csd-designer-v3 .csd-text-layer-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.csd-designer-v3 .csd-text-layer-btn .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

.csd-designer-v3 .csd-text-item-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 2px;
    color: #cc1818;
    cursor: pointer;
    transition: all 0.2s;
}

.csd-designer-v3 .csd-text-item-delete:hover {
    background: #fee;
    color: #a00;
}

.csd-designer-v3 .csd-text-item-delete .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

.csd-designer-v3 .csd-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.csd-designer-v3 .csd-row-2col > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.csd-designer-v3 .csd-row-2col label {
    min-width: auto;
}

.csd-designer-v3 .csd-row-2col select,
.csd-designer-v3 .csd-row-2col input[type="number"] {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 11px;
}

.csd-designer-v3 .csd-row-2col input[type="color"] {
    width: 100%;
    height: 26px;
}

.csd-designer-v3 .csd-text-controls input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.csd-designer-v3 .csd-style-btns {
    justify-content: flex-start;
    gap: 4px;
}

.csd-designer-v3 .csd-style-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csd-designer-v3 .csd-style-btn:hover {
    border-color: #0073aa;
}

.csd-designer-v3 .csd-style-btn.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Quantity */
.csd-designer-v3 .csd-qty-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.csd-designer-v3 .csd-qty-row input {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.csd-designer-v3 .csd-qty-row span {
    font-size: 11px;
    color: #666;
}

.csd-designer-v3 .csd-tiers-list {
    margin-top: 6px;
    padding: 6px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 10px;
}

/* Options */
.csd-designer-v3 .csd-options-body {
    padding: 6px 10px;
}

.csd-designer-v3 .csd-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: #f9f9f9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    margin-bottom: 4px;
}

.csd-designer-v3 .csd-checkbox:last-child {
    margin-bottom: 0;
}

.csd-designer-v3 .csd-checkbox input {
    margin: 0;
}

.csd-designer-v3 .csd-checkbox span:first-of-type {
    flex: 1;
}

.csd-designer-v3 .csd-option-price {
    font-weight: 600;
    color: #666;
}

/* Pricing Card */
.csd-designer-v3 .csd-card-pricing {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.csd-designer-v3 .csd-price-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 11px;
}

.csd-designer-v3 .csd-price-total {
    border-top: 1px solid #ddd;
    margin-top: 4px;
    padding-top: 6px;
    font-size: 13px;
    font-weight: 700;
}

.csd-designer-v3 .csd-price-total span:last-child {
    color: #0073aa;
}

.csd-designer-v3 .csd-processing-time {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 6px;
    background: #fff;
    border-radius: 4px;
    font-size: 10px;
    color: #666;
}

.csd-designer-v3 .csd-processing-time .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

/* Mockup Section */
.csd-designer-v3 .csd-mockup-section {
    margin-top: 20px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.csd-designer-v3 .csd-mockup-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.csd-designer-v3 .csd-mockup-container {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.csd-designer-v3 .csd-mockup-preview {
    flex: 0 0 300px;
    background: #f5f5f5;
    border-radius: 6px;
    overflow: hidden;
}

.csd-designer-v3 .csd-mockup-preview canvas {
    display: block;
    width: 100%;
    height: auto;
}

.csd-designer-v3 .csd-mockup-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.csd-designer-v3 .csd-mockup-thumb {
    width: 60px;
    height: 60px;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
}

.csd-designer-v3 .csd-mockup-thumb:hover {
    border-color: #0073aa;
}

.csd-designer-v3 .csd-mockup-thumb.active {
    border-color: #0073aa;
}

.csd-designer-v3 .csd-mockup-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Approval Section */
.csd-designer-v3 .csd-approval-section {
    margin-top: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.csd-designer-v3 .csd-review-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 12px;
}

.csd-designer-v3 .csd-review-status .csd-status-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.csd-designer-v3 .csd-review-status .csd-status-icon {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.csd-designer-v3 .csd-review-status.pending {
    background: #fff8e5;
    color: #856404;
}

.csd-designer-v3 .csd-review-status.passed {
    background: #d4edda;
    color: #155724;
}

.csd-designer-v3 .csd-review-status.failed {
    background: #f8d7da;
    color: #721c24;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.csd-designer-v3 .csd-review-status.failed .csd-status-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.csd-designer-v3 .csd-review-status .csd-rejection-reasons {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(114, 28, 36, 0.2);
    width: 100%;
    font-size: 11px;
}

.csd-designer-v3 .csd-review-status .csd-rejection-reasons ul {
    margin: 4px 0 0 0;
    padding-left: 20px;
}

.csd-designer-v3 .csd-review-status .csd-rejection-reasons li {
    margin-bottom: 2px;
}

/* Title Section */
.csd-designer-v3 .csd-title-section {
    background: #f0f8ff;
    border: 1px solid #b8daff;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.csd-designer-v3 .csd-title-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.csd-designer-v3 .csd-title-input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.csd-designer-v3 .csd-title-prefix {
    background: #e9ecef;
    padding: 8px 12px;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    border-right: 1px solid #ddd;
}

.csd-designer-v3 .csd-title-input {
    flex: 1;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
}

.csd-designer-v3 .csd-title-input:focus {
    box-shadow: none;
}

.csd-designer-v3 .csd-title-hint {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #666;
}

.csd-designer-v3 .csd-btn-review {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 13px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 12px;
}

.csd-designer-v3 .csd-btn-review:hover {
    background: #005a87;
}

.csd-designer-v3 .csd-btn-review:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.csd-designer-v3 .csd-cutline-warning {
    color: #dc3232 !important;
    font-size: 12px;
    font-weight: 600;
    margin: 8px 0 0 0;
}

.csd-designer-v3 .csd-btn-review .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.csd-designer-v3 .csd-debug-section {
    margin-bottom: 12px;
    padding: 10px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
}

.csd-designer-v3 .csd-btn-test-output {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 12px;
    background: #ffc107;
    color: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.csd-designer-v3 .csd-btn-test-output:hover {
    background: #e0a800;
}

.csd-designer-v3 .csd-btn-test-output .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.csd-test-output-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csd-test-output-modal .csd-test-output-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.csd-test-output-modal h3 {
    margin: 0 0 15px;
    color: #333;
}

.csd-test-output-modal textarea {
    flex: 1;
    min-height: 400px;
    font-family: monospace;
    font-size: 11px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    margin-bottom: 15px;
}

.csd-test-output-modal button {
    align-self: flex-end;
}

.csd-designer-v3 .csd-add-to-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 30px;
    font-size: 14px;
    min-width: 180px;
    max-width: 250px;
}

.csd-designer-v3 .csd-add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.csd-designer-v3 #csd-add-to-cart-form {
    display: inline-block;
}

/* Mobile */
@media (max-width: 768px) {
    .csd-designer-v3 .csd-main-layout {
        flex-direction: column;
    }
    
    .csd-designer-v3 .csd-controls-panel {
        flex: none;
        max-width: 100%;
        max-height: none;
    }
    
    .csd-designer-v3 .csd-canvas-container {
        min-height: 300px;
    }
}

/* Custom Color Picker Popup */
.csd-color-picker-wrapper {
    position: relative;
    display: inline-block;
}

.csd-color-swatch-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}

.csd-color-swatch-btn:hover {
    border-color: #007cba;
}

/* Edit Design Popup */
.csd-edit-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csd-edit-popup {
    background: #fff;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
}

.csd-edit-popup h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.csd-edit-popup p {
    margin: 0 0 20px 0;
    color: #666;
}

.csd-edit-popup-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.csd-edit-popup-buttons .button {
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
}

.csd-edit-popup-buttons .csd-edit-existing {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

.csd-edit-popup-buttons .csd-edit-existing:hover {
    background: #005a87;
}

/* ==========================================================================
   V4 TOOLBAR INTERFACE STYLES
   ========================================================================== */

/* V4 Main Layout */
.csd-designer-v4 .csd-main-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
}

/* V4 Canvas Panel */
.csd-designer-v4 .csd-canvas-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* V4 Toolbar */
.csd-designer-v4 .csd-toolbar {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}

.csd-designer-v4 .csd-toolbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 70px;
}

.csd-designer-v4 .csd-toolbar-btn:hover {
    background: #f0f0f0;
    border-color: #0073aa;
}

.csd-designer-v4 .csd-toolbar-btn.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.csd-designer-v4 .csd-toolbar-btn svg {
    width: 24px;
    height: 24px;
    stroke: #555;
    fill: none;
}

.csd-designer-v4 .csd-toolbar-btn.active svg {
    stroke: #fff;
}

.csd-designer-v4 .csd-toolbar-btn svg circle[fill="currentColor"] {
    fill: #555;
}

.csd-designer-v4 .csd-toolbar-btn.active svg circle[fill="currentColor"] {
    fill: #fff;
}

.csd-designer-v4 .csd-toolbar-btn span {
    font-size: 11px;
    font-weight: 500;
    color: #555;
}

.csd-designer-v4 .csd-toolbar-btn.active span {
    color: #fff;
}

/* V4 Canvas Container */
.csd-designer-v4 .csd-canvas-container {
    position: relative;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* V4 Canvas Legend */
.csd-designer-v4 .csd-canvas-legend {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    padding: 0 4px;
    font-size: 11px;
    color: #666;
}

.csd-designer-v4 .csd-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: help;
    position: relative;
}

.csd-designer-v4 .csd-legend-item::after {
    content: '?';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    font-size: 9px;
    font-weight: bold;
    color: #999;
    background: #f0f0f0;
    border-radius: 50%;
    margin-left: 2px;
}

.csd-designer-v4 .csd-legend-item:hover::after {
    color: #666;
    background: #e0e0e0;
}

.csd-designer-v4 .csd-legend-line {
    width: 20px;
    height: 2px;
}

.csd-designer-v4 .csd-legend-solid {
    background: #0073aa !important;
    height: 2px !important;
}

.csd-designer-v4 .csd-legend-dashed {
    background: repeating-linear-gradient(90deg, #ff6b6b 0, #ff6b6b 4px, transparent 4px, transparent 8px) !important;
    height: 2px !important;
    border: none !important;
}

/* V4 Edit Panel (Right Side) */
.csd-designer-v4 .csd-edit-panel {
    flex: 0 0 320px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.csd-designer-v4 .csd-panel-content {
    padding: 16px;
}

.csd-designer-v4 .csd-panel-title {
    margin: 0 0 10px 0;
    padding: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
    border-bottom: 2px solid #0073aa;
}

.csd-designer-v4 .csd-panel-section {
    margin-bottom: 10px;
}

.csd-designer-v4 .csd-panel-section:last-child {
    margin-bottom: 0;
}

.csd-designer-v4 .csd-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
}

/* V4 Toolbar Hidden State */
.csd-designer-v4 .csd-toolbar.csd-toolbar-hidden {
    opacity: 0.5;
    pointer-events: none;
}

/* V4 Finalize Panel */
.csd-designer-v4 .csd-panel-finalize {
    background: #f8fdf8;
}

.csd-designer-v4 .csd-finalize-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #d4edda;
    border-radius: 6px;
    margin-bottom: 16px;
    color: #155724;
    font-weight: 500;
}

.csd-designer-v4 .csd-finalize-status .dashicons {
    color: #28a745;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.csd-designer-v4 .csd-panel-finalize .csd-title-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.csd-designer-v4 .csd-panel-finalize .csd-title-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.csd-designer-v4 .csd-field-hint {
    margin: 6px 0 0 0;
    font-size: 11px;
    color: #666;
}

.csd-designer-v4 .csd-btn-next {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.csd-designer-v4 .csd-btn-next:hover:not(:disabled) {
    background: #005d8c;
}

.csd-designer-v4 .csd-btn-next:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.csd-designer-v4 .csd-btn-next .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.csd-designer-v4 .csd-btn-secondary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: #f7f7f7;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.csd-designer-v4 .csd-btn-secondary:hover {
    background: #eee;
    border-color: #ccc;
}

.csd-designer-v4 .csd-edit-again-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

/* V4 Shape Dropdown */
.csd-designer-v4 .csd-shape-dropdown {
    position: relative;
    z-index: 100;
}

.csd-designer-v4 .csd-shape-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.csd-designer-v4 .csd-shape-selected:hover {
    border-color: #0073aa;
}

.csd-designer-v4 .csd-shape-selected svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.csd-designer-v4 .csd-shape-selected span:first-of-type {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.csd-designer-v4 .csd-shape-selected .dashicons {
    color: #888;
    transition: transform 0.2s;
}

.csd-designer-v4 .csd-shape-dropdown.open .csd-shape-selected .dashicons {
    transform: rotate(180deg);
}

.csd-designer-v4 .csd-shape-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 101;
}

.csd-designer-v4 .csd-shape-dropdown.open .csd-shape-options {
    display: block;
}

.csd-designer-v4 .csd-shape-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.csd-designer-v4 .csd-shape-option:hover {
    background: #f0f7fc;
}

.csd-designer-v4 .csd-shape-option.active {
    background: #e6f3ff;
}

.csd-designer-v4 .csd-shape-option svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.csd-designer-v4 .csd-shape-option span {
    font-size: 13px;
    color: #333;
}

/* V4 Size Row */
.csd-designer-v4 .csd-size-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.csd-designer-v4 .csd-size-input-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.csd-designer-v4 .csd-size-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.csd-designer-v4 .csd-size-input-group label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

.csd-designer-v4 .csd-size-input-group input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.csd-designer-v4 .csd-size-error {
    font-size: 10px;
    color: #dc3232;
    font-weight: 500;
    display: none;
    line-height: 1.2;
    margin-top: 2px;
    text-align: center;
}

.csd-designer-v4 .csd-size-error.visible {
    display: block;
}

.csd-designer-v4 .csd-lock-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.csd-designer-v4 .csd-lock-btn:hover {
    background: #e8e8e8;
}

.csd-designer-v4 .csd-lock-btn.locked {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.csd-designer-v4 .csd-lock-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.csd-designer-v4 .csd-size-info {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

/* V4 Slider Row */
.csd-designer-v4 .csd-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.csd-designer-v4 .csd-slider-row input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.csd-designer-v4 .csd-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
}

.csd-designer-v4 .csd-slider-row input[type="number"] {
    width: 55px;
    padding: 5px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

/* V4 Color Trigger */
.csd-designer-v4 .csd-color-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
    width: 100%;
}

.csd-designer-v4 .csd-color-trigger:hover {
    border-color: #0073aa;
}

.csd-designer-v4 .csd-color-preview {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #ccc;
    flex-shrink: 0;
}

.csd-designer-v4 .csd-color-hex {
    font-size: 13px;
    color: #333;
    font-family: monospace;
}

.csd-designer-v4 .csd-color-trigger-small {
    width: auto;
    padding: 6px 10px;
}

.csd-designer-v4 .csd-color-trigger-small .csd-color-preview {
    width: 22px;
    height: 22px;
}

.csd-designer-v4 .csd-color-trigger-small .csd-color-hex {
    font-size: 11px;
}

/* V4 Buttons */
.csd-designer-v4 .csd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.csd-designer-v4 .csd-btn .dashicons {
    line-height: 1;
    vertical-align: middle;
    margin-top: -2px;
}

.csd-designer-v4 .csd-btn:hover {
    background: #005a87;
}

.csd-designer-v4 .csd-btn-full {
    width: 100%;
}

.csd-designer-v4 .csd-btn-upload {
    background: #2271b1;
}

.csd-designer-v4 .csd-btn-upload:hover {
    background: #135e96;
}

.csd-designer-v4 .csd-btn-small {
    padding: 8px 12px;
    font-size: 12px;
}

.csd-designer-v4 .csd-btn-remove {
    background: #d63638;
}

.csd-designer-v4 .csd-btn-remove:hover {
    background: #b32d2e;
}

.csd-designer-v4 .csd-upload-hint {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    color: #888;
}

/* V4 Snap Buttons */
.csd-designer-v4 .csd-snap-btns {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.csd-designer-v4 .csd-snap-btn {
    flex: 1;
    padding: 6px 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.csd-designer-v4 .csd-snap-btn:hover {
    background: #e8e8e8;
}

.csd-designer-v4 .csd-snap-btn.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* V4 Two Column Row */
.csd-designer-v4 .csd-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* V4 Style Buttons */
.csd-designer-v4 .csd-style-btns-inline {
    display: flex;
    gap: 6px;
}

.csd-designer-v4 .csd-style-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.csd-designer-v4 .csd-style-btn:hover {
    background: #e8e8e8;
}

.csd-designer-v4 .csd-style-btn.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* V4 Text Controls - Compact inline layout */
.csd-designer-v4 .csd-text-controls .csd-panel-section {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    gap: 6px;
}

.csd-designer-v4 .csd-text-controls .csd-panel-section > .csd-label {
    display: inline-block;
    flex: 0 0 70px;
    margin-bottom: 0;
    font-size: 11px;
}

.csd-designer-v4 .csd-text-controls .csd-slider-row {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
}

.csd-designer-v4 .csd-text-controls .csd-slider-row input[type="range"] {
    width: 80px;
    flex: 0 0 80px;
}

.csd-designer-v4 .csd-text-controls .csd-slider-row input[type="number"] {
    width: 42px;
    padding: 2px 3px;
    font-size: 12px;
}

.csd-designer-v4 .csd-text-controls .csd-unit {
    font-size: 11px;
    color: #666;
    margin-left: -2px;
}

.csd-designer-v4 .csd-text-controls #csd-text-font {
    flex: 1;
    padding: 4px 6px;
    font-size: 12px;
}

.csd-designer-v4 .csd-text-controls .csd-style-btn {
    border: 1px solid #999;
}

.csd-designer-v4 .csd-text-controls .csd-color-trigger {
    flex: 1;
    padding: 4px 8px;
}

.csd-designer-v4 .csd-text-controls .csd-color-preview {
    width: 20px;
    height: 20px;
}

.csd-designer-v4 .csd-text-controls .csd-snap-btns {
    margin-top: 4px;
    margin-left: 78px;
}

.csd-designer-v4 .csd-text-controls .csd-snap-btn {
    padding: 2px 6px;
    font-size: 10px;
}

/* V4 Text List */
.csd-designer-v4 .csd-text-list {
    margin: 8px 0;
}

.csd-designer-v4 .csd-text-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    min-height: 0;
    height: 28px;
    box-sizing: border-box;
    overflow: hidden;
}

.csd-designer-v4 .csd-text-item:hover {
    background: #f0f7fc;
    border-color: #0073aa;
}

.csd-designer-v4 .csd-text-item.selected {
    background: #e6f3ff;
    border-color: #0073aa;
}

.csd-designer-v4 .csd-text-item-preview {
    flex: 1;
    font-size: 13px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    line-height: 20px;
}

.csd-designer-v4 .csd-text-item-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.csd-designer-v4 .csd-text-layer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 2px;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
    vertical-align: middle;
}

.csd-designer-v4 .csd-text-layer-btn:hover:not(:disabled) {
    background: #e0e0e0;
    color: #333;
}

.csd-designer-v4 .csd-text-layer-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.csd-designer-v4 .csd-text-layer-btn .dashicons,
.csd-designer-v4 .csd-text-item-delete .dashicons {
    font-size: 12px !important;
    width: 12px !important;
    height: 12px !important;
    line-height: 1 !important;
    vertical-align: middle;
}

.csd-designer-v4 .csd-text-item-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 0;
    margin-left: 2px;
    background: transparent;
    border: none;
    border-radius: 2px;
    color: #cc1818;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
    vertical-align: middle;
}

.csd-designer-v4 .csd-text-item-delete:hover {
    background: #fee;
    color: #a00;
}

/* V4 Text Controls - editing section with divider */
.csd-designer-v4 .csd-text-controls {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

/* V4 No Content Messages */
.csd-designer-v4 .csd-no-image-message,
.csd-designer-v4 .csd-no-text-message,
.csd-designer-v4 .csd-no-mockups-message {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 13px;
    background: #f9f9f9;
    border-radius: 6px;
    margin-top: 12px;
}

/* V4 Mockup Grid */
.csd-designer-v4 .csd-mockup-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.csd-designer-v4 .csd-mockup-thumb {
    position: relative;
    aspect-ratio: 1;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.csd-designer-v4 .csd-mockup-thumb:hover {
    border-color: #0073aa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.csd-designer-v4 .csd-mockup-thumb canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.csd-designer-v4 .csd-mockup-thumb-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* V4 Mockup Modal (Lightbox) */
.csd-designer-v4 .csd-mockup-modal,
.csd-mockup-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100001;
    display: none;
}

.csd-mockup-modal.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.csd-mockup-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
}

.csd-mockup-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csd-mockup-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.csd-mockup-modal-close:hover {
    background: rgba(255,255,255,0.3);
}

.csd-mockup-modal-close .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.csd-mockup-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.csd-mockup-modal-nav:hover {
    background: rgba(255,255,255,0.3);
}

.csd-mockup-modal-nav .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.csd-mockup-nav-prev {
    left: -70px;
}

.csd-mockup-nav-next {
    right: -70px;
}

.csd-mockup-modal-image-container {
    max-width: 80vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csd-mockup-modal-image-container canvas {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.csd-mockup-modal-info {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    color: #fff;
    font-size: 14px;
}

#csd-mockup-modal-name {
    font-weight: 500;
}

#csd-mockup-modal-counter {
    opacity: 0.7;
}

/* V4 Approval Section */
.csd-designer-v4 .csd-approval-section {
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.csd-designer-v4 .csd-review-status {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f0f0f0;
    border-radius: 6px;
}

.csd-designer-v4 .csd-status-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.csd-designer-v4 .csd-status-icon {
    font-size: 20px;
}

.csd-designer-v4 .csd-status-text {
    font-size: 14px;
    font-weight: 500;
}

.csd-designer-v4 .csd-title-section {
    margin-bottom: 16px;
}

.csd-designer-v4 .csd-title-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.csd-designer-v4 .csd-title-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.csd-designer-v4 .csd-title-hint {
    margin: 6px 0 0;
    font-size: 11px;
    color: #888;
}

.csd-designer-v4 .csd-btn-review,
.csd-designer-v4 .csd-add-to-cart {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
}

.csd-designer-v4 .csd-btn-review {
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.csd-designer-v4 .csd-btn-review:hover {
    background: #135e96;
}

.csd-designer-v4 .csd-btn-review:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.csd-designer-v4 #csd-add-to-cart-form,
.csd-designer-v5 #csd-add-to-cart-form {
    text-align: center;
}

.csd-designer-v4 .csd-cutline-warning,
.csd-designer-v5 .csd-cutline-warning {
    color: #dc3232 !important;
    font-size: 13px;
    font-weight: 600;
    margin: 10px 0 0 0;
    text-align: center;
}

.csd-designer-v4 .csd-btn-save-later,
.csd-designer-v4 .csd-btn-login-save,
.csd-designer-v5 .csd-btn-save-later,
.csd-designer-v5 .csd-btn-login-save {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    margin-top: 10px;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.csd-designer-v4 .csd-btn-save-later:hover,
.csd-designer-v4 .csd-btn-login-save:hover,
.csd-designer-v5 .csd-btn-save-later:hover,
.csd-designer-v5 .csd-btn-login-save:hover {
    background: #e0e0e0;
    border-color: #999;
}

.csd-designer-v4 .csd-add-to-cart {
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.csd-designer-v4 .csd-add-to-cart:hover:not(:disabled) {
    background: #43a047;
}

.csd-designer-v4 .csd-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* V4 Terms Modal - inherit from V3 */
.csd-designer-v4 .csd-terms-modal,
.csd-designer-v5 .csd-terms-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 20px;
}

.csd-designer-v4 .csd-terms-modal.visible,
.csd-designer-v5 .csd-terms-modal.visible {
    display: flex;
}

.csd-designer-v4 .csd-terms-content,
.csd-designer-v5 .csd-terms-content {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.csd-designer-v4 .csd-terms-content h2,
.csd-designer-v5 .csd-terms-content h2 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: #333;
    text-align: center;
}

.csd-designer-v4 .csd-terms-section,
.csd-designer-v5 .csd-terms-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.csd-designer-v4 .csd-terms-section:last-of-type,
.csd-designer-v5 .csd-terms-section:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.csd-designer-v4 .csd-terms-section h3,
.csd-designer-v5 .csd-terms-section h3 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #333;
}

.csd-designer-v4 .csd-terms-section p,
.csd-designer-v5 .csd-terms-section p {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #555;
}

.csd-designer-v4 .csd-terms-section ul,
.csd-designer-v5 .csd-terms-section ul {
    margin: 0 0 15px 0;
    padding-left: 20px;
}

.csd-designer-v4 .csd-terms-section li,
.csd-designer-v5 .csd-terms-section li {
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
}

.csd-designer-v4 .csd-terms-checkbox,
.csd-designer-v5 .csd-terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
}

.csd-designer-v4 .csd-terms-checkbox input,
.csd-designer-v5 .csd-terms-checkbox input {
    margin-top: 2px;
    flex-shrink: 0;
}

.csd-designer-v4 .csd-terms-buttons,
.csd-designer-v5 .csd-terms-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.csd-designer-v4 .csd-terms-back,
.csd-designer-v5 .csd-terms-back {
    flex: 1;
    padding: 14px 24px;
    font-size: 15px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.csd-designer-v4 .csd-terms-back:hover,
.csd-designer-v5 .csd-terms-back:hover {
    background: #005a87;
}

.csd-designer-v4 .csd-terms-continue,
.csd-designer-v5 .csd-terms-continue {
    flex: 1;
    padding: 14px 24px;
    font-size: 15px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.csd-designer-v4 .csd-terms-continue:hover:not(:disabled),
.csd-designer-v5 .csd-terms-continue:hover:not(:disabled) {
    background: #005a87;
}

.csd-designer-v4 .csd-terms-continue:disabled,
.csd-designer-v5 .csd-terms-continue:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* V4 Moderation Overlay - inherit styles */
.csd-designer-v4 .csd-moderation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.csd-designer-v4 .csd-moderation-content {
    text-align: center;
    padding: 30px;
    max-width: 450px;
}

.csd-designer-v4 .csd-moderation-message {
    margin-bottom: 20px;
}

.csd-designer-v4 .csd-moderation-message .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #dba617;
    margin-bottom: 15px;
}

.csd-designer-v4 .csd-moderation-message h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.csd-designer-v4 .csd-moderation-message p {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #555;
}

.csd-designer-v4 .csd-moderation-reasons {
    text-align: left;
    margin: 15px 0;
    padding: 12px 15px;
    background: #fff8e5;
    border: 1px solid #ffcc00;
    border-radius: 4px;
}

.csd-designer-v4 .csd-moderation-reasons li {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.csd-designer-v4 .csd-moderation-help {
    font-size: 13px;
    color: #888;
}

.csd-designer-v4 .csd-moderation-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.csd-designer-v4 .csd-moderation-buttons .button {
    padding: 10px 20px;
    font-size: 14px;
}

/* V4 Review Form */
.csd-designer-v4 .csd-review-form {
    text-align: left;
}

.csd-designer-v4 .csd-form-field {
    margin-bottom: 15px;
}

.csd-designer-v4 .csd-form-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

.csd-designer-v4 .csd-form-field input,
.csd-designer-v4 .csd-form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.csd-designer-v4 .csd-form-field textarea {
    resize: vertical;
    min-height: 60px;
}

/* V4 Loading Modal */
.csd-designer-v4 ~ .csd-loading-modal,
.csd-loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100002;
}

.csd-loading-modal.active {
    display: flex;
}

/* V4 Debug Section */
.csd-designer-v4 .csd-debug-section {
    margin-bottom: 16px;
}

.csd-designer-v4 .csd-btn-test-output {
    background: #666;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.csd-designer-v4 .csd-btn-test-output:hover {
    background: #555;
}

/* V4 Responsive adjustments */
@media (max-width: 900px) {
    .csd-designer-v4 .csd-main-layout {
        flex-direction: column;
    }
    
    .csd-designer-v4 .csd-edit-panel {
        flex: none;
        width: 100%;
        max-height: none;
    }
    
    .csd-designer-v4 .csd-toolbar {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .csd-mockup-nav-prev {
        left: 10px;
    }
    
    .csd-mockup-nav-next {
        right: 10px;
    }
}

/* ==========================================================================
   V4 Options Step Styles
   ========================================================================== */

.csd-options-step {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.csd-options-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.csd-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.csd-btn-back:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.csd-btn-back .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.csd-back-note {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

/* Design Preview */
.csd-options-preview {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: center;
}

.csd-options-preview h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.csd-options-preview-image {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    display: inline-block;
    margin-bottom: 12px;
}

.csd-options-preview-image canvas {
    max-width: 200px;
    max-height: 200px;
    display: block;
}

.csd-options-preview-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.csd-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.csd-preview-size {
    font-size: 13px;
    color: #666;
}

/* Options Section */
.csd-options-section {
    margin-bottom: 24px;
}

.csd-options-section h3 {
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
    border-bottom: 2px solid #0073aa;
}

/* Product Options List */
.csd-product-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.csd-option-group {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 14px;
}

.csd-option-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.csd-option-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.csd-option-choice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.csd-option-choice:hover {
    border-color: #0073aa;
    background: #f8fbfd;
}

.csd-option-choice input[type="checkbox"],
.csd-option-choice input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.csd-option-choice .csd-option-label {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.csd-option-price {
    font-size: 13px;
    color: #0073aa;
    font-weight: 500;
}

.csd-option-desc {
    width: 100%;
    font-size: 12px;
    color: #666;
    margin-left: 28px;
    margin-top: 4px;
}

.csd-no-options-message {
    color: #666;
    font-style: italic;
    padding: 10px 0;
}

/* Quantity Selector */
.csd-quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 12px;
}

.csd-qty-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: 1px solid #ddd;
    font-size: 20px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.csd-qty-minus {
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.csd-qty-plus {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

.csd-qty-btn:hover {
    background: #e8e8e8;
}

.csd-qty-btn:active {
    background: #ddd;
}

.csd-qty-input {
    width: 80px;
    height: 44px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    -moz-appearance: textfield;
}

.csd-qty-input::-webkit-outer-spin-button,
.csd-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.csd-qty-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.csd-qty-preset {
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.csd-qty-preset:hover {
    background: #f5f5f5;
    border-color: #0073aa;
}

.csd-qty-preset.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* Pricing Summary */
.csd-pricing-section {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
}

.csd-pricing-section h3 {
    margin-top: 0;
    border-bottom-color: #ddd;
}

.csd-pricing-summary {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.csd-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
}

.csd-pricing-label {
    font-size: 14px;
    color: #333;
    flex: 1;
    padding-right: 16px;
}

.csd-pricing-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: right;
    white-space: nowrap;
}

.csd-pricing-design {
    padding-bottom: 10px;
}

.csd-options-fees {
    display: flex;
    flex-direction: column;
}

.csd-pricing-option {
    padding: 10px 0;
}

.csd-pricing-option .csd-pricing-label {
    font-size: 14px;
    color: #333;
}

.csd-pricing-option .csd-pricing-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.csd-pricing-total {
    padding-top: 16px;
    margin-top: 8px;
    border-top: 2px solid #333;
}

.csd-pricing-total .csd-pricing-label {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.csd-pricing-total .csd-pricing-value {
    font-size: 20px;
    font-weight: 700;
    color: #0073aa;
}

/* Add to Cart Button */
.csd-options-actions {
    margin-top: 24px;
}

.csd-btn-add-to-cart {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.csd-btn-add-to-cart:hover {
    background: #005a87;
}

.csd-btn-add-to-cart .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Next Button Styling */
.csd-designer-v4 .csd-btn-next {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.csd-designer-v4 .csd-btn-next:hover:not(:disabled) {
    background: #005a87;
}

.csd-designer-v4 .csd-btn-next:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.csd-designer-v4 .csd-btn-next .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Responsive */
@media (max-width: 600px) {
    .csd-options-step {
        padding: 16px;
    }
    
    .csd-options-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .csd-qty-presets {
        justify-content: center;
    }
}

/* ===========================================
   V4: Pricing Panel Styles
   =========================================== */

/* Quantity Selector in Panel */
.csd-quantity-selector-panel {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 12px;
}

.csd-quantity-selector-panel .csd-qty-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
}

.csd-quantity-selector-panel .csd-qty-input {
    width: 60px;
    height: 36px;
    font-size: 14px;
}

/* Quantity Presets Grid */
.csd-qty-presets-panel {
    margin-top: 8px;
    overflow-x: auto;
}

.csd-moq-notice {
    margin-top: 2px;
    font-size: 12px;
    color: #dc3232;
}

.csd-pricing-grid {
    display: table;
    width: 100%;
    min-width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    border-collapse: collapse;
}

.csd-pricing-grid-row {
    display: table-row;
}

.csd-pricing-grid-label {
    display: table-cell;
    width: 55px;
    min-width: 55px;
    padding: 6px 8px;
    background: #f5f5f5;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-align: left;
    vertical-align: middle;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.csd-pricing-grid-row:last-child .csd-pricing-grid-label,
.csd-pricing-grid-row:last-child .csd-pricing-grid-cell {
    border-bottom: none;
}

.csd-pricing-grid-cell {
    display: table-cell;
    padding: 6px 4px;
    text-align: center;
    font-size: 11px;
    color: #333;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
    white-space: nowrap;
}

.csd-pricing-grid-cell:last-child {
    border-right: none;
}

.csd-pricing-grid-qty .csd-pricing-grid-cell {
    font-weight: 600;
    background: #fafafa;
}

.csd-pricing-grid-price .csd-pricing-grid-cell {
    font-weight: 500;
    color: #0073aa;
}

.csd-pricing-grid-savings .csd-pricing-grid-cell {
    font-size: 10px;
    color: #888;
}

.csd-pricing-grid-savings .csd-pricing-grid-cell.has-savings {
    color: #2e7d32;
    font-weight: 600;
}

/* Panel Product Options */
.csd-panel-product-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.csd-panel-option-group {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
}

.csd-panel-option-group-title {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.csd-panel-option-choices {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.csd-panel-option-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.csd-panel-option-choice:hover {
    border-color: #0073aa;
    background: #f8fbfd;
}

.csd-panel-option-choice input[type="checkbox"],
.csd-panel-option-choice input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.csd-panel-option-label {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.csd-panel-option-price {
    font-size: 12px;
    color: #0073aa;
    font-weight: 500;
}

/* Option tooltip */
.csd-option-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    cursor: help;
}

.csd-option-tooltip .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #888;
    transition: color 0.2s;
}

.csd-option-tooltip:hover .dashicons {
    color: #0073aa;
}

.csd-option-tooltip-text {
    position: fixed;
    background: #333;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: normal;
    width: 220px;
    max-width: 90vw;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    pointer-events: none;
}

.csd-option-tooltip-text::after {
    content: '';
    position: absolute;
    border: 6px solid transparent;
}

/* Arrow pointing down (tooltip above) */
.csd-option-tooltip-text.tooltip-above::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: #333;
}

/* Arrow pointing up (tooltip below) */
.csd-option-tooltip-text.tooltip-below::after {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: #333;
}

.csd-option-tooltip:hover .csd-option-tooltip-text {
    opacity: 1;
    visibility: visible;
}

.csd-no-options-msg {
    color: #888;
    font-size: 12px;
    font-style: italic;
    padding: 8px 0;
}

/* v1.18.35: Locked contour option styling */
.csd-panel-option-locked {
    background: #e8f4f8;
    border-color: #0073aa;
    cursor: default;
}

.csd-panel-option-locked:hover {
    background: #e8f4f8;
    border-color: #0073aa;
}

.csd-option-checkmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #0073aa;
    color: #fff;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Contour price display in shape dropdown */
.csd-contour-price {
    font-size: 11px;
    color: #0073aa;
    margin-left: 6px;
    font-weight: 500;
}

/* Panel Pricing Summary */
.csd-panel-pricing-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.csd-panel-pricing-summary {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
}

.csd-panel-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 4px 0;
    font-size: 13px;
}

.csd-panel-pricing-label {
    color: #555;
    flex: 1;
    padding-right: 10px;
}

.csd-panel-pricing-value {
    font-weight: 600;
    color: #333;
    text-align: right;
    white-space: nowrap;
}

.csd-panel-pricing-design {
    padding-bottom: 4px;
}

.csd-panel-options-fees {
    display: flex;
    flex-direction: column;
}

.csd-panel-pricing-option {
    padding: 6px 0;
}

.csd-panel-pricing-option .csd-panel-pricing-label {
    font-size: 12px;
    color: #666;
}

.csd-panel-pricing-option .csd-panel-pricing-value {
    font-size: 12px;
}

.csd-panel-pricing-total {
    padding-top: 8px;
    margin-top: 4px;
    border-top: 2px solid #333;
}

.csd-panel-pricing-total .csd-panel-pricing-label {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.csd-panel-pricing-total .csd-panel-pricing-value {
    font-size: 16px;
    font-weight: 700;
    color: #0073aa;
}

/* Add to Cart Button */
.csd-designer-v4 .csd-btn-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.csd-designer-v4 .csd-btn-add-to-cart:hover {
    background: #005a87;
}

.csd-designer-v4 .csd-btn-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.csd-designer-v4 .csd-btn-add-to-cart .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Responsive adjustments for pricing panel */
@media (max-width: 768px) {
    .csd-pricing-grid-label {
        width: 45px;
        min-width: 45px;
        padding: 6px 6px;
        font-size: 10px;
    }
    
    .csd-pricing-grid-cell {
        padding: 6px 3px;
        font-size: 10px;
    }
    
    .csd-pricing-grid-savings .csd-pricing-grid-cell {
        font-size: 9px;
    }
}

/* ===========================================
   Login Required Modal
   =========================================== */

.csd-login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csd-login-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.csd-login-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 0;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: csd-modal-appear 0.3s ease;
    overflow: hidden;
}

@keyframes csd-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.csd-login-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #999;
    transition: color 0.2s;
    z-index: 10;
}

.csd-login-modal-close:hover {
    color: #333;
}

.csd-login-modal-close .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* Tabs - DEPRECATED, replaced by views */
.csd-login-tabs {
    display: none;
}

.csd-login-tab {
    display: none;
}

/* Login Modal Views */
.csd-login-view {
    display: none;
    padding: 32px;
}

.csd-login-view.active {
    display: block;
}

/* Back button */
.csd-login-back-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: #666;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.csd-login-back-btn:hover {
    color: #0073aa;
}

.csd-login-back-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Button group for initial view */
.csd-login-button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.csd-btn-register-alt {
    background: #fff;
    color: #0073aa;
    border: 2px solid #0073aa;
}

.csd-btn-register-alt:hover {
    background: #f0f6fc;
    color: #005a87;
    border-color: #005a87;
}

.csd-login-modal-icon {
    width: 56px;
    height: 56px;
    background: #f0f6fc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.csd-login-modal-icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #0073aa;
}

.csd-login-view h3 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
}

.csd-login-view p {
    margin: 0 0 12px;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.csd-login-note {
    background: #f0f6fc;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px !important;
    color: #0073aa !important;
    margin-bottom: 20px !important;
}

.csd-login-modal-buttons {
    margin: 20px 0 12px;
}

.csd-login-modal-buttons .csd-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.csd-btn-full {
    width: 100%;
}

.csd-btn-login {
    background: #0073aa;
    color: #fff;
}

.csd-btn-login:hover {
    background: #005a87;
    color: #fff;
}

.csd-btn-register {
    background: #0073aa;
    color: #fff;
}

.csd-btn-register:hover {
    background: #005a87;
    color: #fff;
}

.csd-login-modal-buttons .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.csd-login-guest-note {
    font-size: 12px !important;
    color: #888 !important;
    margin-bottom: 0 !important;
    margin-top: 16px !important;
}

/* Registration Form */
.csd-register-form {
    text-align: left;
    margin: 16px 0;
}

.csd-register-form .csd-form-field {
    margin-bottom: 16px;
}

.csd-register-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.csd-register-form input[type="email"],
.csd-register-form input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.csd-register-form input[type="email"]:focus,
.csd-register-form input[type="password"]:focus {
    outline: none;
    border-color: #0073aa;
}

.csd-register-form .csd-field-hint {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.csd-form-error {
    background: #fef0f0;
    border: 1px solid #f5c6c6;
    color: #c00;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* Honeypot field - hidden from real users */
.csd-hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* Loading state for register button */
.csd-btn-register.loading {
    opacity: 0.7;
    pointer-events: none;
}

.csd-btn-register.loading .dashicons {
    animation: csd-spin 1s linear infinite;
}

@keyframes csd-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Login Form */
.csd-login-form {
    text-align: left;
    margin: 16px 0;
}

.csd-login-form .csd-form-field {
    margin-bottom: 16px;
}

.csd-login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.csd-login-form input[type="text"],
.csd-login-form input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.csd-login-form input[type="text"]:focus,
.csd-login-form input[type="password"]:focus {
    outline: none;
    border-color: #0073aa;
}

/* Loading state for login button */
.csd-btn-login.loading {
    opacity: 0.7;
    pointer-events: none;
}

.csd-btn-login.loading .dashicons {
    animation: csd-spin 1s linear infinite;
}

/* Forgot password link */
.csd-login-forgot-link {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
}

.csd-login-forgot-link a {
    color: #666;
    text-decoration: none;
}

.csd-login-forgot-link a:hover {
    color: #0073aa;
    text-decoration: underline;
}

@media (max-width: 480px) {
    .csd-login-view {
        padding: 24px 20px;
    }
    
    .csd-login-modal-buttons .csd-btn {
        padding: 12px 16px;
    }
}

/* ===========================================
   Notifications
   =========================================== */

.csd-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #1d2327;
    color: #fff;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 100002;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.csd-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.csd-notification-success {
    background: #2e7d32;
}

.csd-notification-error {
    background: #c62828;
}

/* ===========================================
   Promotional Banners
   =========================================== */

.csd-promo-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    animation: csd-promo-pulse 2s ease-in-out infinite;
}

.csd-promo-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.csd-promo-text {
    flex: 1;
    line-height: 1.3;
}

@keyframes csd-promo-pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
    }
}

/* Alternative banner styles for variety */
.csd-promo-banner.csd-promo-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 2px 8px rgba(17, 153, 142, 0.3);
}

.csd-promo-banner.csd-promo-orange {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
}

.csd-promo-banner.csd-promo-blue {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

/* Minimum order notice styling */
.csd-min-order-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.csd-min-order-notice .dashicons {
    color: #ffc107;
}

@media (max-width: 768px) {
    .csd-promo-banner {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .csd-promo-icon {
        font-size: 16px;
    }
}

/* Delete Text Confirmation Modal */
.csd-delete-text-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.csd-delete-text-modal.visible {
    opacity: 1;
    visibility: visible;
}

.csd-delete-text-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.2s;
}

.csd-delete-text-modal.visible .csd-delete-text-modal-content {
    transform: scale(1);
}

.csd-delete-text-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fee;
    color: #cc1818;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.csd-delete-text-modal-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.csd-delete-text-modal-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
}

.csd-delete-text-modal-content p {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px;
}

.csd-delete-text-preview {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 15px;
    color: #333;
    font-style: italic;
    word-break: break-word;
    margin-bottom: 20px;
    max-height: 80px;
    overflow-y: auto;
}

.csd-delete-text-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.csd-delete-text-modal-buttons .csd-btn {
    flex: 1;
    max-width: 140px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.csd-delete-text-modal-buttons .csd-btn-secondary {
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: #333;
}

.csd-delete-text-modal-buttons .csd-btn-secondary:hover {
    background: #e5e5e5;
}

.csd-delete-text-modal-buttons .csd-btn-danger {
    background: #cc1818;
    border: 1px solid #cc1818;
    color: #fff;
}

.csd-delete-text-modal-buttons .csd-btn-danger:hover {
    background: #a00;
    border-color: #a00;
}

.csd-delete-text-modal-buttons .csd-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ===========================================
   MINIMUM SIZE WARNING MODAL (v1.18.47)
   =========================================== */

.csd-minsize-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.csd-minsize-modal.visible {
    opacity: 1;
    visibility: visible;
}

.csd-minsize-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.2s;
}

.csd-minsize-modal.visible .csd-minsize-modal-content {
    transform: scale(1);
}

.csd-minsize-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff3e0;
    color: #e65100;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.csd-minsize-modal-icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.csd-minsize-modal-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
}

.csd-minsize-modal-content > p {
    font-size: 14px;
    color: #666;
    margin: 0 0 16px;
}

.csd-minsize-details {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.csd-minsize-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.csd-minsize-row:first-child {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.csd-minsize-label {
    font-size: 13px;
    color: #666;
}

.csd-minsize-value {
    font-size: 14px;
    font-weight: 600;
    color: #cc1818;
}

.csd-minsize-value.csd-minsize-required {
    color: #28a745;
}

.csd-minsize-suggestion {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin: 0 0 8px;
    text-align: left;
}

.csd-minsize-options {
    text-align: left;
    margin: 0 0 20px;
    padding-left: 24px;
}

.csd-minsize-options li {
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
    line-height: 1.4;
}

.csd-minsize-options li:last-child {
    margin-bottom: 0;
}

.csd-minsize-modal-buttons {
    display: flex;
    justify-content: center;
}

.csd-minsize-modal-buttons .csd-btn {
    min-width: 120px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.csd-minsize-modal-buttons .csd-btn-primary {
    background: #0073aa;
    border: 1px solid #0073aa;
    color: #fff;
}

.csd-minsize-modal-buttons .csd-btn-primary:hover {
    background: #005a87;
    border-color: #005a87;
}

/* ===========================================
   UNIFIED LAYER SYSTEM STYLES
   =========================================== */

/* Image List Container (matches text list) */
.csd-designer-v4 .csd-image-list {
    margin: 8px 0;
}

/* Generic Layer Item (base for both image and text) */
.csd-designer-v4 .csd-layer-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    min-height: 0;
    height: 28px;
    box-sizing: border-box;
    overflow: hidden;
}

.csd-designer-v4 .csd-layer-item:hover {
    background: #f0f7fc;
    border-color: #0073aa;
}

.csd-designer-v4 .csd-layer-item.selected {
    background: #e6f3ff;
    border-color: #0073aa;
}

/* Layer Item Preview Area */
.csd-designer-v4 .csd-layer-item-preview {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    line-height: 20px;
}

.csd-designer-v4 .csd-layer-item-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Layer Item Actions */
.csd-designer-v4 .csd-layer-item-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

/* Layer Action Buttons */
.csd-designer-v4 .csd-layer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 2px;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
    vertical-align: middle;
}

.csd-designer-v4 .csd-layer-btn:hover:not(:disabled) {
    background: #e0e0e0;
    color: #333;
}

.csd-designer-v4 .csd-layer-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.csd-designer-v4 .csd-layer-btn .dashicons {
    font-size: 12px !important;
    width: 12px !important;
    height: 12px !important;
    line-height: 1 !important;
    vertical-align: middle;
}

/* Layer Delete Button (red) */
.csd-designer-v4 .csd-layer-delete {
    color: #cc1818;
    margin-left: 2px;
}

.csd-designer-v4 .csd-layer-delete:hover:not(:disabled) {
    background: #fee;
    color: #a00;
}

/* Image Item Specific */
.csd-designer-v4 .csd-image-item {
    /* Inherits from .csd-layer-item */
}

/* Image Thumbnail */
.csd-designer-v4 .csd-image-thumbnail {
    width: 20px;
    height: 20px;
    border-radius: 2px;
    background-size: cover;
    background-position: center;
    background-color: #e0e0e0;
    flex-shrink: 0;
}

/* Layer Placeholder (other type shown as muted/grayed) */
.csd-designer-v4 .csd-layer-placeholder {
    background: #fafafa;
    border-color: #e8e8e8;
    opacity: 0.7;
}

.csd-designer-v4 .csd-layer-placeholder:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
    opacity: 0.85;
}

.csd-designer-v4 .csd-layer-placeholder.selected {
    background: #f0f5fa;
    border-color: #8eb8db;
    opacity: 0.9;
}

.csd-designer-v4 .csd-layer-placeholder .csd-layer-item-preview {
    color: #888;
    font-style: italic;
}

.csd-designer-v4 .csd-layer-placeholder .csd-layer-item-label {
    color: #888;
}

/* Ensure image thumbnails display in placeholders (text panel) */
.csd-designer-v4 .csd-layer-placeholder .csd-image-thumbnail {
    width: 20px;
    height: 20px;
    border-radius: 2px;
    background-size: cover;
    background-position: center;
    background-color: #e0e0e0;
    flex-shrink: 0;
    opacity: 0.8;
}

/* Placeholder Icon */
.csd-designer-v4 .csd-placeholder-icon {
    color: #aaa;
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
    line-height: 1 !important;
}

.csd-designer-v4 .csd-placeholder-icon.dashicons-editor-textcolor {
    color: #9a9a9a;
}

.csd-designer-v4 .csd-placeholder-icon.dashicons-format-image {
    color: #9a9a9a;
}

/* ===========================================
   DELETE IMAGE MODAL
   =========================================== */

.csd-delete-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100010;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.csd-delete-image-modal.visible {
    display: flex;
}

.csd-delete-image-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: csd-modal-enter 0.2s ease;
}

.csd-delete-image-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff3cd;
    color: #e67700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.csd-delete-image-modal-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.csd-delete-image-modal-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
}

.csd-delete-image-modal-content p {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px;
}

.csd-delete-image-preview {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border-radius: 8px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
}

.csd-delete-image-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.csd-delete-image-modal-buttons .csd-btn {
    flex: 1;
    max-width: 140px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.csd-delete-image-modal-buttons .csd-btn-secondary {
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: #333;
}

.csd-delete-image-modal-buttons .csd-btn-secondary:hover {
    background: #e5e5e5;
}

.csd-delete-image-modal-buttons .csd-btn-danger {
    background: #cc1818;
    border: 1px solid #cc1818;
    color: #fff;
}

.csd-delete-image-modal-buttons .csd-btn-danger:hover {
    background: #a00;
    border-color: #a00;
}

.csd-delete-image-modal-buttons .csd-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Low DPI Warning Modal */
.csd-dpi-warning-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100010;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.csd-dpi-warning-modal.visible {
    display: flex;
}

.csd-dpi-warning-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: csd-modal-enter 0.2s ease;
}

.csd-dpi-warning-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff3cd;
    color: #e67700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.csd-dpi-warning-modal-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.csd-dpi-warning-modal-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px;
}

.csd-dpi-warning-modal-content p {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px;
    line-height: 1.5;
}

.csd-dpi-warning-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    text-align: left;
}

/* v1.16.114: DPI comparison examples */
.csd-dpi-examples {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 16px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.csd-dpi-example {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.csd-dpi-example-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.csd-dpi-example-image svg {
    width: 100%;
    height: 100%;
}

.csd-dpi-example-image.csd-dpi-pixelated {
    /* Add slight blur to simulate pixelation effect */
    filter: blur(0.5px);
    image-rendering: pixelated;
}

.csd-dpi-example-label {
    font-size: 13px;
    font-weight: 600;
}

.csd-dpi-example-good .csd-dpi-example-label {
    color: #4caf50;
}

.csd-dpi-example-bad .csd-dpi-example-label {
    color: #f44336;
}

.csd-dpi-example-dpi {
    font-size: 11px;
    color: #666;
}

.csd-dpi-warning-details p {
    margin: 4px 0;
    font-size: 13px;
}

/* v1.16.133: Simple DPI Warning Text - displayed below controls */
.csd-dpi-warning-text {
    display: block;
    width: 100%;
    color: #dc3545;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
    margin-bottom: 8px;
    position: relative;
}

/* Size warning - centered below dimension inputs */
#csd-dpi-warning-size {
    text-align: center;
    margin-top: -12px;
}

/* Image warning - left-aligned with DPI display */
#csd-dpi-warning-image {
    text-align: left;
}

.csd-dpi-warning-text .csd-tooltip-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    margin-left: 4px;
    vertical-align: middle;
    position: relative;
}

.csd-dpi-warning-text .csd-tooltip-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 0;
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: normal;
    width: 220px;
    white-space: normal;
    z-index: 1000;
    margin-top: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    line-height: 1.4;
}

.csd-dpi-warning-text .csd-tooltip-icon:hover::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 7px;
    border: 6px solid transparent;
    border-bottom-color: #333;
    margin-top: -6px;
    z-index: 1001;
}

/* v1.16.116: DPI Override Warning Styling (legacy) */
.csd-dpi-override-warning {
    flex-shrink: 0;
}

.csd-dpi-override-label {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 5px;
    background: #fff5f5;
    border: 1px solid #dc3545;
    border-radius: 3px;
    cursor: pointer;
    font-size: 9px;
    color: #dc3545;
    transition: background 0.15s;
    white-space: nowrap;
}

.csd-dpi-override-label:hover {
    background: #ffe6e6;
}

.csd-dpi-override-label input[type="checkbox"] {
    width: 10px;
    height: 10px;
    margin: 0;
    cursor: pointer;
    accent-color: #dc3545;
}

.csd-dpi-override-label span {
    font-weight: 500;
}

/* Red border on dimension inputs when override enabled */
.csd-dimension-display.dpi-override-active #csd-dim-width-input,
.csd-dimension-display.dpi-override-active #csd-dim-height-input {
    border-color: #dc3545;
    box-shadow: 0 0 0 1px #dc3545;
}

/* Red border on zoom slider wrapper when override enabled */
.csd-zoom-slider-wrapper.dpi-override-active {
    border: 1px solid #dc3545;
    border-radius: 4px;
    padding: 4px;
    margin: -4px;
}

/* DPI override warning for image zoom - position it properly */
.csd-dpi-override-image {
    margin-top: 6px;
}

/* DPI override warning for sticker size - inline with controls */
.csd-dpi-override-size {
    flex-shrink: 0;
}

.csd-dpi-warning-details strong {
    color: #333;
}

#csd-dpi-current {
    color: #dc3545;
    font-weight: 600;
}

#csd-dpi-required {
    color: #28a745;
    font-weight: 600;
}

.csd-dpi-warning-explanation {
    font-size: 13px !important;
    color: #856404 !important;
    background: #fff3cd;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 12px 0 16px !important;
}

.csd-dpi-override-section {
    margin: 16px 0;
    padding: 12px;
    background: #e8f4fd;
    border-radius: 8px;
    border: 1px solid #b8daff;
}

.csd-dpi-override-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    text-align: left;
}

.csd-dpi-override-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.csd-dpi-override-checkbox span {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

.csd-dpi-warning-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.csd-dpi-warning-modal-buttons .csd-btn {
    flex: 1;
    max-width: 160px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.csd-dpi-warning-modal-buttons .csd-btn-secondary {
    background: #f5f5f5;
    color: #333;
    border-color: #ddd;
}

.csd-dpi-warning-modal-buttons .csd-btn-secondary:hover {
    background: #e8e8e8;
}

.csd-dpi-warning-modal-buttons .csd-btn-primary {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.csd-dpi-warning-modal-buttons .csd-btn-primary:hover {
    background: #005a87;
    border-color: #005a87;
}

.csd-dpi-warning-modal-buttons .csd-btn-primary:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

/* v1.16.21: DPI Display in Size Section */
.csd-dpi-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
    border-top: 1px solid #eee;
    margin-top: 8px;
}

.csd-dpi-label {
    color: #666;
}

.csd-dpi-value {
    font-weight: 600;
}

.csd-dpi-excellent {
    color: #2e7d32; /* Green */
}

.csd-dpi-good {
    color: #f57c00; /* Orange */
}

.csd-dpi-warning {
    color: #c62828; /* Red */
}

/* DPI Warning Modal */
.csd-dpi-warning-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.csd-dpi-warning-modal.visible {
    opacity: 1;
    visibility: visible;
}

.csd-dpi-warning-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.2s;
}

.csd-dpi-warning-modal.visible .csd-dpi-warning-modal-content {
    transform: scale(1);
}

.csd-dpi-warning-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff3cd;
    color: #856404;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.csd-dpi-warning-modal-icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.csd-dpi-warning-modal-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px;
}

.csd-dpi-warning-modal-content p {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px;
    line-height: 1.5;
}

.csd-dpi-warning-details {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    text-align: left;
}

.csd-dpi-warning-details p {
    margin: 4px 0;
    font-size: 14px;
}

.csd-dpi-warning-details #csd-dpi-warning-current {
    color: #cc1818;
    font-weight: 600;
}

.csd-dpi-warning-details #csd-dpi-warning-min {
    color: #28a745;
    font-weight: 600;
}

.csd-dpi-warning-suggestion {
    font-weight: 500;
    color: #333 !important;
    margin-top: 16px !important;
}

.csd-dpi-warning-options {
    text-align: left;
    margin: 8px 0 16px 24px;
    padding: 0;
    font-size: 13px;
    color: #666;
}

.csd-dpi-warning-options li {
    margin-bottom: 4px;
}

.csd-dpi-warning-acknowledge {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    text-align: left;
}

.csd-dpi-warning-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

.csd-dpi-warning-checkbox input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.csd-dpi-warning-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.csd-dpi-warning-modal-buttons .csd-btn {
    flex: 1;
    max-width: 160px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s, border-color 0.15s;
}

.csd-dpi-warning-modal-buttons .csd-btn-primary {
    background: #0073aa;
    border: 1px solid #0073aa;
    color: #fff;
}

.csd-dpi-warning-modal-buttons .csd-btn-primary:hover {
    background: #005a87;
    border-color: #005a87;
}

.csd-dpi-warning-modal-buttons .csd-btn-secondary {
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: #333;
}

.csd-dpi-warning-modal-buttons .csd-btn-secondary:hover {
    background: #e5e5e5;
    border-color: #ccc;
}

.csd-dpi-warning-modal-buttons .csd-btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================
   Zoom Slider DPI Indicator
   ============================ */

.csd-zoom-slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.csd-zoom-slider-track {
    position: relative;
    flex: 1;
    height: 20px;
    display: flex;
    align-items: center;
}

.csd-zoom-slider-track input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: transparent;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    z-index: 2;
    margin: 0;
}

/* Custom track styling - green for safe zone */
.csd-zoom-slider-track input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: linear-gradient(to right, 
        #28a745 0%, 
        #28a745 var(--dpi-threshold-percent, 100%), 
        transparent var(--dpi-threshold-percent, 100%), 
        transparent 100%);
    border-radius: 3px;
}

.csd-zoom-slider-track input[type="range"]::-moz-range-track {
    height: 6px;
    background: linear-gradient(to right, 
        #28a745 0%, 
        #28a745 var(--dpi-threshold-percent, 100%), 
        transparent var(--dpi-threshold-percent, 100%), 
        transparent 100%);
    border-radius: 3px;
    border: none;
}

.csd-zoom-slider-track input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #28a745;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
}

.csd-zoom-slider-track input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
}

.csd-zoom-slider-track input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #28a745;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* DPI gradient overlay - shows safe zone (green) and danger zones (yellow/orange/red) */
.csd-zoom-dpi-gradient {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    transform: translateY(-50%);
    border-radius: 3px;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(to right,
        #ddd 0%,
        #ddd var(--dpi-threshold-percent, 100%),
        #ffc107 var(--dpi-threshold-percent, 100%),
        #ff6600 calc(var(--dpi-threshold-percent, 100%) + 15%),
        #dc3545 100%);
    opacity: 1;
}

/* Hide gradient when no threshold (all safe) */
.csd-zoom-dpi-gradient.hidden {
    display: none;
}

/* DPI Info Icon - always visible when threshold exists */
.csd-dpi-info-icon {
    display: none;
    color: #ff6600;
    cursor: pointer;
    margin-left: 4px;
    transition: color 0.15s;
}

.csd-dpi-info-icon.visible {
    display: inline-flex;
    align-items: center;
}

.csd-dpi-info-icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.csd-dpi-info-icon:hover {
    color: #e55c00;
}

/* DPI Display under slider */
.csd-dpi-display {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
}

.csd-dpi-label {
    color: #888;
}

.csd-dpi-value {
    font-weight: 600;
    color: #333;
    min-width: 32px;
}

.csd-dpi-unit {
    color: #888;
}

.csd-dpi-status {
    margin-left: 6px;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    display: none;
}

/* v1.16.133: Hide status badge - replaced by "Images may be blurry" text */
.csd-dpi-status.warning {
    display: none;
}

.csd-dpi-status.ok {
    display: none;
}

/* DPI Value color states */
.csd-dpi-value.ok {
    color: #28a745;
}

.csd-dpi-value.warning {
    color: #ff6600;
}

.csd-dpi-value.danger {
    color: #dc3545;
}

/* DPI Tooltip */
.csd-dpi-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
}

.csd-dpi-tooltip.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.csd-dpi-tooltip-content {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 12px 16px;
    min-width: 280px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.csd-dpi-tooltip-icon {
    color: #ff6600;
    font-size: 20px;
    flex-shrink: 0;
}

.csd-dpi-tooltip-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.csd-dpi-tooltip-text {
    flex: 1;
}

.csd-dpi-tooltip-text strong {
    display: block;
    color: #333;
    font-size: 13px;
    margin-bottom: 4px;
}

.csd-dpi-tooltip-text p {
    margin: 0 0 6px 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.csd-dpi-tooltip-values {
    font-size: 11px !important;
    color: #888 !important;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 6px !important;
}

.csd-dpi-override-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #333;
    transition: background 0.15s, border-color 0.15s;
    margin-top: 4px;
}

.csd-dpi-override-checkbox:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.csd-dpi-override-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #ff6600;
}

.csd-dpi-override-checkbox span {
    flex: 1;
    user-select: none;
}

.csd-dpi-override-checkbox input[type="checkbox"]:checked + span {
    color: #ff6600;
    font-weight: 500;
}

.csd-dpi-tooltip-arrow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}

/* Slider blocked state - visual feedback */
.csd-zoom-slider-track.blocked input[type="range"]::-webkit-slider-thumb {
    background: #999;
    cursor: not-allowed;
}

.csd-zoom-slider-track.blocked input[type="range"]::-moz-range-thumb {
    background: #999;
    cursor: not-allowed;
}

/* After override - thumb stays normal but track shows warning colors */
.csd-zoom-slider-track.overridden input[type="range"]::-webkit-slider-thumb {
    background: #ff6600;
}

.csd-zoom-slider-track.overridden input[type="range"]::-moz-range-thumb {
    background: #ff6600;
}

/* ==========================================================================
   Custom Cut Line Styles (v1.16.0)
   ========================================================================== */

/* Contour option in shape dropdown */
.csd-contour-option {
    border-top: 1px solid #e0e0e0;
    margin-top: 5px;
    padding-top: 10px;
}

.csd-contour-option svg path {
    fill: #0073aa;
}

.csd-contour-option:hover svg path,
.csd-contour-option.active svg path {
    fill: #005d8c;
}

/* Contour controls container */
.csd-contour-controls {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 15px;
    margin-top: 10px;
}

.csd-contour-margin-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.csd-contour-margin-row label {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    min-width: 90px;
}

.csd-contour-margin-row input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

.csd-contour-margin-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.csd-contour-margin-row input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

#csd-contour-margin-value {
    font-size: 13px;
    font-weight: 600;
    color: #0073aa;
    min-width: 45px;
    text-align: right;
}

/* Color picker row */
.csd-contour-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.csd-contour-color-row label {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    min-width: 90px;
}

.csd-contour-color-row input[type="color"] {
    width: 40px;
    height: 30px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.csd-contour-color-row .button {
    padding: 4px 12px;
    font-size: 12px;
}

/* Contour tip */
.csd-contour-tip {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #ddd;
}

.csd-contour-tip small {
    font-size: 11px;
    color: #666;
    line-height: 1.4;
}

.csd-contour-tip a {
    color: #0073aa;
    text-decoration: underline;
}

.csd-contour-tip a:hover {
    color: #005d8c;
}

/* Contour warnings */
.csd-contour-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
    font-size: 12px;
    color: #856404;
}

.csd-contour-warning::before {
    content: "⚠️ ";
}

/* Notification styles for contour */
.csd-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 350px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.csd-notification-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.csd-notification-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.csd-notification-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.csd-notification-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading state for contour generation */
.csd-contour-loading {
    text-align: center;
    padding: 20px;
}

.csd-contour-loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: csd-spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* Contour Toolbar Buttons v1.16.3 */
.csd-contour-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* v1.16.15: Prevent button text overflow */
.csd-contour-btn span {
    white-space: nowrap;
}

.csd-toolbar-separator {
    width: 1px;
    height: 32px;
    background: #ddd;
    margin: 0 8px;
}

.csd-contour-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.csd-contour-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.csd-contour-generate-btn {
    background: #0073aa;
    color: white;
}

.csd-contour-generate-btn:hover {
    background: #005a87;
}

.csd-contour-generate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.csd-contour-clear-btn {
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
}

.csd-contour-clear-btn:hover {
    background: #e0e0e0;
    color: #333;
}

/* v1.16.138: Toolbar margin control */
/* v1.16.139: Reduced padding, removed divider to fit in toolbar */
.csd-toolbar-margin-control {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.csd-toolbar-margin-control label {
    font-size: 12px;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

/* v1.19.69: Number input instead of slider for border width */
/* v1.19.71: Fixed spinner visibility */
.csd-toolbar-margin-control input[type="number"].csd-margin-input {
    width: 65px;
    height: 22px;
    padding: 0 2px 0 4px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-align: center;
    /* Remove styles that hide spinners */
}

.csd-toolbar-margin-control input[type="number"].csd-margin-input::-webkit-outer-spin-button,
.csd-toolbar-margin-control input[type="number"].csd-margin-input::-webkit-inner-spin-button {
    -webkit-appearance: inner-spin-button;
    opacity: 1;
    margin-left: 2px;
}

.csd-toolbar-margin-control input[type="number"].csd-margin-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.2);
}

.csd-toolbar-margin-control .csd-toolbar-unit {
    font-size: 11px;
    color: #666;
}

/* v1.19.39: Toolbar background color control */
.csd-toolbar-bg-color {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-left: 1px solid #e0e0e0;
    margin-left: 8px;
}

.csd-toolbar-bg-color label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}

.csd-toolbar-color-trigger {
    display: flex;
    align-items: center;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.csd-toolbar-color-trigger .csd-color-preview {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid #ccc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: border-color 0.2s, transform 0.1s;
}

.csd-toolbar-color-trigger:hover .csd-color-preview {
    border-color: #0073aa;
    transform: scale(1.05);
}

/* v1.19.50: Sticker Size in toolbar */
.csd-toolbar-size {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 4px 12px;
    border-left: 1px solid #e0e0e0;
    margin-left: auto;
    flex-shrink: 0;
}

.csd-toolbar-size-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.csd-toolbar-size-label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}

.csd-toolbar-size .csd-dim-group {
    display: flex;
    align-items: center;
    align-self: center;
    gap: 2px;
}

/* v1.19.75: Wrapper to position error under each input */
.csd-toolbar-size .csd-dim-group-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}

.csd-toolbar-size .csd-dim-group label {
    font-size: 11px;
    font-weight: 500;
    color: #666;
}

.csd-toolbar-size .csd-dim-input {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    height: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    padding: 0 2px 0 4px !important;
    margin: 0 !important;
    font-size: 12px !important;
    font-weight: 500;
    line-height: 20px !important;
    text-align: center;
    border: 1px solid #ccc !important;
    border-radius: 4px;
    background: #fff;
    color: #333;
    box-sizing: border-box !important;
    vertical-align: middle;
    /* v1.19.71: Removed appearance:none to show spinners */
}

/* v1.19.71: Show number input spinners */
.csd-toolbar-size .csd-dim-input::-webkit-outer-spin-button,
.csd-toolbar-size .csd-dim-input::-webkit-inner-spin-button {
    -webkit-appearance: inner-spin-button;
    opacity: 1;
    margin-left: 2px;
}

.csd-toolbar-size .csd-dim-input:hover {
    border-color: #999;
}

.csd-toolbar-size .csd-dim-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.2);
}

.csd-toolbar-size .csd-dim-unit {
    font-size: 11px;
    font-weight: 500;
    color: #666;
}

.csd-toolbar-size .csd-dim-lock-btn,
.csd-toolbar-size button.csd-dim-lock-btn,
.csd-toolbar-size button#csd-dim-lock-ratio {
    all: unset;
    background: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: #666;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    height: 22px;
    max-height: 22px;
    width: 22px;
    box-sizing: border-box;
    overflow: hidden;
}

.csd-toolbar-size .csd-dim-lock-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.csd-toolbar-size .csd-dim-lock-btn:active {
    background: #e0e0e0;
    border-color: #666;
}

.csd-toolbar-size .csd-dim-lock-btn.locked {
    background: #d0e8f9;
    border-color: #0073aa;
    color: #0073aa;
}

.csd-toolbar-size .csd-dim-lock-btn.locked:hover {
    background: #c0ddf5;
}

.csd-toolbar-size .csd-dim-lock-btn .csd-lock-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Fill only the lock body (rect) when locked, not the hasp (path) */
.csd-toolbar-size .csd-dim-lock-btn.locked .csd-lock-icon rect {
    fill: currentColor;
}

/* Default: show unlocked, hide locked */
.csd-toolbar-size .csd-dim-lock-btn .csd-lock-locked {
    display: none;
}

.csd-toolbar-size .csd-dim-lock-btn .csd-lock-unlocked {
    display: block;
}

/* When locked: show locked, hide unlocked */
.csd-toolbar-size .csd-dim-lock-btn.locked .csd-lock-unlocked {
    display: none !important;
}

.csd-toolbar-size .csd-dim-lock-btn.locked .csd-lock-locked {
    display: block !important;
}

/* v1.19.75: Error message positioned under each input */
/* v1.19.76: Aligned to start at input box edge, not under label */
.csd-toolbar-size .csd-dim-error {
    font-size: 9px;
    color: #dc3232;
    font-weight: 500;
    display: none;
    white-space: nowrap;
    position: absolute;
    top: 100%;
    left: 14px; /* Offset past the W/H label */
    margin-top: 1px;
}

.csd-toolbar-size .csd-dim-error.visible {
    display: block;
}

/* DPI warning in toolbar - appears below size inputs */
.csd-toolbar-size .csd-toolbar-dpi-warning {
    width: 100%;
    margin-top: 2px;
    font-size: 11px;
    text-align: right;
}

/* Eyedropper overlay for selecting background color */
.csd-eyedropper-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.csd-eyedropper-message {
    background: white;
    padding: 20px 30px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.csd-eyedropper-message h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #333;
}

.csd-eyedropper-message p {
    margin: 0 0 15px;
    color: #666;
    font-size: 14px;
}

.csd-eyedropper-message .button {
    margin-top: 10px;
}

.csd-eyedropper-image-container {
    position: relative;
    max-width: 90%;
    max-height: 60%;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.csd-eyedropper-image-container img {
    max-width: 100%;
    max-height: 100%;
    cursor: crosshair;
    display: block;
}

.csd-eyedropper-preview {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 8px 16px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.csd-eyedropper-preview .color-swatch {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 2px solid #ddd;
}

.csd-eyedropper-preview .color-value {
    font-family: monospace;
    font-size: 14px;
}

/* Layer ignore color indicator */
.csd-layer-ignore-color {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 12px;
}

.csd-layer-ignore-color .color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #ccc;
}

.csd-layer-ignore-color .remove-ignore {
    margin-left: auto;
    color: #999;
    cursor: pointer;
    font-size: 16px;
}

.csd-layer-ignore-color .remove-ignore:hover {
    color: #c00;
}

/* Contour status message */
.csd-contour-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #fff8e6;
    border: 1px solid #ffe0b2;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #856404;
}

.csd-contour-status.has-contour {
    background: #e8f5e9;
    border-color: #c8e6c9;
    color: #2e7d32;
}

.csd-contour-status svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}


/* ==========================================================================
   v1.16.54: Dimension Display - Compact with lock button
   ========================================================================== */

.csd-dimension-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 8px;
    margin-bottom: 8px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.csd-dim-label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-right: 2px;
}

.csd-dim-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.csd-dim-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.csd-dim-error {
    font-size: 9px;
    color: #dc3232;
    font-weight: 500;
    display: none;
    line-height: 1.2;
    margin-top: 2px;
    white-space: nowrap;
}

.csd-dim-error.visible {
    display: block;
}

.csd-dim-group label {
    font-size: 11px;
    font-weight: 500;
    color: #666;
}

.csd-dim-input {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    flex-shrink: 0;
    padding: 4px 0;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #333;
}

.csd-dim-input:hover {
    border-color: #999;
}

.csd-dim-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.2);
}

.csd-dim-unit {
    font-size: 11px;
    font-weight: 500;
    color: #666;
    line-height: 1;
    align-self: center;
}

.csd-dim-lock-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 4px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.csd-dim-lock-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.csd-dim-lock-btn.locked {
    background: #e3f2fd;
    border-color: #0073aa;
    color: #0073aa;
}

.csd-dim-lock-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* ============================================
   v1.17.5: UX Enhancements
   ============================================ */

/* Tab Completion Indicators */
.csd-designer-v4 .csd-tab-indicator {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #28a745;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 1;
}

.csd-designer-v4 .csd-toolbar-btn {
    position: relative;
}

/* Empty State Overlay */
.csd-empty-state-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    z-index: 5;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.csd-empty-state-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.csd-empty-state-content {
    text-align: center;
    padding: 30px;
    max-width: 300px;
}

.csd-empty-state-icon {
    width: 64px;
    height: 64px;
    stroke: #0073aa;
    margin-bottom: 16px;
}

.csd-empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.csd-empty-state-hint {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Persistent Price Display */
.csd-persistent-price {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.csd-persistent-price-label {
    font-size: 12px;
    color: #2e7d32;
    font-weight: 500;
}

.csd-persistent-price-value {
    font-size: 18px;
    font-weight: 700;
    color: #1b5e20;
}

.csd-persistent-price-each {
    font-size: 11px;
    color: #388e3c;
}

/* Next Step Navigation Buttons */
.csd-panel-nav {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.csd-btn-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
}

.csd-btn-next:hover {
    background: linear-gradient(135deg, #005a87 0%, #004569 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.4);
}

.csd-btn-next .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

.csd-btn-next.csd-btn-primary {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.csd-btn-next.csd-btn-primary:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
}

.csd-nav-hint {
    font-size: 11px;
    color: #888;
    font-style: italic;
}

/* Legend Tooltips */
.csd-legend-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: #666;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    margin-left: 4px;
    position: relative;
}

.csd-legend-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: normal;
    width: 200px;
    white-space: normal;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    line-height: 1.4;
    text-align: left;
}

.csd-legend-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    margin-bottom: -4px;
    z-index: 1001;
}

/* Toolbar margin control tooltip */
.csd-toolbar-margin-control .csd-legend-tooltip {
    background: #888;
    vertical-align: middle;
}

.csd-toolbar-margin-control .csd-legend-tooltip:hover::after {
    bottom: auto;
    top: 100%;
    margin-top: 8px;
    margin-bottom: 0;
}

.csd-toolbar-margin-control .csd-legend-tooltip:hover::before {
    bottom: auto;
    top: 100%;
    margin-top: -4px;
    margin-bottom: 0;
    border-top-color: transparent;
    border-bottom-color: #333;
}

/* Mobile responsiveness for new elements */
@media (max-width: 768px) {
    .csd-persistent-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .csd-persistent-price-value {
        font-size: 20px;
    }
    
    .csd-legend-tooltip:hover::after {
        width: 160px;
        left: auto;
        right: 0;
        transform: none;
    }
    
    .csd-legend-tooltip:hover::before {
        left: auto;
        right: 7px;
        transform: none;
    }
}

/* ==========================================================================
   V5 WIDE LAYOUT STYLES
   Introduced in v1.18.0 - Three-column layout with left editing panel,
   center canvas, and right size/pricing panel (always visible)
   ========================================================================== */

/* V5 Main Container - Break out of parent container using calc() margins */
.csd-designer-v5 {
    width: 90vw !important;
    max-width: 90vw !important;
    margin-left: calc(-45vw + 50%) !important;
    margin-right: calc(-45vw + 50%) !important;
    padding: 0 0 20px 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
}

/* V5 Main Layout - Three columns */
.csd-designer-v5 .csd-main-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    max-width: none !important;
}

/* V5 Left Panel - Editing tools */
.csd-designer-v5 .csd-left-panel {
    flex: 0 0 320px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    order: 1;
}

/* V5 Canvas Panel - Center */
.csd-designer-v5 .csd-canvas-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    order: 2;
}

/* V5 Right Panel - Size and Pricing (always visible) */
.csd-designer-v5 .csd-right-panel {
    flex: 0 0 320px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    order: 3;
}

/* V5 Panel Content Styling */
.csd-designer-v5 .csd-left-panel .csd-panel-content,
.csd-designer-v5 .csd-right-panel .csd-panel-content {
    padding: 16px;
}

.csd-designer-v5 .csd-left-panel .csd-panel-title,
.csd-designer-v5 .csd-right-panel .csd-panel-title {
    margin: 0 0 10px 0;
    padding: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
    border-bottom: 2px solid #0073aa;
}

/* V5 Labels */
.csd-designer-v5 .csd-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
}

/* V5 Text Controls - Compact inline layout */
.csd-designer-v5 .csd-text-controls .csd-panel-section {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    gap: 6px;
}

.csd-designer-v5 .csd-text-controls .csd-panel-section > .csd-label {
    display: inline-block;
    flex: 0 0 70px;
    margin-bottom: 0;
    font-size: 11px;
}

.csd-designer-v5 .csd-text-controls .csd-slider-row {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
}

.csd-designer-v5 .csd-text-controls .csd-slider-row input[type="range"] {
    width: 80px;
    flex: 0 0 80px;
}

.csd-designer-v5 .csd-text-controls .csd-slider-row input[type="number"] {
    width: 42px;
    padding: 2px 3px;
    font-size: 12px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.csd-designer-v5 .csd-text-controls .csd-unit {
    font-size: 11px;
    color: #666;
    margin-left: -2px;
}

/* V5 Text Font dropdown - compact */
.csd-designer-v5 .csd-text-controls #csd-text-font {
    flex: 1;
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* V5 Text Style buttons (Bold/Italic) */
.csd-designer-v5 .csd-text-controls .csd-style-btns-inline {
    display: flex;
    gap: 4px;
}

.csd-designer-v5 .csd-text-controls .csd-style-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #999;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.csd-designer-v5 .csd-text-controls .csd-style-btn:hover {
    background: #f0f0f0;
    border-color: #666;
}

.csd-designer-v5 .csd-text-controls .csd-style-btn.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* V5 Text Color trigger - compact */
.csd-designer-v5 .csd-text-controls .csd-color-trigger {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.csd-designer-v5 .csd-text-controls .csd-color-preview {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #ccc;
}

.csd-designer-v5 .csd-text-controls .csd-color-hex {
    font-size: 11px;
    color: #666;
}

/* V5 Text Rotation snap buttons - below slider */
.csd-designer-v5 .csd-text-controls .csd-snap-btns {
    display: flex;
    gap: 3px;
    margin-top: 4px;
    margin-left: 76px;
}

/* V5 Text Rotation section - wrap to allow snap buttons below */
.csd-designer-v5 .csd-text-controls .csd-panel-section:has(.csd-snap-btns) {
    flex-wrap: wrap;
}

.csd-designer-v5 .csd-text-controls .csd-panel-section .csd-snap-btns {
    flex-basis: 100%;
}

.csd-designer-v5 .csd-text-controls .csd-snap-btn {
    padding: 2px 6px;
    font-size: 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.csd-designer-v5 .csd-text-controls .csd-snap-btn:hover {
    background: #e8e8e8;
}

.csd-designer-v5 .csd-text-controls .csd-snap-btn.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* V5 Dimension Display in Right Panel */
.csd-designer-v5 .csd-right-panel .csd-dimension-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
    margin: 8px 12px 4px 12px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.csd-designer-v5 .csd-right-panel .csd-dim-input {
    height: 28px;
    padding: 0 4px;
    box-sizing: border-box;
}

/* v1.19.22: V5 Dimension unit alignment fix */
.csd-designer-v5 .csd-right-panel .csd-dim-unit {
    font-size: 11px;
    font-weight: 500;
    color: #666;
    line-height: 28px;
    vertical-align: middle;
}

/* v1.19.22: V5 Review and Save buttons - same size */
.csd-designer-v5 .csd-right-panel .csd-btn-review,
.csd-designer-v5 .csd-right-panel .csd-btn-save-later,
.csd-designer-v5 .csd-right-panel .csd-btn-login-save {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.csd-designer-v5 .csd-right-panel .csd-btn-review {
    background: #2271b1;
    color: #fff;
    border: none;
}

.csd-designer-v5 .csd-right-panel .csd-btn-review:hover {
    background: #135e96;
}

.csd-designer-v5 .csd-right-panel .csd-btn-save-later,
.csd-designer-v5 .csd-right-panel .csd-btn-login-save {
    margin-top: 10px;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.csd-designer-v5 .csd-right-panel .csd-btn-save-later:hover,
.csd-designer-v5 .csd-right-panel .csd-btn-login-save:hover {
    background: #e0e0e0;
    border-color: #999;
}

/* V5 DPI Warning in Right Panel */
.csd-designer-v5 .csd-right-panel .csd-dpi-warning-text {
    margin: 8px 16px 0 16px;
}

/* V5 Pricing Panel - Compact styling */
.csd-designer-v5 #csd-panel-pricing .csd-panel-title {
    display: none;
}

.csd-designer-v5 #csd-panel-pricing .csd-panel-content,
.csd-designer-v5 .csd-right-panel #csd-panel-pricing {
    padding: 8px 12px;
}

.csd-designer-v5 #csd-panel-pricing .csd-panel-section {
    margin-bottom: 8px;
    padding: 0;
}

/* V5 Quantity Section - Inline label with controls */
.csd-designer-v5 #csd-panel-pricing .csd-panel-section:first-of-type {
    display: block;
    padding: 0 !important;
    margin-bottom: 4px !important;
}

.csd-designer-v5 #csd-panel-pricing .csd-quantity-selector-panel {
    display: inline-flex !important;
    align-items: center;
    gap: 0;
    margin: 0 !important;
}

.csd-designer-v5 #csd-panel-pricing .csd-quantity-selector-panel::before {
    content: 'Quantity';
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    margin-right: 8px;
    white-space: nowrap;
}

.csd-designer-v5 #csd-panel-pricing .csd-moq-notice {
    margin-top: 4px;
}

.csd-designer-v5 #csd-panel-pricing .csd-qty-presets-panel {
    margin-top: 4px;
}

/* V5 Hide Price label and remove separator */
.csd-designer-v5 #csd-panel-pricing .csd-panel-pricing-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.csd-designer-v5 #csd-panel-pricing .csd-panel-pricing-section > .csd-label {
    display: none;
}

.csd-designer-v5 #csd-panel-pricing .csd-panel-pricing-summary {
    padding: 8px;
}

/* V5 Toolbar - Compact horizontal style like a website toolbar */
.csd-designer-v5 .csd-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f0f0f0;
    border: 1px solid #d0d0d0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    flex-wrap: nowrap;
}

/* Reset all buttons in toolbar to prevent theme interference */
.csd-designer-v5 .csd-toolbar button {
    margin: 0 !important;
    padding: 0 10px !important;
    height: 28px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

/* Ensure all direct children of toolbar align properly */
.csd-designer-v5 .csd-toolbar > * {
    flex-shrink: 0;
}

.csd-designer-v5 .csd-toolbar-btn {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 10px;
    height: 28px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: auto;
    position: relative;
    white-space: nowrap;
    box-sizing: border-box;
    margin: 0;
    line-height: 1;
    vertical-align: middle;
    font-family: inherit;
    font-size: 12px;
}

.csd-designer-v5 .csd-toolbar-btn:hover {
    background: #e8f4fc;
    border-color: #0073aa;
}

.csd-designer-v5 .csd-toolbar-btn.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.csd-designer-v5 .csd-toolbar-btn svg {
    width: 16px;
    height: 16px;
    stroke: #555;
    fill: none;
    flex-shrink: 0;
}

.csd-designer-v5 .csd-toolbar-btn.active svg {
    stroke: #fff;
}

.csd-designer-v5 .csd-toolbar-btn span {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    line-height: 1;
    margin: 0;
    padding: 0;
}

.csd-designer-v5 .csd-toolbar-btn.active span {
    color: #fff;
}

/* V5 Tab indicator repositioned for horizontal buttons */
.csd-designer-v5 .csd-toolbar-btn .csd-tab-indicator {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 14px;
    height: 14px;
    font-size: 9px;
}

/* V5 Toolbar Separator - hidden in V5 compact toolbar */
.csd-designer-v5 .csd-toolbar-separator,
.csd-designer-v5 .csd-contour-actions .csd-toolbar-separator {
    display: none !important;
}

/* V5 Contour Actions - inline with toolbar */
.csd-designer-v5 .csd-contour-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    margin: 0;
    padding: 0;
}

/* V5 Contour Buttons - match toolbar button style exactly */
.csd-designer-v5 .csd-contour-btn {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 10px;
    height: 28px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-size: 12px;
    color: #333;
    box-sizing: border-box;
    margin: 0;
    line-height: 1;
    vertical-align: middle;
    font-family: inherit;
}

.csd-designer-v5 .csd-contour-btn:hover {
    background: #e8f4fc;
    border-color: #0073aa;
}

.csd-designer-v5 .csd-contour-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

.csd-designer-v5 .csd-contour-generate-btn {
    background: #e7f5e7;
    border-color: #5cb85c;
    color: #3c763d;
}

.csd-designer-v5 .csd-contour-generate-btn:hover {
    background: #d4edda;
    border-color: #28a745;
}

.csd-designer-v5 .csd-contour-clear-btn {
    background: #fdf2f2;
    border-color: #dc3545;
    color: #a71d2a;
}

.csd-designer-v5 .csd-contour-clear-btn:hover {
    background: #f8d7da;
    border-color: #bd2130;
}

/* V5 Border Width Control - inline toolbar style */
/* v1.19.69: Changed from slider to number input for compact layout */
.csd-designer-v5 .csd-toolbar-margin-control {
    display: flex !important;
    align-items: center !important;
    gap: 4px;
    padding: 0 8px;
    height: 28px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
    box-sizing: border-box;
    margin: 0;
    line-height: 1;
}

.csd-designer-v5 .csd-toolbar-margin-control label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    white-space: nowrap;
    margin: 0;
    padding: 0;
    line-height: 1;
    height: 100%;
}

.csd-designer-v5 .csd-toolbar-margin-control input[type="number"].csd-margin-input {
    width: 60px;
    height: 20px;
    margin: 0;
    padding: 0 2px;
    font-size: 12px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-sizing: border-box;
}

.csd-designer-v5 .csd-toolbar-margin-control .csd-toolbar-unit {
    font-size: 11px;
    color: #666;
    margin: 0;
    padding: 0;
}


.csd-designer-v5 .csd-toolbar-margin-control .csd-legend-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: #666;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    cursor: help;
}

/* V5 Canvas Container */
.csd-designer-v5 .csd-canvas-container {
    position: relative;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    min-height: 550px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* V5 Canvas Legend */
.csd-designer-v5 .csd-canvas-legend {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    padding: 0 4px;
    font-size: 11px;
    color: #666;
}

/* v1.18.47: V5 Legend Item and Line Styles */
.csd-designer-v5 .csd-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: help;
    position: relative;
}

.csd-designer-v5 .csd-legend-line {
    width: 20px;
    height: 2px;
}

.csd-designer-v5 .csd-legend-solid {
    background: #0073aa !important;
    height: 2px !important;
}

.csd-designer-v5 .csd-legend-dashed {
    background: repeating-linear-gradient(90deg, #ff6b6b 0, #ff6b6b 4px, transparent 4px, transparent 8px) !important;
    height: 2px !important;
    border: none !important;
}

/* V5 Tab Completion Indicators */
.csd-designer-v5 .csd-tab-indicator {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #28a745;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 1;
}

/* V5 Button Styles - Match V4 */
.csd-designer-v5 .csd-btn-full {
    width: 100%;
}

.csd-designer-v5 .csd-btn .dashicons {
    line-height: 1;
    vertical-align: middle;
    margin-top: -2px;
}

.csd-designer-v5 .csd-btn-upload,
.csd-designer-v5 #csd-add-text {
    background: #2271b1;
    color: #fff;
}

.csd-designer-v5 .csd-btn-upload:hover,
.csd-designer-v5 #csd-add-text:hover {
    background: #135e96;
}

/* V5 Next Step Buttons - Green */
.csd-designer-v5 .csd-btn-next {
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: #fff !important;
}

.csd-designer-v5 .csd-btn-next:hover {
    background: #218838 !important;
    border-color: #1e7e34 !important;
}

/* V5 Hide Next button on Preview panel - not needed since pricing is always visible */
.csd-designer-v5 #csd-next-preview {
    display: none !important;
}

/* V5 Color Picker Trigger - Match V4 */
.csd-designer-v5 .csd-color-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
    width: 100%;
}

.csd-designer-v5 .csd-color-trigger:hover {
    border-color: #0073aa;
}

.csd-designer-v5 .csd-color-preview {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #ccc;
    flex-shrink: 0;
}

.csd-designer-v5 .csd-color-hex {
    font-size: 13px;
    color: #333;
    font-family: monospace;
}

.csd-designer-v5 .csd-color-trigger-small {
    width: auto;
    padding: 6px 10px;
}

.csd-designer-v5 .csd-color-trigger-small .csd-color-preview {
    width: 22px;
    height: 22px;
}

.csd-designer-v5 .csd-color-trigger-small .csd-color-hex {
    font-size: 11px;
}

/* V5 Layer Item Styles - Match V4 */
.csd-designer-v5 .csd-layer-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    min-height: 0;
    height: 28px;
    box-sizing: border-box;
    overflow: hidden;
}

.csd-designer-v5 .csd-layer-item:hover {
    background: #f0f7fc;
    border-color: #0073aa;
}

.csd-designer-v5 .csd-layer-item.selected {
    background: #e6f3ff;
    border-color: #0073aa;
}

/* V5 Layer Item Preview Area */
.csd-designer-v5 .csd-layer-item-preview {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    line-height: 20px;
}

.csd-designer-v5 .csd-layer-item-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* V5 Layer Item Actions */
.csd-designer-v5 .csd-layer-item-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

/* V5 Layer Action Buttons */
.csd-designer-v5 .csd-layer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 2px;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
    vertical-align: middle;
}

.csd-designer-v5 .csd-layer-btn:hover:not(:disabled) {
    background: #e0e0e0;
    color: #333;
}

.csd-designer-v5 .csd-layer-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.csd-designer-v5 .csd-layer-btn .dashicons {
    font-size: 12px !important;
    width: 12px !important;
    height: 12px !important;
    line-height: 1 !important;
    vertical-align: middle;
}

/* V5 Layer Delete Button (red) */
.csd-designer-v5 .csd-layer-delete {
    color: #cc1818;
    margin-left: 2px;
}

.csd-designer-v5 .csd-layer-delete:hover:not(:disabled) {
    background: #fee;
    color: #a00;
}

/* V5 Image Thumbnail */
.csd-designer-v5 .csd-image-thumbnail {
    width: 20px;
    height: 20px;
    border-radius: 2px;
    background-size: cover;
    background-position: center;
    background-color: #e0e0e0;
    flex-shrink: 0;
}

/* V5 Layer Placeholder (other type shown as muted/grayed) */
.csd-designer-v5 .csd-layer-placeholder {
    background: #fafafa;
    border-color: #e8e8e8;
    opacity: 0.7;
}

.csd-designer-v5 .csd-layer-placeholder:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
    opacity: 0.85;
}

.csd-designer-v5 .csd-layer-placeholder.selected {
    background: #f0f5fa;
    border-color: #8eb8db;
    opacity: 0.9;
}

.csd-designer-v5 .csd-layer-placeholder .csd-layer-item-preview {
    color: #888;
    font-style: italic;
}

.csd-designer-v5 .csd-layer-placeholder .csd-layer-item-label {
    color: #888;
}

/* V5 Placeholder Icon */
.csd-designer-v5 .csd-placeholder-icon {
    color: #aaa;
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
    line-height: 1 !important;
}

.csd-designer-v5 .csd-placeholder-icon.dashicons-editor-textcolor {
    color: #9a9a9a;
}

.csd-designer-v5 .csd-placeholder-icon.dashicons-format-image {
    color: #9a9a9a;
}

/* V5 Responsive - Tablet and below */
@media (max-width: 1200px) {
    .csd-designer-v5 {
        width: 95% !important;
    }
    
    .csd-designer-v5 .csd-left-panel,
    .csd-designer-v5 .csd-right-panel {
        flex: 0 0 280px;
    }
}

/* V5 Responsive - Mobile */
@media (max-width: 900px) {
    .csd-designer-v5 {
        width: 100% !important;
        padding: 10px !important;
    }
    
    .csd-designer-v5 .csd-main-layout {
        flex-direction: column;
    }
    
    .csd-designer-v5 .csd-left-panel,
    .csd-designer-v5 .csd-canvas-panel,
    .csd-designer-v5 .csd-right-panel {
        flex: none;
        width: 100%;
        order: unset;
    }
    
    /* On mobile, show canvas first, then left panel, then right panel */
    .csd-designer-v5 .csd-canvas-panel {
        order: 1;
    }
    
    .csd-designer-v5 .csd-left-panel {
        order: 2;
    }
    
    .csd-designer-v5 .csd-right-panel {
        order: 3;
    }
    
    .csd-designer-v5 .csd-toolbar {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .csd-designer-v5 .csd-right-panel .csd-dimension-display {
        margin: 10px;
    }
    
    .csd-designer-v5 .csd-right-panel .csd-dpi-warning-text {
        margin: 8px 10px 0 10px;
    }
}

/* ==========================================================================
   HIDE THIRD-PARTY WIDGETS ON DESIGNER PAGE
   Hide floating review widgets, chat widgets, etc. that interfere with designer
   ========================================================================== */

/* Hide common review widgets when designer is present */
.csd-designer ~ #sa-review-floating-widget,
.csd-designer ~ .sa-widget,
.csd-designer ~ .shopper-approved-widget,
.csd-designer ~ .trustpilot-widget,
.csd-designer ~ .judge-me-widget,
.csd-designer ~ .stamped-badge,
.csd-designer ~ .yotpo-widget,
.csd-designer ~ [class*="review-widget"],
.csd-designer ~ [class*="floating-badge"],
.csd-designer ~ [id*="review-widget"],
.csd-designer ~ [id*="sa-widget"] {
    display: none !important;
}

/* Body-level hiding when designer page is active (works for widgets outside main content) */
body:has(.csd-designer) #sa-review-floating-widget,
body:has(.csd-designer) .sa-widget,
body:has(.csd-designer) .shopper-approved-widget,
body:has(.csd-designer) [class*="shopper"][class*="approved"],
body:has(.csd-designer) .trustpilot-widget,
body:has(.csd-designer) .judge-me-widget,
body:has(.csd-designer) .stamped-badge,
body:has(.csd-designer) .yotpo-widget,
body:has(.csd-designer) [id*="sa-widget"],
body:has(.csd-designer) [id*="shopper-approved"],
body:has(.csd-designer) iframe[src*="shopperapproved"],
body:has(.csd-designer) iframe[src*="trustpilot"],
body:has(.csd-designer) iframe[src*="judge.me"],
body:has(.csd-designer) #stamped-main-badge,
body:has(.csd-designer) .stamped-main-badge,
body:has(.csd-designer) [id*="stamped"],
body:has(.csd-designer) [class*="stamped-badge"],
body:has(.csd-designer) [class*="independently-verified"],
body:has(.csd-designer) div[style*="position: fixed"][style*="bottom"],
body:has(.csd-designer-v5) #stamped-main-badge,
body:has(.csd-designer-v5) .stamped-main-badge,
body:has(.csd-designer-v5) [id*="stamped"],
body:has(.csd-designer-v5) div[class*="stamped"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* ============================================
   v1.19.24: Panel Tabs - Top of Left/Edit Panel
   ============================================ */

/* Panel Tabs Container */
.csd-panel-tabs {
    display: flex;
    width: 100%;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

/* Individual Tab */
.csd-panel-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 8px;
    background: #f5f5f5;
    border: none;
    border-right: 1px solid #ddd;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    color: #666;
    min-width: 0;
}

.csd-panel-tab:last-child {
    border-right: none;
}

.csd-panel-tab:hover {
    background: #e8f4fc;
    color: #0073aa;
}

.csd-panel-tab.active {
    background: #fff;
    color: #0073aa;
    border-bottom-color: #0073aa;
}

.csd-panel-tab svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

.csd-panel-tab span:not(.csd-tab-indicator) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Tab Check Indicator */
.csd-panel-tab .csd-tab-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    font-size: 9px;
    background: #28a745;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* V4 Panel Tabs - at top of edit panel */
.csd-designer-v4 .csd-panel-tabs {
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

/* V5 Panel Tabs - at top of left panel */
.csd-designer-v5 .csd-panel-tabs {
    border-radius: 0;
}

/* ============================================
   v1.19.24: Preview Overlay - Canvas Area
   ============================================ */

.csd-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.csd-preview-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.csd-preview-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.csd-preview-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 20px;
    background: #fff;
    border-top: 1px solid #ddd;
    width: 100%;
    box-sizing: border-box;
}

.csd-preview-nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #333;
}

.csd-preview-nav-btn:hover {
    background: #e8f4fc;
    border-color: #0073aa;
    color: #0073aa;
}

.csd-preview-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.csd-preview-nav-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.csd-preview-counter {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    min-width: 60px;
    text-align: center;
}

/* Hide toolbar when contour actions are hidden */
.csd-designer-v5 .csd-toolbar {
    min-height: 0;
}

.csd-designer-v5 .csd-toolbar:empty {
    display: none;
}

/* Mobile responsive tabs */
@media (max-width: 480px) {
    .csd-panel-tab {
        padding: 8px 4px;
        font-size: 10px;
    }
    
    .csd-panel-tab svg {
        width: 18px;
        height: 18px;
    }
    
    .csd-panel-tab span:not(.csd-tab-indicator) {
        display: none;
    }
}

/* ==========================================================================
   Mobile Blocking - Temporary
   ========================================================================== */

/* Mobile message - hidden by default */
.csd-mobile-block-message {
    display: none;
    padding: 40px 20px;
    text-align: center;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 20px;
}

.csd-mobile-block-message h2 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #333;
}

.csd-mobile-block-message p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Show mobile message and hide designer on small screens */
@media screen and (max-width: 768px) {
    .csd-mobile-block-message {
        display: block !important;
    }
    
    .csd-designer-v3,
    .csd-designer-v4,
    .csd-designer-v5 {
        display: none !important;
    }
}

/* Mobile Designer Visibility (v1.20.0) */
/* Hide mobile designer on desktop by default */
.csd-mobile-designer {
    display: none !important;
}

/* When mobile designer is enabled and on mobile screen */
@media screen and (max-width: 768px) {
    /* Hide the block message when mobile designer exists */
    .csd-mobile-designer ~ .csd-mobile-block-message,
    .csd-mobile-block-message:has(+ .csd-mobile-designer) {
        display: none !important;
    }
    
    /* Show mobile designer */
    .csd-mobile-designer {
        display: flex !important;
    }
}
