.clc-creator {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.clc-creator * {
    box-sizing: border-box;
}

.clc-creator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 768px) {
    .clc-creator-layout {
        grid-template-columns: 1fr;
    }
}

/* Preview Column */
.clc-preview-column {
    position: sticky;
    top: 20px;
}

.clc-preview-header,
.clc-form-header {
    margin-bottom: 15px;
}

.clc-preview-header h3,
.clc-form-header h3 {
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #1a1a1a;
    font-size: 1.2em;
}

.clc-preview-container {
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 8px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.clc-preview-placeholder {
    text-align: center;
    color: #999;
    padding: 20px;
}

.clc-preview-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
}

.clc-preview-placeholder p {
    margin: 0;
    font-size: 0.9em;
}

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

.clc-preview-info {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-left: 3px solid #dba617;
    border-radius: 6px;
    font-size: 0.85em;
    line-height: 1.5;
    color: #6b5b1e;
}

.clc-price-display {
    margin-top: 15px;
    padding: 12px 16px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 6px;
    text-align: center;
    font-size: 1.1em;
}

.clc-price-label {
    margin-right: 8px;
    font-weight: 400;
}

.clc-price-value {
    font-weight: 700;
    font-size: 1.3em;
}

/* Form Column */
.clc-form-column {
    max-height: 90vh;
    overflow-y: auto;
    padding-right: 5px;
}

.clc-form-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.clc-section-title {
    margin: 0 0 15px 0;
    font-size: 1em;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Shapes Grid */
.clc-shapes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.clc-shape-option {
    cursor: pointer;
}

.clc-shape-option input {
    display: none;
}

.clc-shape-card {
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    transition: all 0.2s ease;
    background: #fff;
}

.clc-shape-option input:checked + .clc-shape-card {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 1px #1a1a1a;
}

.clc-shape-option:hover .clc-shape-card {
    border-color: #999;
}

.clc-shape-thumb {
    width: 60px;
    height: 60px;
    margin: 0 auto 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clc-shape-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.clc-shape-name {
    display: block;
    font-size: 0.75em;
    font-weight: 600;
    margin-bottom: 2px;
    color: #333;
}

.clc-shape-price {
    display: block;
    font-size: 0.7em;
    color: #666;
}

/* Materials Grid */
.clc-materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.clc-material-option {
    cursor: pointer;
}

.clc-material-option input {
    display: none;
}

.clc-material-card {
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    padding: 6px;
    text-align: center;
    transition: all 0.2s ease;
    background: #fff;
}

.clc-material-option input:checked + .clc-material-card {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 1px #1a1a1a;
}

.clc-material-option:hover .clc-material-card {
    border-color: #999;
}

.clc-material-thumb {
    width: 50px;
    height: 50px;
    margin: 0 auto 4px;
    border-radius: 4px;
    overflow: hidden;
}

.clc-material-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clc-material-name {
    display: block;
    font-size: 0.7em;
    font-weight: 600;
    margin-bottom: 2px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clc-material-price {
    display: block;
    font-size: 0.65em;
    color: #666;
}

/* Form Fields */
.clc-field-wrapper {
    margin-bottom: 15px;
}

.clc-field-label {
    display: block;
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 5px;
    color: #333;
}

.clc-required {
    color: #e00;
}

.clc-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    transition: border-color 0.2s;
}

.clc-input:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 1px #1a1a1a;
}

.clc-input:invalid:not(:placeholder-shown) {
    border-color: #e00;
}

.clc-checkbox-label,
.clc-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 0.9em;
    cursor: pointer;
}

/* Order Summary */
.clc-form-actions {
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.clc-quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.clc-quantity-label {
    font-weight: 600;
    font-size: 0.95em;
}

.clc-quantity-input {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
}

.clc-qty-btn {
    width: 38px;
    border: none;
    background: #f2f2f2;
    color: #222;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}

.clc-qty-btn:hover {
    background: #e5e5e5;
}

.clc-quantity-field {
    width: 56px;
    text-align: center;
    border: none;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    border-radius: 0;
    -moz-appearance: textfield;
    padding: 6px;
}

.clc-quantity-field::-webkit-outer-spin-button,
.clc-quantity-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.clc-variant-option.clc-option-hidden,
.clc-variant-option.clc-option-filtered {
    display: none !important;
}

.clc-variant-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.clc-variant-search {
    flex: 1;
    min-width: 160px;
}

.clc-variant-sort {
    width: auto;
    min-width: 150px;
}

.clc-order-summary {
    margin-bottom: 15px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
}

.clc-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.9em;
}

.clc-summary-total {
    border-top: 1px solid #ddd;
    margin-top: 8px;
    padding-top: 8px;
    font-weight: 700;
    font-size: 1em;
}

.clc-submit-btn {
    width: 100%;
    padding: 14px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clc-submit-btn:hover:not(:disabled) {
    background: #333;
}

.clc-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.clc-form-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
}

.clc-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.clc-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.clc-no-items {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.clc-single-selection {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9em;
}

/* Layered Creator */
.clc-creator-layered .clc-form-section.clc-layer-section {
    border-left: 3px solid #1a1a1a;
}

.clc-layer-number {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    background: #1a1a1a;
    color: #fff;
    border-radius: 50%;
    font-size: 0.7em;
    margin-right: 6px;
}

.clc-layer-preview-toggle {
    cursor: pointer;
    vertical-align: middle;
    margin-left: 8px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.clc-layer-preview-toggle:hover {
    opacity: 1;
}

.clc-layer-preview-thumb {
    margin-bottom: 10px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;
    text-align: center;
}

.clc-layer-preview-thumb img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.clc-summary-layer-row {
    font-size: 0.85em;
    color: #555;
}

.clc-layer-materials-grid {
    margin-top: 8px;
}

/* Variant Creator */
.clc-creator-variant .clc-preview-container.clc-variant-preview-container {
    min-height: 300px;
    padding: 0;
}

#clc-variant-preview-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

.clc-variant-options-grid.clc-variant-options-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.clc-variant-options-grid.clc-variant-options-simple {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.clc-variant-option {
    cursor: pointer;
}

.clc-variant-option input[type="radio"] {
    display: none;
}

.clc-variant-card {
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    transition: all 0.2s ease;
    background: #fff;
}

.clc-variant-option input:checked + .clc-variant-card {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 1px #1a1a1a;
}

.clc-variant-option:hover .clc-variant-card {
    border-color: #999;
}

.clc-variant-thumb {
    width: 70px;
    height: 70px;
    margin: 0 auto 6px;
    border-radius: 4px;
    overflow: hidden;
}

.clc-variant-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clc-variant-name {
    display: block;
    font-size: 0.75em;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clc-variant-price-modifier {
    display: block;
    font-size: 0.7em;
    color: #666;
}

.clc-variant-options-simple {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.clc-variant-simple-card {
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    padding: 10px 8px;
    text-align: center;
    transition: all 0.2s ease;
    background: #fff;
}

.clc-variant-option input:checked + .clc-variant-simple-card {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 1px #1a1a1a;
}

.clc-variant-option:hover .clc-variant-simple-card {
    border-color: #999;
}

.clc-variant-simple-card .clc-variant-name {
    font-size: 0.85em;
}

.clc-summary-variant-row {
    font-size: 0.85em;
    color: #555;
}

.clc-color-category-group {
    margin-bottom: 12px;
}

.clc-color-category-group:last-child {
    margin-bottom: 0;
}

.clc-color-category-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 0.8em;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.clc-color-category-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.clc-color-category-name {
    font-size: 0.85em;
}

.clc-variant-options-categorized {
    margin-bottom: 4px;
}

.clc-variant-options-scroll-area {
    max-height: 260px;
    overflow-y: auto;
}

/* Categorized grids: fixed 4 columns, show 1 row per category then scroll */
.clc-variant-options-images.clc-variant-options-categorized {
    grid-template-columns: repeat(4, 1fr);
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.clc-variant-options-simple.clc-variant-options-categorized {
    grid-template-columns: repeat(4, 1fr);
    max-height: 65px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.clc-variant-options-images.clc-variant-options-categorized::-webkit-scrollbar {
    width: 5px;
}

.clc-variant-options-images.clc-variant-options-categorized::-webkit-scrollbar-thumb,
.clc-variant-options-simple.clc-variant-options-categorized::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* ===================================================================
   CLC creator single-product page — full-width, no-sidebar layout.
   Two layers of selectors:
   1. Direct class on the element (.clc-creator-product-area) — always works.
   2. Body class (.clc-creator-product-page) — hides sidebar and resets
      any theme layout that floats/offsets the content column.
   =================================================================== */

/* --- Direct selectors (template-assigned classes, always present) --- */
.clc-creator-product-area {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 1 auto !important;
    grid-column: 1 / -1 !important;
}

.clc-creator-product-main {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* --- Body-class selectors (added by CLC_Shop::creator_body_class) --- */
.clc-creator-product-page #primary,
.clc-creator-product-page .content-area,
.clc-creator-product-page #content,
.clc-creator-product-page .site-content,
.clc-creator-product-page .content-wrapper,
.clc-creator-product-page #main-content {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 1 auto !important;
    grid-column: 1 / -1 !important;
}

.clc-creator-product-page #secondary,
.clc-creator-product-page .widget-area,
.clc-creator-product-page aside.sidebar,
.clc-creator-product-page .sidebar-container,
.clc-creator-product-page .sidebar-area {
    display: none !important;
}

.clc-creator-product-page .clc-creator {
    padding: 20px;
}
