/**
 * Custom Frame Designer - Step-by-Step Styles
 * Themed for MyRoomArt (myroomart.thisisunder.construction)
 * Divi theme - Montserrat headings, #D75E3E primary, #353740 heading
 */

/* ===== Divi header menus above the creator preview ===== */
/* Raise the header's stacking context, not just the dropdown inside it.
   Keep this scoped to creator pages and below the creator's modal layers. */
body:has(.cfd-container) .et-l--header:not([data-canvas]) {
    position: relative;
    z-index: 1000 !important;
}

body:has(.cfd-container) .et-l--header > .et_builder_inner_content {
    z-index: 1000 !important;
}

body:has(.cfd-container) .et-l--header .et_pb_row:has(.et_pb_dropdown) {
    z-index: 20 !important;
    overflow: visible;
}

body:has(.cfd-container) .et-l--header .et_pb_dropdown {
    z-index: 1000 !important;
}

/* ===== Base Styles ===== */
.cfd-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
    box-sizing: border-box;
    font-family: 'Montserrat', 'Open Sans', Arial, sans-serif;
    color: #353740;
}

/* ===== Header & Progress ===== */
.cfd-header {
    text-align: center;
    margin-bottom: 25px;
}

.cfd-header h1 {
    font-size: 2rem;
    color: #353740;
    margin-bottom: 15px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
}

.cfd-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.cfd-progress-step {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.cfd-progress-step.active .cfd-step-number {
    background: #D75E3E;
    color: white;
}

.cfd-progress-step.completed .cfd-step-number {
    background: #c04d2f;
    color: white;
}

.cfd-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.cfd-step-label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.cfd-progress-step:not(:last-child)::after {
    content: '→';
    color: #ccc;
    margin-left: 6px;
    font-size: 1.2rem;
}

/* ===== Content Wrapper ===== */
.cfd-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    align-items: start;
}

/* Horizontal layout: Preview (left) | Controls (right) — 50/50 split */
.cfd-content-wrapper > .cfd-preview-panel {
    order: 1;
    min-width: 0;
}

.cfd-content-wrapper > .cfd-controls-panel {
    order: 2;
    min-width: 0;
}

.cfd-content-wrapper > .cfd-vertical-steps-wrapper {
    display: none;
}

@media (max-width: 1024px) {
    .cfd-content-wrapper {
        grid-template-columns: 1fr;
    }

    .cfd-content-wrapper > .cfd-preview-panel {
        order: -1;
    }
}

/* ===== Controls Panel ===== */
.cfd-controls-panel {
    background: white;
    padding: 18px;
    border-radius: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

/* Navigation bar at top of controls panel (right column) */
.cfd-controls-panel-vertical {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
}
.cfd-controls-nav-sticky {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 0;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}
.cfd-controls-nav-sticky .cfd-button {
    flex: 0 1 auto;
    padding: 8px 20px;
    font-size: 0.85rem;
    border-radius: 0;
    min-width: 100px;
}

.cfd-nav-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.cfd-nav-buttons .cfd-button {
    padding: 6px 14px;
    font-size: 0.78rem;
    border-radius: 0;
    min-width: auto;
}

.cfd-button-reset {
    background: #f0f0f0;
    color: #666;
    border: 1px solid #d0d0d0;
}
.cfd-button-reset:hover {
    background: #e8e8e8;
    color: #c0392b;
    border-color: #c0392b;
}

/* Smooth step transitions */
.cfd-step-content {
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.cfd-step-content.cfd-step-exit {
    opacity: 0;
    transform: translateX(-12px);
}
.cfd-step-content.cfd-step-enter {
    opacity: 1;
    transform: translateX(0);
}

.cfd-step-content h2 {
    font-size: 1.4rem;
    color: #353740;
    margin-bottom: 5px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
}

.cfd-step-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.7rem;
    border-radius: 0;
    background: linear-gradient(135deg, #e8f3ea 0%, #f3f8f1 100%);
    color: #2d6a4f;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.cfd-step-hero-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.cfd-step-hero-topline .cfd-step-eyebrow {
    margin-bottom: 0;
    flex-shrink: 0;
}

.cfd-step-hero-topline h2 {
    margin-bottom: 0;
}

.cfd-step-description {
    color: #666;
    margin-bottom: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cfd-section-block {
    margin-bottom: 18px;
}

.cfd-section-block h3 {
    font-size: 1.1rem;
    color: #353740;
    margin-bottom: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* ===== Preview Panel ===== */
.cfd-preview-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.cfd-canvas-container {
    background: white;
    padding: 20px;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 0;
    contain: layout style;
}

.cfd-preview-mode-toggle {
    display: inline-flex;
    border: 1px solid #d6dce3;
    border-radius: 0;
    overflow: hidden;
    background: #fff;
}

.cfd-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    min-height: 36px;
}

.cfd-preview-mode-cluster {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

/* The active view is already indicated by the orange button. */
.cfd-preview-toolbar .cfd-zoom-level {
    display: none !important;
}

.cfd-preview-toolbar .cfd-navigation-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.cfd-preview-toolbar .cfd-navigation-top .cfd-button {
    padding: 5px 14px;
    font-size: 0.8rem;
    border-radius: 0;
}

.cfd-preview-mode-btn {
    border: none;
    background: transparent;
    color: #5f6b76;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 6px 10px;
    cursor: pointer;
    text-transform: uppercase;
}

.cfd-layout-vertical #cfd-preview-mode-toggle {
    flex: 0 1 auto;
    min-width: 0;
}

.cfd-layout-vertical #cfd-preview-mode-toggle .cfd-preview-mode-btn {
    min-width: 0;
    padding-right: 9px;
    padding-left: 9px;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.cfd-layout-vertical .cfd-nav-buttons {
    gap: 5px;
}

.cfd-layout-vertical .cfd-nav-buttons .cfd-button {
    width: auto;
    min-width: 0;
    padding: 5px 9px;
    font-size: 0.72rem;
    line-height: 1.2;
}

.cfd-preview-mode-btn.is-active {
    background: #D75E3E;
    color: #fff;
}

#cfd-frame-preview {
    position: relative;
    z-index: 0;
}

.cfd-canvas-2d {
    width: 100%;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: radial-gradient(circle at 50% 42%, #fafcff 0%, #eef2f6 55%, #e4e8ed 100%);
}

.cfd-canvas-chevron {
    width: 100%;
    height: 600px;
    display: none;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(251, 252, 255, 0.98) 0%, rgba(236, 241, 246, 0.98) 100%);
    padding: 28px;
    box-sizing: border-box;
}

.cfd-chevron-preview-card {
    width: min(100%, 720px);
    min-height: 420px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    justify-items: center;
    border: 1px solid #dde4ec;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 24px 48px rgba(36, 49, 63, 0.08);
    padding: 28px;
}

.cfd-chevron-preview-figure {
    width: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cfd-chevron-preview-image {
    display: block;
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
}

.cfd-chevron-preview-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    text-align: center;
    color: #425466;
}

.cfd-chevron-preview-meta strong {
    font-size: 1rem;
    color: #203244;
}

.cfd-chevron-preview-meta span {
    font-size: 0.84rem;
    line-height: 1.45;
}

.cfd-chevron-fallback {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.cfd-chevron-swatch-panel {
    min-height: 180px;
    border: 1px solid #d8e0e7;
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 0 8px rgba(255,255,255,0.45);
}

.cfd-chevron-fallback-copy,
.cfd-chevron-empty-state {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #536271;
}

.cfd-chevron-fallback-copy strong,
.cfd-chevron-empty-state strong {
    color: #203244;
    font-size: 1rem;
}

.cfd-chevron-fallback-copy span,
.cfd-chevron-empty-state span {
    font-size: 0.86rem;
    line-height: 1.5;
}

.cfd-chevron-mount-stack {
    width: min(100%, 520px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    padding: 10px 0;
}

.cfd-chevron-mount-wall {
    width: 42px;
    height: 190px;
    background: linear-gradient(180deg, #eef2f6 0%, #cfd8e1 100%);
    border: 1px solid #c4d0db;
}

.cfd-chevron-mount-core {
    position: relative;
    width: 310px;
    height: 138px;
    border: 1px solid rgba(34, 49, 63, 0.16);
    box-shadow: 0 14px 30px rgba(36, 49, 63, 0.08);
    z-index: 1;
}

.cfd-chevron-mount-layer-secondary {
    position: absolute;
    inset: 18px 18px 18px 18px;
    border: 1px solid rgba(34, 49, 63, 0.12);
    z-index: 2;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}

.cfd-chevron-aperture-cut {
    position: absolute;
    top: 32px;
    left: 42px;
    right: 42px;
    bottom: 32px;
    background: #ffffff;
    border: 1px solid rgba(34, 49, 63, 0.12);
}

.cfd-2d-frame {
    flex-shrink: 0;
    position: relative;
    z-index: 0;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
}

.cfd-frame-loader-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: rgba(0,0,0,0.55);
    padding: 6px 16px;
    border-radius: 99px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.cfd-2d-mount {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
}

.cfd-2d-inner-mount,
.cfd-mount-diagram-inner {
    position: absolute;
    box-sizing: border-box;
}

.cfd-2d-aperture {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    background: #f8fbff;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

#cfd-frame-preview.cfd-preview-mode-front #cfd-canvas-2d,
#cfd-frame-preview.cfd-preview-mode-2d #cfd-canvas-2d {
    display: flex;
}

#cfd-frame-preview.cfd-preview-mode-front #cfd-canvas-chevron,
#cfd-frame-preview.cfd-preview-mode-front #cfd-canvas-3d,
#cfd-frame-preview.cfd-preview-mode-front .cfd-zoom-controls,
#cfd-frame-preview.cfd-preview-mode-2d #cfd-canvas-chevron,
#cfd-frame-preview.cfd-preview-mode-2d #cfd-canvas-3d,
#cfd-frame-preview.cfd-preview-mode-2d .cfd-zoom-controls {
    display: none !important;
}

#cfd-frame-preview.cfd-preview-mode-chevron #cfd-canvas-2d,
#cfd-frame-preview.cfd-preview-mode-chevron #cfd-canvas-3d,
#cfd-frame-preview.cfd-preview-mode-chevron .cfd-zoom-controls {
    display: none !important;
}

#cfd-frame-preview.cfd-preview-mode-chevron #cfd-canvas-chevron {
    display: flex !important;
}

#cfd-frame-preview.cfd-preview-mode-3d #cfd-canvas-2d,
#cfd-frame-preview.cfd-preview-mode-3d #cfd-canvas-chevron {
    display: none !important;
}

#cfd-frame-preview.cfd-preview-mode-3d #cfd-canvas-3d {
    display: block !important;
}

#cfd-frame-preview.cfd-preview-mode-3d .cfd-zoom-controls {
    display: flex !important;
}
#cfd-frame-preview {
    width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 0;
    overflow: visible;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

#cfd-canvas-3d {
    display: block;
    width: 100% !important;
    height: 600px !important;
    max-height: 600px;
    z-index: 0 !important;
    position: relative !important;
}

/* Zoom controls */
.cfd-zoom-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.cfd-zoom-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 18px;
    color: #333;
}

.cfd-zoom-btn:hover {
    background: #D75E3E;
    color: white;
    border-color: #D75E3E;
    transform: scale(1.05);
}

.cfd-zoom-btn:active {
    transform: scale(0.95);
}

.cfd-zoom-level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    background: rgba(255,255,255,0.96);
    padding: 6px 12px;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    pointer-events: none;
    border: 1px solid rgba(213, 220, 227, 0.95);
    white-space: nowrap;
}

.cfd-dimensions-display {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.cfd-3d-instructions {
    text-align: center;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
}

/* ===== Price Display Box ===== */
.cfd-price-box {
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 0;
    margin-top: 14px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}

.cfd-price-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #fff;
    border-bottom: 1px solid #edf0f3;
}

.cfd-price-box-title {
    font-family: 'Montserrat', 'Open Sans', Arial, sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    color: #1f2933;
    letter-spacing: 0.01em;
}

.cfd-bulk-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: #0d9488;
    background: #f0fdfa;
    border: 1px solid #ccfbf1;
    padding: 2px 7px;
    border-radius: 3px;
}

.cfd-price-container {
    background: white;
    padding: 14px 16px;
    border-radius: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.cfd-current-price {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 10px;
}

.cfd-price-amount-wrapper {
    text-align: right;
}

.cfd-price-label {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
    padding-top: 4px;
}

.cfd-price-value {
    font-size: 1.6rem;
    color: #D75E3E;
    font-weight: bold;
    line-height: 1.1;
}

.cfd-current-price.is-loading,
.cfd-price-row.is-loading,
.cfd-price-row-total.is-loading {
    opacity: 0.8;
}

.cfd-price-value.is-loading,
.cfd-total-price.is-loading,
.cfd-current-price .is-loading,
.cfd-price-row .is-loading,
.cfd-price-row-total .is-loading {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cfd-price-value.is-loading::after,
.cfd-total-price.is-loading::after,
.cfd-current-price .is-loading::after,
.cfd-price-row .is-loading::after,
.cfd-price-row-total .is-loading::after {
    content: '';
    width: 0.9em;
    height: 0.9em;
    border: 2px solid rgba(215, 94, 62, 0.18);
    border-top-color: #D75E3E;
    border-radius: 50%;
    animation: cfd-price-spin 0.7s linear infinite;
    flex: 0 0 auto;
}

.cfd-unit-price-sub {
    display: block;
    font-size: 0.78rem;
    color: #6b7280;
    font-weight: 500;
    margin-top: 3px;
}

/* Quantity Stepper */
.cfd-quantity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 10px;
    border-bottom: 1px dashed #e2e6ea;
    margin-bottom: 10px;
}

.cfd-quantity-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.cfd-quantity-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d2d6dc;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.cfd-qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
    user-select: none;
}

.cfd-qty-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.cfd-qty-btn:active {
    background: #d1d5db;
}

.cfd-quantity-input {
    width: 48px;
    height: 32px;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2933;
    padding: 0;
    margin: 0;
    -moz-appearance: textfield;
}

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

/* Bulk Tiers Info */
.cfd-bulk-tiers-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 10px;
    font-size: 0.78rem;
}

.cfd-bulk-tiers-header {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 5px;
}

.cfd-bulk-tiers-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cfd-bulk-pill {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 2px 6px;
    color: #64748b;
    font-size: 0.75rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.cfd-bulk-pill:hover {
    border-color: #0d9488;
    color: #0d9488;
}

.cfd-bulk-pill.is-active {
    background: #f0fdfa;
    border-color: #0d9488;
    color: #0d9488;
    font-weight: 700;
}

.cfd-bulk-savings-applied {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #cbd5e1;
    color: #0d9488;
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cfd-step-price-breakdown {
    margin-top: 10px;
}

.cfd-price-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    color: #666;
    font-size: 0.85rem;
}

/* Review summary price breakdown — tighter line spacing */
.cfd-price-breakdown-table .cfd-price-row {
    padding: 2px 0;
    font-size: 0.78rem;
}

.cfd-price-breakdown-table .cfd-price-row-total {
    font-size: 0.95rem;
    margin-top: 6px;
    padding-top: 8px;
}

/* Applied Discounts badge (review summary) */
.cfd-discount-badge {
    display: inline-block;
    background: #e6f7ee;
    color: #0d9488;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 2px 10px;
    border-radius: 99px;
    white-space: nowrap;
}
.cfd-price-breakdown-table .cfd-bulk-discount-row {
    color: #0d9488;
    font-weight: 600;
}

.cfd-price-row-total {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
    border-top: 2px solid #e0e0e0;
    margin-top: 10px;
    padding-top: 15px;
}

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

/* ===== Buttons ===== */
.cfd-navigation {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cfd-navigation-top {
    justify-content: center;
    margin-top: 18px;
    padding: 14px 18px;
    background: #f9f9f9;
    border-radius: 0;
}

.cfd-button {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 0;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.cfd-button-primary {
    letter-spacing: 0.04em;
    background: #D75E3E;
    color: white;
}
.cfd-button-primary:hover {
    background: #c04d2f;
}
.cfd-button-primary:active {
    background: #a83f25;
}

.cfd-button-secondary {
    background: #e0e0e0;
    color: #333;
}

.cfd-button-secondary:hover {
    background: #d0d0d0;
}

.cfd-button-success {
    letter-spacing: 0.04em;
    background: #D75E3E;
    color: white;
}

.cfd-button-success:hover {
    background: #c04d2e;
}

.cfd-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cfd-button-loading {
    display: none;
}

.cfd-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

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

/* ===== Step 1: Dimensions ===== */
.cfd-step-dimensions .cfd-dimensions-inputs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-auto-rows: min-content;
    gap: 12px;
    min-width: 0;
    align-items: flex-start;
}

.cfd-step-dimensions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cfd-dimensions-hero {
    padding: 14px 16px 0;
}

.cfd-dimensions-hero .cfd-step-hero-topline {
    align-items: center;
}

.cfd-dimensions-hero h2 {
    margin-bottom: 6px;
    font-size: 1.42rem;
    line-height: 1.1;
}

.cfd-step-hero {
    padding: 18px 18px 0;
}

.cfd-step-hero h2 {
    margin-bottom: 8px;
    font-size: 1.65rem;
    line-height: 1.1;
}

.cfd-step-content:not(.cfd-step-review) .cfd-step-hero {
    padding: 12px 18px 0;
}

.cfd-step-content .cfd-step-hero-topline {
    align-items: center;
}

.cfd-step-content .cfd-step-eyebrow,
.cfd-dimensions-hero .cfd-step-eyebrow {
    background: linear-gradient(135deg, #fae3db 0%, #fff2ed 100%);
    color: #b4492d;
    border: 1px solid rgba(215, 94, 62, 0.22);
}

.cfd-step-content .cfd-step-description,
.cfd-dimensions-hero .cfd-step-description {
    margin-top: 10px;
    margin-bottom: 14px;
}

.cfd-step-content .cfd-step-meta,
.cfd-dimensions-hero .cfd-dimensions-meta {
    margin-top: 10px;
}

.cfd-dimensions-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.cfd-step-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.cfd-dimensions-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.34rem 0.68rem;
    border-radius: 0;
    background: #f4f6f8;
    border: 1px solid #dbe3ea;
    color: #425466;
    font-size: 0.74rem;
    font-weight: 600;
}

.cfd-step-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.44rem 0.78rem;
    border-radius: 0;
    background: #f4f6f8;
    border: 1px solid #dbe3ea;
    color: #425466;
    font-size: 0.79rem;
    font-weight: 600;
}

.cfd-dimensions-shell {
    display: grid;
    gap: 12px;
    padding: 0 16px;
}

.cfd-step-surface {
    padding: 16px;
    border: 1px solid #dde6ee;
    border-radius: 0;
    background: #fbfdff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.cfd-step-surface-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.cfd-step-surface-heading > span {
    font-size: 0.95rem;
    font-weight: 700;
    color: #203244;
}

.cfd-step-surface-heading > small {
    color: #6b7784;
    font-size: 0.78rem;
    line-height: 1.4;
}

.cfd-step-dimensions .cfd-field-group-dimension {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-self: start;
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    margin-bottom: 0;
    padding: 12px 14px;
    border-radius: 0;
    border: 1px solid #dde6ee;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(246,249,251,0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

.cfd-step-dimensions .cfd-dimensions-inputs > * {
    min-width: 0;
    align-self: start;
}

@media (max-width: 600px) {
    .cfd-step-dimensions .cfd-dimensions-inputs {
        grid-template-columns: 1fr;
    }
}

.cfd-field-group {
    margin-bottom: 10px;
    min-width: 0;
}

.cfd-field-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
    color: #24313f;
    font-size: 0.82rem;
    line-height: 1.2;
}

.cfd-field-range {
    display: block;
    font-size: 0.72rem;
    color: #667788;
    margin-top: 3px;
}

.cfd-step-dimensions .cfd-input-with-icon {
    position: relative;
    margin-bottom: 0;
    width: 100%;
    min-width: 0;
}

.cfd-step-dimensions .cfd-input-with-icon input {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 8px 14px;
    border: 1px solid #c8d4de;
    border-radius: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: #1c2a38;
    background: #fff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    min-height: 46px;
}

.cfd-step-dimensions #cfd-width,
.cfd-step-dimensions #cfd-height {
    display: block;
    width: 100%;
    max-width: 100%;
    font-size: 0.95rem;
    line-height: 1.2;
}

#cfd-width::-webkit-outer-spin-button,
#cfd-width::-webkit-inner-spin-button,
#cfd-height::-webkit-outer-spin-button,
#cfd-height::-webkit-inner-spin-button {
    opacity: 1;
    width: 18px;
    min-height: 28px;
    margin: 0;
    cursor: pointer;
}

/* On small screens the native spinners overlap the typed value
   (feedback 01.10.26) — hide them there; users type or use the
   on-screen numeric keypad. */
@media (max-width: 768px) {
    #cfd-width::-webkit-outer-spin-button,
    #cfd-width::-webkit-inner-spin-button,
    #cfd-height::-webkit-outer-spin-button,
    #cfd-height::-webkit-inner-spin-button {
        opacity: 0;
        width: 0;
        min-height: 0;
        pointer-events: none;
    }
}

.cfd-input-with-icon input:focus {
    outline: none;
    border-color: #d75e3e;
    box-shadow: 0 0 0 4px rgba(215,94,62,0.14);
}

.cfd-input-suffix {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: #5e6b77;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
}

.cfd-step-dimensions .cfd-field-helper {
    margin: 6px 0 0;
    color: #6b7784;
    font-size: 0.74rem;
    line-height: 1.35;
}

.cfd-dimensions-section-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cfd-dimensions-section-heading > span {
    font-size: 0.9rem;
    font-weight: 700;
    color: #203244;
}

.cfd-dimensions-section-heading > small {
    color: #6b7784;
    font-size: 0.74rem;
    line-height: 1.35;
}

.cfd-dimensions-quick-picks,
.cfd-dimensions-summary-card {
    padding: 13px 14px;
    border: 1px solid #dde6ee;
    border-radius: 0;
    background: #fbfdff;
}

.cfd-dimension-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.cfd-dimension-preset-btn {
    appearance: none;
    border: 1px solid #cfd9e2;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
    color: #274257;
    border-radius: 0;
    min-height: 42px;
    padding: 0.58rem 0.75rem;
    font-size: 0.81rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cfd-dimension-preset-btn:hover,
.cfd-dimension-preset-btn:focus-visible {
    border-color: #d75e3e;
    box-shadow: 0 10px 24px rgba(215,94,62,0.12);
    transform: translateY(-1px);
    outline: none;
}

.cfd-step-dimensions .cfd-dimension-preset-btn.is-active,
.cfd-step-dimensions .cfd-dimension-preset-btn.is-active:hover,
.cfd-step-dimensions .cfd-dimension-preset-btn.is-active:focus-visible {
    background: linear-gradient(135deg, #d75e3e 0%, #c24d2f 100%);
    border-color: #c24d2f;
    box-shadow: 0 10px 24px rgba(215,94,62,0.10);
    color: #fff;
}

.cfd-dimensions-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 10px;
}

.cfd-dimensions-summary-item {
    padding: 10px 11px;
    border-radius: 0;
    background: #fff;
    border: 1px solid #e3ebf1;
}

.cfd-dimensions-summary-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #708090;
    margin-bottom: 4px;
}

.cfd-dimensions-summary-item strong {
    display: block;
    color: #203244;
    font-size: 0.88rem;
    line-height: 1.3;
}

.cfd-dimensions-preview {
    grid-column: 1 / -1;
    margin-top: 12px;
    text-align: center;
}

.cfd-visual-ratio {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    background:
        radial-gradient(circle at top, rgba(255,255,255,0.92) 0%, rgba(231,239,245,0.96) 100%);
    border: 1px solid #d7e1e8;
    padding: 20px;
    border-radius: 0;
}

.cfd-rectangle {
    background: linear-gradient(135deg, rgba(215,94,62,0.22) 0%, rgba(76,175,80,0.18) 100%);
    border: 2px solid rgba(215,94,62,0.5);
    border-radius: 0;
    box-shadow: 0 14px 34px rgba(60,40,30,0.14);
    transition: all 0.3s ease;
}

/* ===== Step 2: Materials ===== */
.cfd-materials-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.cfd-material-filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cfd-material-filter-field label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5f6b76;
}

.cfd-material-filter-field select,
.cfd-material-filter-field input[type="search"] {
    width: 100%;
    min-height: 40px;
    border: 1px solid #d4dae0;
    border-radius: 0;
    padding: 8px 12px;
    font-size: 0.84rem;
    background: #fff;
}

/* Shape filter — spans full toolbar width */
.cfd-shape-filter-field {
    grid-column: 1 / -1;
}

/* Visual shape picker */
.cfd-shape-visual-picker {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.cfd-shape-pick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 10px 7px;
    border: 1.5px solid #d4dae0;
    border-radius: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fb 100%);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    color: #52606d;
    line-height: 1;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
    min-width: 88px;
    flex: 0 0 auto;
}

.cfd-shape-pick:hover {
    border-color: #0073aa;
    color: #0073aa;
}

.cfd-shape-pick.is-active {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff;
}

.cfd-shape-pick.is-active canvas {
    filter: brightness(0) invert(1);
}

.cfd-shape-all-icon {
    width: 28px;
    height: 18px;
    color: currentColor;
}

.cfd-shape-cross-section {
    width: 56px;
    height: 34px;
    object-fit: contain;
    display: block;
}

.cfd-shape-pick.is-active .cfd-shape-cross-section {
    filter: brightness(0) invert(1);
}

.cfd-shape-pick-canvas {
    display: block;
    width: 56px;
    height: 34px;
}

/* Mini 2-D section profile strip in the info area */
.cfd-section-mini-canvas {
    display: block;
    width: 100%;
    height: 22px;
    border-radius: 0;
    background: #f0f4f8;
    margin-bottom: 3px;
    pointer-events: none;
}

/* Color swatch dot next to material name */
.cfd-color-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.15);
    vertical-align: middle;
    margin-right: 3px;
}

/* Color filter select with swatch indicators */
.cfd-color-filter-select option[data-swatch-color] {
    padding-left: 22px;
    background-repeat: no-repeat;
    background-position: 4px center;
    background-size: 14px 14px;
}

/* Filter counts indicator */
.cfd-material-filter-counts {
    font-size: 0.78rem;
    color: #8895a3;
    margin-bottom: 8px;
    padding: 4px 0;
    min-height: 1.2em;
    transition: color 0.3s ease;
}
.cfd-material-filter-counts.is-active {
    color: #0073aa;
    font-weight: 600;
}

/* Sort dropdown */
#cfd-material-sort {
    width: 100%;
    min-height: 34px;
    border: 1px solid #d4dae0;
    border-radius: 0;
    padding: 6px 9px;
    font-size: 0.84rem;
    background: #fff;
    cursor: pointer;
}

/* Smooth transitions for material cards on filter */
.cfd-materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 8px;
}

.cfd-material-card {
    position: relative;
    transition: opacity 0.3s ease, transform 0.3s ease, margin 0.3s ease;
}

.cfd-material-card.is-filter-hidden {
    display: none;
}

.cfd-material-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cfd-material-label {
    display: block;
    cursor: pointer;
    border: 1px solid #d9e2ea;
    border-radius: 0;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 28px rgba(36, 49, 63, 0.06);
    transition: all 0.25s ease;
}

.cfd-material-card input[type="radio"]:checked + .cfd-material-label {
    border-color: #d75e3e;
    box-shadow: 0 0 0 3px rgba(215,94,62, 0.14), 0 18px 36px rgba(36, 49, 63, 0.1);
}

.cfd-material-preview {
    height: 100px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: 1px solid #ddd;
}

.cfd-material-preview.has-chevron {
    padding: 4px;
    box-sizing: border-box;
}

.cfd-material-preview .cfd-material-chevron-image {
    display: block;
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    object-fit: contain;
    object-position: center;
}

.cfd-material-info {
    padding: 6px 7px 7px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cfd-material-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

/* Shape badges row below material name */
.cfd-material-shapes-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.cfd-shape-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 6px 1px 4px;
    background: #f2f5f8;
    border: 1px solid #dde3ea;
    border-radius: 0;
    font-size: 12px !important;
    font-weight: 500;
    color: #4a5a6a;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.15s ease;
}
.cfd-shape-badge:hover {
    border-color: #D75E3E;
    background: #fdf1ed;
}
.cfd-shape-badge.is-active {
    border-color: #D75E3E;
    background: #D75E3E;
    color: #fff;
}
.cfd-shape-badge.is-active .cfd-shape-badge-icon {
    color: #fff;
}
.cfd-shape-badge-pick:focus-visible {
    outline: 2px solid #D75E3E;
    outline-offset: 1px;
}
/* Reset button styles for shape badges */
.cfd-shape-badge-pick {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    -webkit-appearance: none;
    appearance: none;
}
.cfd-shape-badge-icon {
    font-size: 0.65rem !important;
    line-height: 1;
}
.cfd-shape-badge-label {
    white-space: nowrap;
}

.cfd-material-meta-main {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: wrap;
}

.cfd-material-name {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
    font-size: 0.78rem;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    min-width: 0;
    flex-shrink: 1;
    word-break: break-word;
}

/* Material name line group (name + size badge) */
.cfd-material-name-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: wrap;
}

.cfd-material-size-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    color: #666;
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.cfd-material-price {
    display: block;
    font-size: 0.72rem;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}

.cfd-material-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: #b8c1ca;
    flex-shrink: 0;
}

.cfd-material-check .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
    line-height: 16px;
}

.cfd-material-card input[type="radio"]:checked + .cfd-material-label .cfd-material-check {
    color: #0073aa;
}

.cfd-materials-empty {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 0;
    background: #f6f8fa;
    border: 1px dashed #c7d0d9;
    color: #52606d;
    font-size: 0.82rem;
}

@media (max-width: 768px) {
    .cfd-materials-toolbar {
        grid-template-columns: 1fr;
    }

    .cfd-shape-visual-picker {
        gap: 6px;
    }

    .cfd-shape-pick {
        min-width: 56px;
        padding: 5px 7px 4px;
    }

}

/* ===== Step 3: Mounting Styles ===== */
.cfd-mounting-styles {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cfd-mount-style-card {
    position: relative;
}

.cfd-mount-style-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cfd-mount-style-label {
    display: flex;
    cursor: pointer;
    border: 1px solid #d9e2ea;
    border-radius: 0;
    padding: 10px 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    transition: all 0.25s ease;
    gap: 10px;
    min-height: 88px;
}

.cfd-mount-style-card input[type="radio"]:checked + .cfd-mount-style-label {
    border-color: #d75e3e;
    box-shadow: 0 0 0 3px rgba(215, 94, 62, 0.16), 0 18px 32px rgba(36, 49, 63, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #fff6f2 100%);
}

.cfd-mount-style-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: #b8c1ca;
    flex-shrink: 0;
}

.cfd-mount-style-check .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
    line-height: 16px;
}

.cfd-mount-style-card input[type="radio"]:checked + .cfd-mount-style-label .cfd-mount-style-check {
    color: #0073aa;
}

.cfd-mount-style-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: #f5f8fb;
}

.cfd-mount-style-icon svg {
    width: 40px;
    height: 40px;
}

.cfd-mount-style-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
}

.cfd-mount-style-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.25;
}

.cfd-mount-style-desc {
    font-size: 0.78rem;
    color: #666;
    line-height: 1.35;
}

/* ===== Backing Selection (Step 6) ===== */
.cfd-backing-styles {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cfd-backing-card {
    position: relative;
}

.cfd-backing-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cfd-backing-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    border: 1px solid #d9e2ea;
    border-radius: 0;
    padding: 8px 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    transition: all 0.25s ease;
    gap: 10px;
}

.cfd-backing-card input[type="radio"]:checked + .cfd-backing-label {
    border-color: #d75e3e;
    box-shadow: 0 0 0 3px rgba(215, 94, 62, 0.16), 0 18px 32px rgba(36, 49, 63, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #fff6f2 100%);
}

.cfd-backing-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: #f5f8fb;
}

.cfd-backing-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.cfd-backing-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cfd-backing-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.25;
}

.cfd-backing-desc {
    font-size: 0.78rem;
    color: #666;
    line-height: 1.35;
}

/* ===== Step 4: Mounting Colors & Widths ===== */
.cfd-section-block {
    margin-bottom: 30px;
}

.cfd-section-block h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
}

.cfd-colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 10px;
}

.cfd-colors-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.cfd-color-filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cfd-color-filter-field label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5f6b76;
}

.cfd-color-filter-field select,
.cfd-color-filter-field input[type="search"] {
    width: 100%;
    min-height: 40px;
    border: 1px solid #d4dae0;
    border-radius: 0;
    padding: 8px 12px;
    font-size: 0.84rem;
    background: #fff;
}

.cfd-colors-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
}

.cfd-color-card {
    position: relative;
}

.cfd-color-card.is-filter-hidden {
    display: none;
}

.cfd-color-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cfd-color-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border: 1px solid #d9e2ea;
    border-radius: 0;
    padding: 10px 7px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    transition: all 0.25s ease;
    gap: 5px;
    min-height: 90px;
}

.cfd-color-card input[type="radio"]:checked + .cfd-color-label {
    border-color: #d75e3e;
    box-shadow: 0 0 0 3px rgba(215,94,62, 0.14);
}

.cfd-color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    transition: transform 0.2s ease, border-radius 0.2s ease;
}

.cfd-color-swatch--square {
    border-radius: 0;
}

.cfd-color-swatch--pill {
    border-radius: 0;
}

.cfd-color-swatch--diamond {
    border-radius: 0;
    transform: rotate(45deg);
}

/* Mountboard swatches use one consistent physical sample shape. */
.cfd-step-mount-widths .cfd-color-swatch {
    border-radius: 0 !important;
    transform: none !important;
}

/* ============================================================
   Bootstrap inline: red badge (label+icon) + input
   ============================================================ */
.cfd-mount-width-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid #dfe7ee;
    background: #fafcfe;
    border-radius: 6px;
    max-width: 320px;
    margin: 0 auto;
}
.cfd-mgw-item {
    display: inline-flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
}
.cfd-mgw-item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: #D75E3E;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px 0 0 3px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    min-width: 74px;
    height: 33px;
    box-sizing: border-box;
}
.cfd-mgw-item span svg {
    flex-shrink: 0;
    stroke: #fff;
}
.cfd-mgw-item input[type="number"] {
    width: 50px !important;
    height: 33px !important;
    font-size: 0.82rem !important;
    text-align: center !important;
    padding: 0 2px !important;
    border: 1px solid #d0d6de !important;
    border-left: none !important;
    border-radius: 0 3px 3px 0 !important;
    background: #fff !important;
    box-sizing: border-box !important;
}
.cfd-mgw-left   { grid-column: 1; grid-row: 1; }
.cfd-mgw-right  { grid-column: 2; grid-row: 1; }
.cfd-mgw-top    { grid-column: 1; grid-row: 2; }
.cfd-mgw-bottom { grid-column: 2; grid-row: 2; }
.cfd-mgw-unit {
    grid-column: 1; grid-row: 3;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    background: #D75E3E;
    padding: 2px 8px;
    border-radius: 3px;
    height: 33px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    box-sizing: border-box;
}
.cfd-mgw-link {
    grid-column: 2; grid-row: 3;
    background: #fff;
    border: 1px solid #d0d8e0;
    border-radius: 99px;
    padding: 2px 10px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    justify-self: end;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.cfd-mgw-link:hover {
    background: #eef3f7;
}
.cfd-mgw-link.is-linked {
    background: #D75E3E;
    border-color: #D75E3E;
    color: #fff;
}
.cfd-mgw-link.is-linked:hover {
    background: #bd4d31;
    border-color: #bd4d31;
}

/* Preset row — inline pills */
.cfd-preset-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
}
.cfd-preset-row .cfd-preset-btn {
    font-size: 0.68rem;
    padding: 2px 10px;
    background: #eff3f7;
    border: 1px solid #dce4ec;
    border-radius: 99px;
    color: #555;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.12s;
}
.cfd-preset-row .cfd-preset-btn:hover {
    background: #e2e8ef;
}
.cfd-preset-row .cfd-preset-btn[data-preset].is-active,
.cfd-preset-row .cfd-preset-btn[data-preset].is-active:hover {
    background: #D75E3E;
    border-color: #D75E3E;
    color: #fff;
}
.cfd-preset-row .cfd-preset-btn[data-preset]:disabled {
    background: #f4f5f6;
    border-color: #e1e4e7;
    color: #a3a8ad;
    cursor: not-allowed;
    opacity: 0.72;
}

/* Bevel single width */
.cfd-bevel-width-single {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0;
}
.cfd-bevel-width-single input[type="number"] {
    width: 60px !important;
    font-size: 0.85rem !important;
    text-align: center !important;
    padding: 4px 6px !important;
    border: 1px solid #d0d6de !important;
    border-radius: 4px !important;
}
.cfd-bevel-width-hint {
    font-size: 0.65rem;
    color: #999;
}

/* Compact mount colors grid — 3 cols, small swatches, slug only */
.cfd-mount-colors--compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-width: 320px;
}
.cfd-color-card--compact .cfd-color-swatch {
    width: 28px;
    height: 28px;
}
.cfd-color-card--compact img {
    width: 28px;
    height: 28px;
    object-fit: cover;
}
.cfd-color-card--compact .cfd-color-name {
    display: block;
    text-align: center;
    font-size: 0.62rem;
    font-weight: 600;
    color: #555;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cfd-color-card--compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 6px 4px;
    border: 1px solid #e0e6ec;
    background: #fff;
    transition: border-color 0.15s;
}
.cfd-color-card--compact.selected {
    border-color: #D75E3E;
    box-shadow: 0 0 0 2px rgba(215,94,62,0.15);
}
.cfd-color-card--compact input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Shared metric / imperial selector */
.cfd-unit-select {
    appearance: auto;
    width: auto;
    min-width: 62px;
    height: 28px;
    margin: 0;
    padding: 3px 24px 3px 8px;
    border: 1px solid #d6dde3;
    border-radius: 4px;
    background: #fff;
    color: #59636d;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.cfd-unit-select--toolbar {
    flex: 0 0 auto;
    margin-left: auto;
    min-width: 56px;
    height: 25px;
    padding-top: 2px;
    padding-bottom: 2px;
    font-size: 10px;
}

@media (max-width: 720px) {
    .cfd-unit-select--toolbar {
        min-width: 54px;
        height: 24px;
    }
}

.cfd-mount-size-simple {
    display: grid;
    gap: 18px;
}

.cfd-mount-size-section {
    border-bottom: 1px solid #e2e6e9;
    padding-bottom: 18px;
}

.cfd-mount-size-section .cfd-field-group-dimension {
    margin-bottom: 0;
}

.cfd-mount-size-section .cfd-dimensions-section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 12px;
}

.cfd-mount-size-section .cfd-dimensions-section-heading > small {
    grid-column: 1 / -1;
}

.cfd-mount-size-section em {
    color: #7a838c;
    font-size: .8em;
    font-style: normal;
    font-weight: 600;
}

.cfd-update-mount-size-btn {
    appearance: none;
    width: 100%;
    border: 0;
    border-radius: 4px;
    background: var(--cfd-accent, #dc5b3e);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    letter-spacing: .04em;
    padding: 13px 18px;
    text-transform: uppercase;
}

.cfd-mount-size-error {
    margin: -8px 0 0;
    color: #a52b1d;
    font-size: 13px;
}

.cfd-mount-size-error[hidden] {
    display: none;
}

.cfd-color-name {
    font-size: 0.68rem;
    color: #333;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.cfd-colors-empty {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 0;
    background: #f6f8fa;
    border: 1px dashed #c7d0d9;
    color: #52606d;
    font-size: 0.82rem;
}

@media (max-width: 768px) {
    .cfd-colors-toolbar {
        grid-template-columns: 1fr;
    }
}

/* === Mount Width Editor: Compass Layout === */
/* ============================================================
   Mount Tabs
   ============================================================ */
.cfd-mount-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 18px;
    border-bottom: 2px solid #dfe7ee;
}
.cfd-mount-tab {
    padding: 8px 18px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: #888;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.cfd-mount-tab:hover {
    color: #555;
}
.cfd-mount-tab--active {
    color: #D75E3E;
    border-bottom-color: #D75E3E;
}
.cfd-mount-tab-content {
    display: block;
}
.cfd-mount-tab-content[style*="display:none"],
.cfd-mount-tab-content[style*="display: none"] {
    display: none !important;
}

/* Bevel editor variant — slightly tighter */
.cfd-mount-width-editor--bevel {
    padding: 12px;
    gap: 8px;
    background: #f7fafc;
}

.cfd-mount-width-editor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fb 100%);
    border: 1px solid #dfe7ee;
}

.cfd-mwe-top,
.cfd-mwe-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.cfd-mwe-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
}

.cfd-mwe-middle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.cfd-mwe-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

/* Live diagram preview */
.cfd-mwe-diagram {
    flex: 1;
    min-width: 130px;
    max-width: 220px;
    min-height: 100px;
    background: #c8c8c8;
    border: 2px solid rgba(0,0,0,0.12);
    border-radius: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: background-color 0.3s ease;
}

.cfd-mwe-artwork {
    position: absolute;
    top: 20px;
    right: 20px;
    bottom: 20px;
    left: 20px;
    background: #f0f4f8;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    transition: top 0.2s ease, right 0.2s ease, bottom 0.2s ease, left 0.2s ease;
}

.cfd-mwe-bottom-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Number Stepper */
.cfd-num-stepper {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #d0d5db;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

/* Vertical stepper (for Left / Right sides) */
.cfd-num-stepper--vert {
    flex-direction: column;
    border-radius: 0;
}

.cfd-num-stepper--vert .cfd-num-unit {
    border-left: none;
    border-top: 1.5px solid #e4e7eb;
    width: 100%;
    justify-content: center;
    padding: 2px 0 4px;
    height: auto;
}

.cfd-num-stepper--vert .cfd-num-dec,
.cfd-num-stepper--vert .cfd-num-inc {
    width: 100%;
    height: 26px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #e4e7eb;
}

.cfd-num-stepper--vert .cfd-num-inc {
    border-bottom: 1px solid #e4e7eb;
}

.cfd-num-stepper--vert .cfd-num-dec {
    border-top: 1px solid #e4e7eb;
    border-bottom: none;
}

.cfd-num-stepper--vert input[type="number"] {
    width: 46px;
    border: none;
    border-top: 1px solid #e4e7eb;
    border-bottom: 1px solid #e4e7eb;
    border-left: none;
    border-right: none;
    border-radius: 0;
}

.cfd-num-dec,
.cfd-num-inc {
    width: 30px;
    height: 34px;
    border: none;
    background: #f7f8fa;
    cursor: pointer;
    font-size: 1rem;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    user-select: none;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
}

.cfd-num-dec:hover,
.cfd-num-inc:hover {
    background: #e9ecef;
    color: #222;
}

.cfd-num-stepper input[type="number"] {
    width: 48px;
    height: 34px;
    border: none;
    border-left: 1.5px solid #e4e7eb;
    border-right: 1.5px solid #e4e7eb;
    text-align: center;
    font-size: 0.9rem;
    color: #222;
    font-weight: 600;
    padding: 0 2px;
    -moz-appearance: textfield;
    background: #fff;
}

.cfd-num-stepper input[type="number"]::-webkit-inner-spin-button,
.cfd-num-stepper input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cfd-num-unit {
    font-size: 0.72rem;
    color: #999;
    padding: 0 7px;
    background: #f7f8fa;
    height: 34px;
    display: flex;
    align-items: center;
    border-left: 1.5px solid #e4e7eb;
    flex-shrink: 0;
}

/* Link sides button */
.cfd-link-sides-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border: 2px solid #d0d5db;
    border-radius: 0;
    background: #fff;
    cursor: pointer;
    font-size: 0.78rem;
    color: #666;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.cfd-link-sides-btn:hover {
    border-color: #0073aa;
    color: #0073aa;
    background: #f0f7ff;
}

.cfd-link-sides-btn.is-linked {
    border-color: #2f855a;
    background: #f0fff4;
    color: #2f855a;
}

/* Quick Presets */
.cfd-presets {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e4ebf0;
}

.cfd-presets h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.cfd-preset-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cfd-preset-btn {
    padding: 8px 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
    border: 1.5px solid #d0d5db;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.82rem;
    color: #555;
}

.cfd-preset-btn:hover {
    background: #e9ecef;
    border-color: #0073aa;
    color: #0073aa;
}

/* ===== Step 5: Options ===== */
.cfd-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.cfd-option-card {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    border: 1px solid #dde6ee;
    border-radius: 0;
    overflow: hidden;
    transition: all 0.2s ease;
}

.cfd-option-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 14px;
}

.cfd-option-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 2px 0 0 0;
    border: 2px solid #adb5bd;
    border-radius: 0;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
    flex-shrink: 0;
}

.cfd-option-label input[type="checkbox"]:checked {
    background: #d75e3e;
    border-color: #d75e3e;
}

.cfd-option-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 6px;
    height: 10px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.cfd-option-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    gap: 5px;
}

.cfd-option-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 4px;
    gap: 6px;
}

.cfd-option-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 4px;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.cfd-option-name {
    font-weight: 600;
    color: #333;
    font-size: 0.84rem;
    flex: 1;
    min-width: 0;
}

.cfd-option-price {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: max-content;
    max-width: 100%;
    flex-shrink: 0;
    white-space: nowrap;
    background: #efc0b2;
    color: #9f3f25;
    padding: 2px 6px;
    border-radius: 0;
    font-size: 0.72rem;
    font-weight: 600;
}

.cfd-option-description {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.3;
}

.cfd-option-card.selected {
    background: linear-gradient(135deg, #fae3db 0%, #fff2ed 100%);
    border-color: #d75e3e;
    box-shadow: 0 0 0 3px rgba(215, 94, 62, 0.12);
}

.cfd-option-card.selected .cfd-option-price {
    background: linear-gradient(135deg, #d75e3e 0%, #c24d2f 100%);
    color: #fff;
}

/* ===== Step 6: Review ===== */
.cfd-review-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cfd-review-section {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    padding: 10px 12px;
    border-radius: 0;
    border: 1px solid #dde6ee;
}

.cfd-review-section h3 {
    font-size: 0.86rem;
    color: #333;
    margin-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 4px;
}

/* Collapsible review sections */
.cfd-collapse-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0 0 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    font: inherit;
    text-align: left;
}
.cfd-collapse-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: #333;
}
.cfd-collapse-chevron {
    flex-shrink: 0;
    color: #888;
    transition: transform 0.2s ease;
}
.cfd-collapsible:not(.is-open) .cfd-collapse-chevron {
    transform: rotate(-90deg);
}
.cfd-collapsible:not(.is-open) .cfd-review-section-body {
    display: none;
}

/* Frame Express-style summary */
.cfd-review-internal-size {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fb 100%);
    border: 1px solid #dde6ee;
}
.cfd-review-internal-visual {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f5f8;
    border: 1px solid #e2e8ef;
    overflow: hidden;
}
.cfd-review-frame-chevron {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.cfd-review-internal-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cfd-review-internal-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cfd-review-internal-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #222;
}

/* Comes Complete With rows */
.cfd-review-components {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cfd-review-component-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 3px 0;
    font-size: 0.78rem;
    border-bottom: 1px dashed #e6ebf0;
}
.cfd-review-component-row:last-child {
    border-bottom: none;
}
.cfd-review-component-label {
    color: #555;
    font-weight: 500;
}
.cfd-review-component-price {
    color: #333;
    font-weight: 600;
}

/* Top/Base mount blocks */
.cfd-review-mount-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.cfd-review-mount-visual {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f5f8;
    border: 1px solid #e2e8ef;
    overflow: hidden;
}
.cfd-review-mount-swatch {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    width: 100%;
    height: 100%;
}
.cfd-review-mount-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.cfd-review-mount-details .cfd-review-item {
    padding: 1px 0;
}
.cfd-review-mount-total {
    flex-shrink: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #d75e3e;
    padding-top: 2px;
}

.cfd-review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 4px 12px;
}

.cfd-review-item {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 0;
}

.cfd-review-label {
    font-size: 0.7rem;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.cfd-review-value {
    font-size: 0.78rem;
    color: #333;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.cfd-aperture-display {
    text-align: center;
    padding: 18px;
    background: linear-gradient(135deg, #d75e3e 0%, #c24d2f 100%);
    color: white;
    border-radius: 0;
}

.cfd-aperture-value {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 4px;
}

.cfd-aperture-label {
    display: block;
    font-size: 0.82rem;
    opacity: 0.9;
}

.cfd-review-options {
    list-style: none;
    padding: 0;
}

.cfd-review-options li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.88rem;
}

.cfd-review-options li:last-child {
    border-bottom: none;
}

.cfd-no-options {
    color: #999;
    font-style: italic;
}

/* ===== Vertical Compact (no header) ===== */
.cfd-layout-vertical-compact {
    padding-top: 0 !important;
}
.cfd-layout-vertical-compact .cfd-header {
    display: none;
}

/* ===== Vertical Layout Variant ===== */
.cfd-layout-vertical .cfd-content-wrapper-vertical {
    display: grid;
    grid-template-columns: minmax(140px, 0.8fr) minmax(0, 1.8fr) minmax(350px, 1.5fr);
    gap: 16px;
    align-items: start;
}

/* Render order in vertical: Sidebar (left) | Preview/Canvas (center) | Controls/Form (right) */
.cfd-layout-vertical .cfd-vertical-steps-wrapper {
    display: block;
    order: 0;
    min-width: 0;
}

.cfd-layout-vertical .cfd-preview-panel {
    order: 1;
    min-width: 0;
}

.cfd-layout-vertical .cfd-controls-panel-vertical {
    order: 2;
    min-width: 0;
}

.cfd-vertical-steps {
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 0;
    position: sticky;
    top: 0;
    align-self: start;
    /* No max-height: grow with content so the review actions are never
       clipped by an internal scroll (client feedback). */
    overflow: visible;
}

.cfd-vertical-steps .sidebar-step {
    border-bottom: 1px solid #edf0f3;
}

.cfd-vertical-steps .sidebar-step:last-child {
    border-bottom: none;
}

.cfd-vertical-steps .step-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    background: #fff;
    padding: 12px 12px;
    cursor: pointer;
    text-align: left;
    font-family: 'Montserrat', 'Open Sans', Arial, sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: #353740;
    outline: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
}

.cfd-vertical-steps .step-header:focus,
.cfd-vertical-steps .step-header:focus-visible,
.cfd-vertical-steps .step-header:active {
    outline: none;
    box-shadow: none;
}

.cfd-vertical-steps .step-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cfd-vertical-steps .step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    background: #9aa5b1;
}

.cfd-vertical-steps .step-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1f2933;
}

.cfd-vertical-steps .step-toggle-icon {
    color: #8291a2;
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 700;
}

.cfd-vertical-steps .step-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 12px;
    transition: max-height 0.25s ease, padding 0.25s ease;
}

.cfd-vertical-steps .step-content p {
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.77rem;
    line-height: 1.45;
    color: #52606d;
    padding: 2px 0 0;
}

.cfd-vertical-steps .step-content p::before {
    content: '';
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 1px;
    border-radius: 0;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M7.5 5L12.5 10L7.5 15' stroke='%23d75e3e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px 12px no-repeat,
        rgba(255,255,255,0.72);
    box-shadow: inset 0 0 0 1px rgba(215,94,62,0.16);
}

.cfd-vertical-steps .sidebar-step.active .step-header {
    background: linear-gradient(135deg, #fae3db 0%, #fff2ed 100%);
    border-bottom: 0;
    box-shadow: none;
}

.cfd-vertical-steps .sidebar-step.active .step-number {
    background: #D75E3E;
}

.cfd-vertical-steps .sidebar-step.active .step-toggle-icon {
    color: #D75E3E;
}

.cfd-vertical-steps .sidebar-step.active .step-content {
    max-height: 80px;
    padding: 6px 12px 14px;
    background: linear-gradient(135deg, #fae3db 0%, #fff2ed 100%);
}

.cfd-vertical-steps .sidebar-step.active {
    background: linear-gradient(135deg, #fae3db 0%, #fff2ed 100%);
    border-bottom-color: transparent;
    overflow: hidden;
}

.cfd-layout-vertical .cfd-controls-panel-vertical {
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 0;
    padding: 14px;
    position: sticky;
    top: 0;
    align-self: start;
    /* No max-height: the panel must grow with its content so the
       Add to Cart button is reachable with normal page scroll
       (client feedback — previously clipped by the internal scroll). */
    overflow: visible;
}

/* ponytail: stick the grid item itself; its canvas has no scroll room
   inside a content-height parent. Mobile keeps its existing preview drawer. */
@media (min-width: 1181px) {
    .cfd-layout-vertical .cfd-content-wrapper-vertical > .cfd-preview-panel {
        --cfd-preview-top: 12px;
        position: sticky;
        top: var(--cfd-preview-top);
        align-self: start;
        max-height: calc(100dvh - var(--cfd-preview-top) - 12px);
        overflow-y: auto;
        z-index: 5;
    }

    body.admin-bar .cfd-layout-vertical .cfd-content-wrapper-vertical > .cfd-preview-panel {
        --cfd-preview-top: 44px;
    }

    .cfd-layout-vertical .cfd-content-wrapper-vertical > .cfd-preview-panel .cfd-canvas-container {
        position: relative;
    }

    .cfd-layout-vertical .cfd-content-wrapper-vertical > .cfd-preview-panel :is(.cfd-canvas-2d, .cfd-canvas-chevron, #cfd-canvas-3d) {
        height: clamp(180px, calc(100dvh - var(--cfd-preview-top) - 180px), 600px);
    }
}

.cfd-layout-vertical .cfd-navigation-vertical {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Mobile topbar - hidden on desktop */
.cfd-mobile-topbar {
    display: none;
}

.cfd-mobile-drawer-backdrop,
.cfd-mobile-preview-floating-close,
.cfd-mobile-drawer-header,
.cfd-mobile-preview-header,
.cfd-mobile-drawer-footer {
    display: none;
}

/* Form modal - hidden by default */
.cfd-form-modal {
    display: none;
}

/* Tablet and mobile: keep every part of the designer in the page flow. */
@media (max-width: 1180px) {
    .cfd-mobile-topbar {
        display: none;
    }

    .cfd-mobile-step-info {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .cfd-step-header-num {
        font-weight: 700;
        color: #2f855a;
        font-size: 0.85rem;
    }

    .cfd-step-header-title {
        font-weight: 600;
        color: #333;
        font-size: 0.85rem;
    }

    .cfd-mobile-topbar-actions {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .cfd-step-dropdown {
        padding: 6px 10px;
        border: 1px solid #ccc;
        border-radius: 0;
        font-size: 0.85rem;
        background: #fff;
        cursor: pointer;
    }

    .cfd-hamburger-btn {
        background: none;
        border: none;
        font-size: 1.4rem;
        cursor: pointer;
        padding: 4px 8px;
        color: #333;
    }

    /* The desktop sidebar becomes a full-width step rail instead of disappearing. */
    .cfd-layout-vertical .cfd-vertical-steps-wrapper {
        display: block;
        order: 0;
        width: 100%;
        min-width: 0;
    }

    .cfd-layout-vertical .cfd-vertical-steps {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        max-height: none;
        overflow: visible;
    }

    .cfd-layout-vertical .cfd-vertical-steps .sidebar-step {
        min-width: 0;
        border-right: 1px solid #edf0f3;
    }

    .cfd-layout-vertical .cfd-content-wrapper-vertical {
        grid-template-columns: 1fr;
        width: 100%;
        min-width: 0;
    }

    .cfd-layout-vertical .cfd-preview-panel {
        order: 1;
        width: 100%;
        min-width: 0;
    }

    .cfd-layout-vertical .cfd-controls-panel-vertical {
        display: flex;
        order: 2;
        position: static;
        width: 100%;
        max-height: none;
        overflow: visible;
    }

    .cfd-layout-vertical .cfd-preview-panel .cfd-canvas-container {
        position: static;
        max-height: none;
        overflow: visible;
    }

    /* Form modal for tablet - centered overlay */
    .cfd-form-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99999;
        flex-direction: column;
        align-items: center;
        padding-top: 40px;
    }

    .cfd-form-modal.active {
        display: flex;
    }

    .cfd-form-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        background: #fff;
        border-bottom: 1px solid #e0e0e0;
        width: 90%;
        max-width: 500px;
        border-radius: 0;
    }

    .cfd-form-modal-title {
        font-weight: 600;
        font-size: 1rem;
    }

    .cfd-form-modal-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: #666;
        padding: 0;
        line-height: 1;
    }

    .cfd-form-modal-content {
        background: #fff;
        padding: 16px;
        overflow-y: auto;
        flex: 1;
        width: 90%;
        max-width: 500px;
        max-height: 70vh;
        border-radius: 0;
    }

    /* Make nav buttons narrower on tablet */
    .cfd-nav-buttons {
        flex-wrap: wrap;
        width: 62%;
    }

    .cfd-nav-buttons .cfd-button {
        flex: 1;
        min-width: 80px;
    }
}

/* Mobile-specific: form modal full screen */
@media (max-width: 768px) {
    .cfd-container {
        padding: 8px;
    }

    .cfd-layout-vertical .cfd-content-wrapper-vertical {
        gap: 10px;
    }

    .cfd-layout-vertical .cfd-vertical-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cfd-layout-vertical .cfd-preview-panel {
        order: 1;
    }

    .cfd-layout-vertical .cfd-controls-panel-vertical {
        order: 2;
        padding: 10px;
    }

    .cfd-layout-vertical .cfd-canvas-container {
        padding: 8px;
    }

    .cfd-layout-vertical .cfd-canvas-2d,
    .cfd-layout-vertical .cfd-canvas-chevron,
    .cfd-layout-vertical #cfd-canvas-3d {
        height: clamp(300px, 72vw, 500px) !important;
        max-height: 500px;
    }

    /* Mobile: 2D and chevron canvases inherit normal visibility from parent rules */

    .cfd-layout-vertical .cfd-nav-buttons {
        width: 100%;
    }

    .cfd-layout-vertical .cfd-nav-buttons .cfd-button {
        width: auto;
        min-width: 0;
        flex: 1 1 0;
    }

    .cfd-form-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99999;
        flex-direction: column;
    }

    .cfd-form-modal.active {
        display: flex;
    }

    .cfd-form-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        background: #fff;
        border-bottom: 1px solid #e0e0e0;
    }

    .cfd-form-modal-title {
        font-weight: 600;
        font-size: 1rem;
    }

    .cfd-form-modal-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: #666;
        padding: 0;
        line-height: 1;
    }

    .cfd-form-modal-content {
        background: #fff;
        padding: 16px;
        overflow-y: auto;
        flex: 1;
        max-height: calc(100vh - 60px);
    }

    /* Mobile toolbar - ensure all controls are visible and compact */
    .cfd-preview-toolbar {
        flex-wrap: wrap;
        gap: 6px;
        padding: 6px 8px;
    }

    .cfd-preview-mode-cluster {
        gap: 6px;
    }

    .cfd-preview-mode-toggle {
        display: flex !important;
    }

    .cfd-preview-mode-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .cfd-zoom-level {
        font-size: 0.7rem;
        padding: 4px 6px;
        min-width: 17px;
    }

    .cfd-nav-buttons {
        gap: 6px;
    }

    .cfd-nav-buttons .cfd-button {
        padding: 6px 10px;
        font-size: 0.75rem;
        min-width: 60px;
    }
}

.cfd-price-breakdown-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cfd-review-notes {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 12px;
    border-radius: 0;
}

.cfd-admin-price-debug {
    margin-top: 14px;
    padding: 14px 16px;
    background: #fff3b8;
    border: 1px solid #e0b100;
    color: #5f4700;
    border-radius: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.cfd-admin-price-debug h4 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #6e5200;
}

.cfd-admin-price-debug-body {
    font-size: 0.8rem;
    line-height: 1.45;
}

.cfd-admin-price-debug-body p {
    margin: 0 0 6px;
}

.cfd-admin-price-debug-body hr {
    margin: 10px 0;
    border: 0;
    border-top: 1px solid rgba(95, 71, 0, 0.18);
}

.cfd-review-notes h4 {
    color: #856404;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.cfd-notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cfd-notes-list li {
    padding: 4px 0;
    color: #856404;
    padding-left: 25px;
    position: relative;
    font-size: 0.82rem;
}

.cfd-notes-list li::before {
    content: '⚠';
    position: absolute;
    left: 0;
}

.cfd-review-terms {
    margin-top: 10px;
}

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

.cfd-terms-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.cfd-terms-label span {
    color: #333;
    line-height: 1.35;
    font-size: 0.86rem;
}

.cfd-review-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* ===== Messages ===== */
.cfd-message {
    padding: 15px 20px;
    border-radius: 0;
    margin: 20px 0;
    font-weight: 500;
}

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

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

.cfd-step-note {
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    padding: 10px 14px;
    margin-top: 15px;
    border-radius: 0;
}

.cfd-step-note-soft {
    margin: 0 18px 18px;
    border-left: 0;
    border: 1px solid #d8e8f7;
    border-radius: 0;
    background: linear-gradient(135deg, #edf6ff 0%, #f8fbff 100%);
    padding: 14px 16px;
}

/* Step 5 (Options): blue text box matches the width of the surfaces above
   and keeps a small gap from them (client feedback, same as Step 1). */
.cfd-step-options .cfd-step-note-soft {
    margin: 18px 0 0;
}

.cfd-step-note p {
    margin: 0;
    color: #0d47a1;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .cfd-header h1 {
        font-size: 1.5rem;
    }

    .cfd-progress {
        flex-wrap: wrap;
        gap: 4px;
    }

    .cfd-progress-step:not(:last-child)::after {
        display: none;
    }

    .cfd-step-label {
        display: none;
    }

    .cfd-content-wrapper {
        grid-template-columns: 1fr;
    }

    .cfd-preview-panel {
        position: static;
        order: -1;
    }

    .cfd-navigation {
        flex-direction: column;
    }

    .cfd-preview-toolbar {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .cfd-preview-mode-cluster {
        width: 100%;
        justify-content: flex-start;
    }

    .cfd-button {
        width: 100%;
    }

    .cfd-materials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cfd-mounting-styles {
        grid-template-columns: 1fr;
    }

    .cfd-options-grid {
        grid-template-columns: 1fr;
    }

    .cfd-dimensions-shell {
        padding: 0 14px;
    }

    .cfd-dimensions-hero {
        padding: 14px 14px 0;
    }

    .cfd-dimension-presets,
    .cfd-dimensions-summary-grid {
        grid-template-columns: 1fr;
    }

    .cfd-step-note-soft {
        margin: 0 14px 14px;
    }
}

/* Hidden utility class for toggle visibility */
.cfd-hidden {
    display: none;
}

/* ===== Modal Styles ===== */
.cfd-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

.cfd-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cfd-modal-content {
    position: relative;
    background: #fff;
    border-radius: 0;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.10);
    transform: translateZ(0);
    isolation: isolate;
    z-index: 1;
}

.cfd-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.cfd-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #353740;
}

.cfd-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: background 0.2s;
}

.cfd-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.cfd-modal-body {
    padding: 24px;
}

.cfd-modal-intro {
    color: #6b7280;
    margin: 0 0 20px;
}

/* Shapes modal grid */
.cfd-shapes-grid {
    display: none; /* Use carousel instead */
}

/* View Shapes button */
.cfd-view-shapes-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 6px 14px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.cfd-view-shapes-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* Chevron expand button on material card */
.cfd-material-preview-wrap {
    position: relative;
    display: block;
}

.cfd-chevron-expand {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.cfd-material-preview-wrap:hover .cfd-chevron-expand {
    opacity: 1;
}

.cfd-chevron-expand svg {
    width: 14px;
    height: 14px;
    color: #374151;
}

.cfd-chevron-expand img {
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
}

.cfd-cross-section-expand {
    padding: 0;
    overflow: hidden;
    background: #dc5d3d;
    border-color: #dc5d3d;
}

/* Chevron modal */
.cfd-chevron-modal .cfd-modal-content {
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.cfd-chevron-modal .cfd-modal-body {
    padding: 15px;
}

.cfd-chevron-modal-layout,
.cfd-chevron-image-container,
.cfd-chevron-image-wrapper {
    position: relative;
}

.cfd-chevron-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
}

.cfd-chevron-img-secondary {
    display: none !important;
}

.cfd-chevron-img-active {
    display: block !important;
}

.cfd-chevron-view-toggle {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 12px auto 0;
    max-width: 420px;
}

.cfd-chevron-variants {
    margin: 16px 0 0;
}

.cfd-chevron-variants-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #4b5563;
    margin-bottom: 8px;
}

.cfd-chevron-variants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cfd-chevron-variant-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cfd-chevron-variant-btn:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.cfd-chevron-variant-btn.is-active {
    border-color: #1d4ed8;
    background: #eff6ff;
    color: #1d4ed8;
}

.cfd-chevron-view-toggle[style*="display: block"] {
    display: grid !important;
}

.cfd-chevron-view-toggle .cfd-btn-view {
    min-width: 0;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #353740;
    font-weight: 700;
    cursor: pointer;
}

.cfd-chevron-view-toggle .cfd-btn-view.active {
    border-color: #D75E3E;
    background: #D75E3E;
    color: #fff;
}

.cfd-chevron-image-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cfd-chevron-modal .cfd-chevron-full {
    max-width: 100%;
    max-height: 55vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

/* Chevron info card overlay */
.cfd-chevron-info-card {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.97);
    border-radius: 16px;
    padding: 20px 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 320px;
    max-width: 90%;
    backdrop-filter: blur(10px);
}

.cfd-chevron-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.cfd-chevron-card-code {
    font-size: 1.1rem;
    font-weight: 800;
    color: #353740;
    font-family: 'Montserrat', sans-serif;
}

.cfd-chevron-card-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
}

/* Large swatch below details */
.cfd-chevron-card-swatch-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 15px auto 0;
    border: 2px solid #e5e7eb;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.cfd-chevron-card-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 20px;
}

.cfd-chevron-card-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cfd-chevron-card-detail-section {
    grid-column: 1 / -1;
}

.cfd-chevron-card-detail-profile {
    gap: 6px;
    align-self: stretch;
}

.cfd-chevron-card-label {
    font-size: 0.65rem;
    color: #9ca3af;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.cfd-chevron-card-value {
    font-size: 0.95rem;
    color: #353740;
    font-weight: 600;
}

.cfd-chevron-card-section-value {
    display: block;
    margin-top: 6px;
}

.cfd-chevron-section-canvas {
    display: block;
    width: 100%;
    max-width: 180px;
    height: 88px;
    background: #f8fafc;
    border: 1px solid #dbe4ec;
    border-radius: 10px;
}

.cfd-chevron-card-value.price {
    color: #D75E3E;
    font-size: 1.1rem;
}

/* Chevron swatch circle */
.cfd-chevron-swatch-circle {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    background-size: cover;
    background-position: center;
    z-index: 5;
}

/* Shapes modal - larger content */
.cfd-shapes-modal-content {
    max-width: 1000px;
}

/* Shapes modal filter */
.cfd-shapes-filter {
    margin-bottom: 20px;
}

.cfd-shapes-filter select {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
    min-width: 150px;
}

.cfd-shapes-filter select:focus {
    outline: none;
    border-color: #D75E3E;
}

/* Carousel styles */
.cfd-shapes-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.cfd-carousel-track {
    display: flex;
    overflow: hidden;
    flex: 1;
    justify-content: center;
}

.cfd-carousel-slide {
    flex: 0 0 100%;
    text-align: center;
    padding: 10px;
    display: none;
}

.cfd-carousel-slide.active {
    display: block;
}

.cfd-carousel-image {
    background: #f9fafb;
    border-radius: 16px;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    margin-bottom: 15px;
}

.cfd-carousel-image img {
    max-width: 100%;
    max-height: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.cfd-carousel-caption {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cfd-carousel-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #353740;
}

.cfd-carousel-code {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Carousel navigation buttons */
.cfd-carousel-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e5e7eb;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #353740;
}

.cfd-carousel-btn:hover {
    background: #D75E3E;
    border-color: #D75E3E;
    color: #fff;
}

/* Carousel indicators */
.cfd-carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.cfd-carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    cursor: pointer;
    transition: all 0.2s;
}

.cfd-carousel-indicator.active {
    background: #D75E3E;
    width: 24px;
    border-radius: 4px;
}

.cfd-carousel-indicator:hover {
    background: #9ca3af;
}

/* ===== Vertical layout: mobile step indicator + preview drawer ===== */
@media (max-width: 1180px) {
    body.cfd-mobile-preview-open {
        overflow: hidden;
    }

    .cfd-layout-vertical .cfd-mobile-topbar {
        position: sticky;
        top: 0;
        z-index: 50;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        padding: 9px 10px;
        box-sizing: border-box;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid #e2e6ea;
        box-shadow: 0 3px 12px rgba(31, 41, 51, 0.08);
    }

    .cfd-layout-vertical .cfd-mobile-step-info {
        min-width: 0;
        flex: 1 1 auto;
    }

    .cfd-layout-vertical .cfd-step-header-num,
    .cfd-layout-vertical .cfd-step-header-title {
        white-space: nowrap;
    }

    .cfd-layout-vertical .cfd-step-header-title {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cfd-layout-vertical .cfd-hamburger-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        flex: 0 0 auto;
        min-height: 40px;
        padding: 7px 11px;
        border: 1px solid #D75E3E;
        background: #D75E3E;
        color: #fff;
        font-family: inherit;
        font-size: 0.82rem;
        font-weight: 700;
    }

    .cfd-layout-vertical .cfd-vertical-steps-wrapper {
        display: none;
    }

    .cfd-layout-vertical .cfd-content-wrapper-vertical {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        min-width: 0;
    }

    .cfd-layout-vertical .cfd-controls-panel-vertical {
        position: static;
        z-index: auto;
        display: flex;
        order: 1;
        width: 100%;
        min-width: 0;
        height: auto;
        max-height: none;
        padding: 14px 14px calc(82px + env(safe-area-inset-bottom));
        overflow: visible;
        box-shadow: none;
        transform: none;
        visibility: visible;
    }

    .cfd-layout-vertical .cfd-controls-panel-vertical > .step-section {
        padding: 0;
    }

    .cfd-layout-vertical .cfd-preview-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 100001;
        display: flex;
        order: 2;
        width: min(96vw, 680px);
        min-width: 0;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        padding: calc(12px + env(safe-area-inset-top)) 12px 12px;
        box-sizing: border-box;
        overflow-x: hidden;
        overflow-y: auto;
        background: #fff;
        box-shadow: -16px 0 40px rgba(31, 41, 51, 0.2);
        transform: translateX(105%);
        visibility: hidden;
        transition: transform 0.25s ease, visibility 0.25s ease;
    }

    .cfd-layout-vertical .cfd-preview-panel.is-mobile-open {
        transform: translateX(0);
        visibility: visible;
    }

    .cfd-layout-vertical .cfd-preview-panel .cfd-canvas-container {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .cfd-mobile-drawer-backdrop {
        position: fixed;
        inset: 0;
        z-index: 100000;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(20, 27, 35, 0.55);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .cfd-mobile-drawer-backdrop.is-mobile-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .cfd-mobile-preview-floating-close {
        position: fixed;
        top: calc(12px + env(safe-area-inset-top));
        right: 12px;
        z-index: 100003;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        padding: 0;
        border: 2px solid #D75E3E;
        border-radius: 50%;
        background: #fff;
        color: #353740;
        box-shadow: 0 5px 18px rgba(31, 41, 51, 0.24);
        font-size: 1.8rem;
        font-weight: 700;
        line-height: 1;
        cursor: pointer;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .cfd-mobile-preview-floating-close.is-mobile-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .cfd-layout-vertical .cfd-mobile-preview-header {
        position: sticky;
        top: 0;
        z-index: 3;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        flex: 0 0 auto;
        min-height: 56px;
        padding: 10px 14px;
        box-sizing: border-box;
        border-bottom: 1px solid #e2e6ea;
        background: #fff;
    }

    .cfd-layout-vertical .cfd-mobile-drawer-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #353740;
        font-size: 1.7rem;
        line-height: 1;
        cursor: pointer;
        flex: 0 0 40px;
    }

    .cfd-layout-vertical .cfd-mobile-drawer-footer {
        position: static;
        display: block;
        margin-top: auto;
        padding: 12px 0 0;
        border-top: 1px solid #e2e6ea;
        background: #fff;
    }

    .cfd-layout-vertical .cfd-mobile-step-navigation {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 99990;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        margin: 0;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        box-sizing: border-box;
        border-top: 1px solid #e2e6ea;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 -6px 16px rgba(31, 41, 51, 0.12);
    }

    .cfd-layout-vertical .cfd-mobile-step-navigation .cfd-button {
        width: auto;
        min-width: 0;
        min-height: 42px;
        padding: 8px 10px;
    }

    .cfd-layout-vertical .cfd-mobile-step-count {
        min-width: 48px;
        text-align: center;
        color: #52606d;
        font-size: 0.82rem;
        font-weight: 700;
        white-space: nowrap;
    }

    .cfd-layout-vertical .cfd-mobile-apply-options {
        width: 100%;
        min-height: 44px;
    }

    body.admin-bar .cfd-layout-vertical .cfd-preview-panel {
        top: 32px;
        height: calc(100vh - 32px);
        height: calc(100dvh - 32px);
    }

    body.admin-bar .cfd-mobile-preview-floating-close {
        top: 44px;
    }
}

@media (max-width: 782px) {
    body.admin-bar .cfd-layout-vertical .cfd-preview-panel {
        top: 46px;
        height: calc(100vh - 46px);
        height: calc(100dvh - 46px);
    }


    body.admin-bar .cfd-mobile-preview-floating-close {
        top: 58px;
    }
}

@media (max-width: 768px) {
    #main-content .container {
        width: 95% !important;
    }

    .cfd-chevron-modal {
        align-items: flex-start;
        padding: max(12px, env(safe-area-inset-top)) 0 max(12px, env(safe-area-inset-bottom));
        box-sizing: border-box;
    }

    .cfd-chevron-modal .cfd-modal-content {
        display: flex;
        flex-direction: column;
        width: 95vw;
        max-width: 95vw;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        margin: 0 auto;
        overflow: hidden;
    }

    .cfd-chevron-modal .cfd-modal-header {
        flex: 0 0 auto;
        min-height: 58px;
        padding: 12px 62px 12px 16px;
        box-sizing: border-box;
        z-index: 10;
    }

    .cfd-chevron-modal .cfd-modal-header h3 {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        font-size: clamp(1rem, 5vw, 1.25rem);
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cfd-chevron-modal #cfd-chevron-modal-close {
        position: absolute;
        top: 8px;
        right: 10px;
        z-index: 12;
        display: inline-flex !important;
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        border: 1px solid #d9dde3;
        border-radius: 50%;
        background: #fff;
        color: #353740;
        box-shadow: 0 3px 12px rgba(31, 41, 51, 0.18);
        opacity: 1 !important;
        visibility: visible !important;
    }

    .cfd-chevron-modal .cfd-modal-body {
        flex: 1 1 auto;
        min-height: 0;
        padding: 10px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .cfd-chevron-modal-layout {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .cfd-chevron-modal .cfd-chevron-image-container {
        order: 1;
        width: 100%;
        min-height: 0;
        overflow: hidden;
        background: #f8fafc;
    }

    .cfd-chevron-modal .cfd-chevron-image-wrapper {
        min-height: 0;
        height: clamp(190px, 30dvh, 310px);
        padding: 8px;
        box-sizing: border-box;
    }

    .cfd-chevron-modal .cfd-chevron-full {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .cfd-chevron-modal .cfd-chevron-swatch-circle {
        top: 10px;
        right: 10px;
        width: 48px;
        height: 48px;
    }

    .cfd-chevron-modal .cfd-chevron-view-toggle {
        order: 2;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .cfd-chevron-modal .cfd-chevron-info-card {
        position: static;
        order: 3;
        width: 100%;
        min-width: 0;
        max-width: none;
        padding: 14px;
        box-sizing: border-box;
        transform: none;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        box-shadow: none;
    }

    .cfd-chevron-modal .cfd-chevron-card-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .cfd-chevron-modal .cfd-chevron-card-details {
        gap: 10px 14px;
    }

    .cfd-chevron-modal .cfd-chevron-card-value {
        overflow-wrap: anywhere;
        font-size: 0.88rem;
    }

    .cfd-chevron-modal .cfd-chevron-section-canvas {
        max-width: 150px;
        height: 72px;
    }

    .cfd-chevron-modal .cfd-magnifier-lens {
        display: none !important;
    }

    .cfd-material-preview-wrap .cfd-chevron-expand {
        opacity: 1;
    }

    .cfd-layout-vertical .cfd-preview-panel {
        right: 0;
        left: 0;
        width: 100vw;
        overscroll-behavior: contain;
    }

    .cfd-layout-vertical .cfd-mobile-preview-header {
        min-height: 48px;
        padding: 6px 8px;
    }

    .cfd-layout-vertical .cfd-preview-toolbar {
        flex: 0 0 auto;
        width: 100%;
        margin-bottom: 6px;
        padding: 56px 0;
        box-sizing: border-box;
    }

    .cfd-layout-vertical .cfd-preview-mode-cluster {
        display: flex !important;
        width: 100%;
        flex-wrap: wrap;
    }

    .cfd-layout-vertical #cfd-preview-mode-toggle {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        visibility: visible !important;
        width: 100%;
        flex: 1 0 100%;
        opacity: 1 !important;
    }

    .cfd-layout-vertical #cfd-preview-mode-toggle .cfd-preview-mode-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 34px;
        padding: 5px 8px;
        white-space: nowrap;
    }

    .cfd-layout-vertical #cfd-preview-mode-toggle .cfd-preview-mode-btn[data-preview-mode="chevron"] {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .cfd-layout-vertical .cfd-nav-buttons {
        display: none !important;
    }

    .cfd-layout-vertical .cfd-nav-buttons .cfd-button {
        width: auto;
        min-width: 0;
        padding: 6px 5px;
    }

    .cfd-layout-vertical .cfd-canvas-container {
        flex: 0 0 auto;
        padding: 6px;
        margin-bottom: 10px;
    }

    .cfd-layout-vertical .cfd-canvas-2d,
    .cfd-layout-vertical .cfd-canvas-chevron,
    .cfd-layout-vertical #cfd-canvas-3d {
        height: clamp(180px, 38dvh, 340px) !important;
        max-height: 340px !important;
    }

    .cfd-layout-vertical .cfd-chevron-preview-card {
        min-height: 0;
        height: 100%;
        padding: 10px;
    }

    .cfd-layout-vertical .cfd-chevron-preview-figure {
        min-height: 0;
        height: 100%;
    }

    .cfd-layout-vertical .cfd-chevron-preview-image {
        max-height: 100%;
    }

    .cfd-layout-vertical .cfd-price-box {
        margin-top: 14px;
        margin-bottom: 8px;
    }

    .cfd-layout-vertical .cfd-price-box .cfd-price-container {
        padding: 14px 16px;
        margin: 0;
        border: none;
        background: transparent;
    }

    .cfd-layout-vertical .cfd-current-price {
        padding-bottom: 8px;
        margin-bottom: 6px;
    }

    .cfd-layout-vertical .cfd-price-row {
        padding: 5px 0;
    }
}

@media (max-width: 480px) {
    .cfd-chevron-modal .cfd-chevron-image-wrapper {
        height: clamp(170px, 27dvh, 250px);
    }

    .cfd-chevron-modal .cfd-chevron-card-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px 10px;
    }

    .cfd-chevron-modal .cfd-chevron-card-code {
        font-size: 1rem;
    }

    .cfd-layout-vertical .cfd-mobile-topbar {
        padding: 7px 8px;
    }

    .cfd-layout-vertical .cfd-hamburger-btn {
        min-height: 38px;
        padding: 6px 9px;
    }

    .cfd-layout-vertical .cfd-preview-panel {
        width: 100vw;
    }

    .cfd-layout-vertical .cfd-canvas-2d,
    .cfd-layout-vertical .cfd-canvas-chevron,
    .cfd-layout-vertical #cfd-canvas-3d {
        height: clamp(170px, 34dvh, 290px) !important;
        max-height: 290px !important;
    }
}

/* Desktop frame-details modal. Keep this isolated from the mobile presentation. */
@media (min-width: 769px) {
    .cfd-chevron-modal .cfd-modal-content {
        display: flex;
        flex-direction: column;
        width: min(94vw, 1120px);
        max-width: 1120px;
        max-height: min(90vh, 860px);
        overflow: hidden;
    }

    .cfd-chevron-modal .cfd-modal-header {
        flex: 0 0 auto;
        padding: 18px 24px;
        z-index: 10;
    }

    .cfd-chevron-modal .cfd-modal-header h3 {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cfd-chevron-modal #cfd-chevron-modal-close {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        margin-left: 18px;
        border: 1px solid #d9dde3;
        border-radius: 50%;
        background: #fff;
        color: #353740;
    }

    .cfd-chevron-modal #cfd-chevron-modal-close:hover {
        border-color: #D75E3E;
        background: #fff5f2;
        color: #D75E3E;
    }

    .cfd-chevron-modal .cfd-modal-body {
        flex: 1 1 auto;
        min-height: 0;
        padding: 22px;
        overflow: auto;
    }

    .cfd-chevron-modal .cfd-chevron-modal-layout {
        display: grid;
        grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr);
        grid-template-areas:
            "image details"
            "toggle details";
        align-items: start;
        gap: 16px 22px;
        min-height: 0;
    }

    .cfd-chevron-modal .cfd-chevron-image-container {
        grid-area: image;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        min-height: 420px;
        padding: 18px;
        box-sizing: border-box;
        overflow: hidden;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        background: #f8fafc;
    }

    .cfd-chevron-modal .cfd-chevron-image-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-width: 0;
        min-height: 380px;
        max-height: 58vh;
        overflow: hidden;
        cursor: zoom-in;
    }

    .cfd-chevron-modal .cfd-chevron-full {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: min(54vh, 560px);
        object-fit: contain;
        border-radius: 10px;
    }

    .cfd-chevron-modal .cfd-chevron-view-toggle {
        grid-area: toggle;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .cfd-chevron-modal .cfd-chevron-view-toggle .cfd-btn-view {
        min-height: 46px;
        border-radius: 4px;
    }

    .cfd-chevron-modal .cfd-chevron-info-card {
        position: static;
        grid-area: details;
        width: 100%;
        min-width: 0;
        max-width: none;
        padding: 22px;
        box-sizing: border-box;
        transform: none;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
        backdrop-filter: none;
    }

    .cfd-chevron-modal .cfd-chevron-card-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 18px;
    }

    .cfd-chevron-modal .cfd-chevron-card-value {
        overflow-wrap: anywhere;
    }

    .cfd-chevron-modal .cfd-chevron-swatch-circle {
        top: 14px;
        right: 14px;
        width: 56px;
        height: 56px;
    }

    .cfd-chevron-modal .cfd-magnifier-lens {
        position: absolute;
        z-index: 20;
        display: none;
        width: 140px;
        height: 140px;
        box-sizing: border-box;
        pointer-events: none;
        border: 3px solid #fff;
        border-radius: 50%;
        background-color: #fff;
        background-repeat: no-repeat;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    }

    .cfd-chevron-modal .cfd-magnifier-lens.active {
        display: block;
    }
}

/* ===== Cart & Checkout Item Styling ===== */
.woocommerce-cart table.cart .product-thumbnail,
.woocommerce-checkout table.woocommerce-checkout-review-order-table .product-thumbnail {
    width: 95px !important;
    min-width: 90px !important;
    text-align: center;
    vertical-align: middle;
}

.cfd-cart-thumb-wrap {
    width: 85px !important;
    height: 85px !important;
    max-width: 85px !important;
    max-height: 85px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 4px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
    overflow: hidden !important;
    margin: 0 auto;
    box-sizing: border-box !important;
}

.cfd-cart-thumbnail {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    border-radius: 3px !important;
}

.woocommerce-cart table.cart .variation,
.woocommerce-checkout table.woocommerce-checkout-review-order-table .variation {
    font-size: 0.78rem !important;
    line-height: 1.4 !important;
    color: #4b5563 !important;
    margin-top: 6px !important;
    margin-bottom: 4px !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
    gap: 6px 12px !important;
    background: #f8fafc !important;
    border: 1px solid #edf2f7 !important;
    border-radius: 6px !important;
    padding: 8px 10px !important;
}

.woocommerce-cart table.cart .variation dt,
.woocommerce-checkout table.woocommerce-checkout-review-order-table .variation dt {
    font-weight: 700 !important;
    color: #1e293b !important;
    font-size: 0.72rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    margin: 0 0 2px 0 !important;
    float: none !important;
    clear: none !important;
}

.woocommerce-cart table.cart .variation dd,
.woocommerce-checkout table.woocommerce-checkout-review-order-table .variation dd {
    margin: 0 0 6px 0 !important;
    font-size: 0.78rem !important;
    color: #475569 !important;
    line-height: 1.35 !important;
}

.cfd-cart-meta-group {
    display: block;
    line-height: 1.35;
    font-size: 0.76rem;
}

.cfd-cart-pill {
    display: inline-block;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 1px 5px;
    font-family: monospace;
    font-size: 0.72rem;
    color: #334155;
    margin-right: 4px;
    margin-bottom: 2px;
}

.cfd-cart-discount-badge {
    display: inline-block;
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.76rem;
}

.cfd-cart-savings-sub {
    display: block;
    font-size: 0.74rem;
    color: #16a34a;
    font-weight: 600;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .woocommerce-cart table.cart .variation {
        grid-template-columns: 1fr !important;
    }
}

/* ── Toggle buttons glazing/backing (reemplazan visualmente a los selects) ──
   Mismo estilo que los botones de la web (.cfd-btn-view / .cfd-preview-mode-btn):
   blanco/gris inactivo, accent #D75E3E activo. */
.cfd-toggle-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.cfd-toggle-btn {
    min-width: 0;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #353740;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.3;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.cfd-toggle-btn:hover {
    border-color: #D75E3E;
    color: #D75E3E;
}
.cfd-toggle-btn.is-active {
    background: #D75E3E;
    border-color: #D75E3E;
    color: #fff;
}
.cfd-toggle-btn:focus-visible {
    outline: 2px solid #D75E3E;
    outline-offset: 2px;
}
/* Glazing & MDF Backing columns (frame build, with or without a mount):
   each field is one column of the 2-col materials toolbar grid; its two
   buttons stack full width (matches the original frame-builder layout).
   Every toggle button in this panel shares one exact size — same height,
   same per-track width — so all four are visually identical. */
.cfd-toggle-group--stacked {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;
}
#cfd-frame-designer .cfd-frame-finish-toolbar .cfd-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 40px;
    min-height: 40px;
}
#cfd-frame-designer .cfd-frame-finish-toolbar .cfd-toggle-group--stacked .cfd-toggle-btn {
    flex: 0 0 auto;
    width: 100%;
}
.cfd-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ===== Divi container fix (frame creator page) =====
   Divi's #page-container uses overflow:hidden and a fixed height, which
   clips the designer content so the Add to Cart button in the review step
   ends up below the footer and unreachable. This CSS only loads on pages
   with the [frame_designer] shortcode, so the selectors are safe. */
#page-container,
#main-content,
.et-l--body,
.et_builder_inner_content {
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

/* Keep the review actions clear of the footer: breathing room below
   the Add to Cart / Save Design buttons. */
.cfd-step-content {
    padding-bottom: 60px;
}

.cfd-review-actions {
    margin-bottom: 20px;
}

/* Shared designer controls: consistent sizes across layouts and unit choices. */
#cfd-frame-designer {
    --cfd-toolbar-control-height: 36px;
}
#cfd-frame-designer #cfd-add-to-cart {
    text-transform: uppercase;
}
#cfd-frame-designer :is(#cfd-prev-step, #cfd-reset-step, #cfd-next-step),
#cfd-frame-designer :is(.cfd-mobile-prev-step, .cfd-mobile-next-step) {
    box-sizing: border-box;
    height: var(--cfd-toolbar-control-height);
    min-height: var(--cfd-toolbar-control-height);
    width: auto;
    min-width: 0;
    max-width: 100%;
    padding: 8px 14px;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    white-space: nowrap;
}
/* View buttons size to their label ("Chevron View") so it never clips;
   the group itself never shrinks inside the toolbar. */
#cfd-frame-designer #cfd-preview-mode-toggle {
    flex: 0 0 auto;
}
#cfd-frame-designer #cfd-preview-mode-toggle .cfd-preview-mode-btn {
    box-sizing: border-box;
    height: var(--cfd-toolbar-control-height);
    min-height: var(--cfd-toolbar-control-height);
    width: auto;
    min-width: 0;
    max-width: 100%;
    padding: 8px 14px;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    white-space: nowrap;
    text-overflow: clip;
}
#cfd-frame-designer .cfd-unit-select,
#cfd-frame-designer .cfd-dimensions-meta-pill {
    box-sizing: border-box;
    height: var(--cfd-toolbar-control-height);
    min-height: var(--cfd-toolbar-control-height);
    margin-top: 0;
    margin-bottom: 0;
}
#cfd-frame-designer .cfd-unit-select {
    padding-top: 0;
    padding-bottom: 0;
    font-size: 12px;
}
#cfd-frame-designer .cfd-dimensions-meta-pill {
    display: inline-flex;
    align-items: center;
}
#cfd-frame-designer .cfd-step-mount-style .cfd-step-note {
    margin: 24px auto;
    max-width: 640px;
    box-sizing: border-box;
    padding: 18px 22px;
    text-align: center;
}

/* Tablet/drawer range (769–1180px): the fixed 112px buttons + non-shrinking
   view toggle overflow the preview drawer (overflow-x: hidden) and clip the
   Next button. Buttons size to their text (no stretching, no wasted side
   space) and the cluster wraps only if genuinely needed. */
@media (max-width: 1180px) {
    #cfd-frame-designer .cfd-preview-mode-cluster {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    #cfd-frame-designer .cfd-nav-buttons {
        flex: 0 1 auto;
        min-width: 0;
        margin-left: 0;
    }

    #cfd-frame-designer :is(#cfd-prev-step, #cfd-reset-step, #cfd-next-step) {
        width: auto;
        min-width: 0;
        flex: 0 1 auto;
        padding: 8px 10px;
        font-size: 12px;
    }

    #cfd-frame-designer #cfd-preview-mode-toggle {
        flex: 0 1 auto;
        min-width: 0;
    }

    #cfd-frame-designer #cfd-preview-mode-toggle .cfd-preview-mode-btn {
        padding: 8px 10px;
        min-width: 0;
        flex: 0 1 auto;
    }
}
@media (max-width: 720px) {
    #cfd-frame-designer :is(#cfd-preview-mode-toggle .cfd-preview-mode-btn, #cfd-prev-step, #cfd-reset-step, #cfd-next-step) {
        width: 100%;
    }
}

#cfd-frame-designer .cfd-mount-graphic-labels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 600px;
    margin: 16px auto 0;
    text-align: center;
}

#cfd-frame-designer .cfd-guide-trigger {
    margin: 12px 0;
}
#cfd-frame-designer .cfd-guide-trigger-caps {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide).cfd-guide-dialog {
    box-sizing: border-box;
    width: min(760px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 12px;
    color: #26323d;
    background: #fff;
    box-shadow: 0 20px 80px #0004;
}
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide).cfd-guide-dialog::backdrop {
    background: #0009;
}
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide) .cfd-guide-heading {
    display: flex;
    position: static;
    float: none;
    width: auto;
    padding: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 24px;
}
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide) .cfd-guide-heading h2 {
    margin: 0;
    color: #26323d;
    font-size: 22px;
    font-weight: 600;
    text-align: left;
    line-height: 1.3;
}
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide) .cfd-guide-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid #d9dfe4;
    border-radius: 4px;
    background: #fff;
    color: #26323d;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide) .cfd-guide-close:hover {
    background: #f5f6f7;
    border-color: #aab3bb;
}
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide) .cfd-guide-section + .cfd-guide-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid #e7eaed;
}
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide) .cfd-guide-section img {
    display: block;
    width: 100%;
    max-width: 560px;
    height: auto;
    margin: 24px auto;
    object-fit: contain;
}
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide) .cfd-guide-section p {
    display: block;
    margin: 12px 0 24px;
    color: #4b5863;
    font-size: 15px;
    line-height: 1.7;
    text-align: left;
}
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide) .cfd-guide-section > :last-child {
    margin-bottom: 0;
}
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide) .cfd-guide-section p::before {
    content: none;
}
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide) .cfd-guide-heading-close-only {
    justify-content: flex-end;
}
/* Client's "Mount Choices Explained" sheet graphic (Mark 30.09.2026).
   Poster mode keeps the close button above the centered sheet. */
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide).cfd-guide-dialog-poster .cfd-guide-section {
    padding: 0;
}
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide) .cfd-guide-section img.cfd-mount-choices-sheet {
    max-width: 560px;
    margin: 0 auto;
    border-radius: 0;
}
/* Keep spacing in a content wrapper so theme dialog resets cannot remove it. */
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide) .cfd-guide-content {
    box-sizing: border-box;
    padding: 40px 48px;
}
#cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide) .cfd-guide-section h3 {
    margin: 0 0 12px;
    color: #26323d;
    font-size: 18px;
    font-weight: 600;
    text-align: left;
    line-height: 1.4;
}
#cfd-frame-designer #cfd-measuring-guide .cfd-guide-section {
    max-width: 560px;
    margin: 0 auto;
}
#cfd-frame-designer #cfd-measuring-guide .cfd-guide-section img {
    margin: 0 auto 20px;
}
#cfd-frame-designer #cfd-measuring-guide .cfd-guide-section p {
    color: #231f20;
    line-height: 1.2;
}
#cfd-frame-designer #cfd-measuring-guide .cfd-guide-section strong {
    color: #d75e3e;
}
@media (max-width: 600px) {
    #cfd-frame-designer :is(#cfd-measuring-guide, #cfd-mount-selection-guide) .cfd-guide-content {
        padding: 28px 24px;
    }
}
#cfd-frame-designer :is(.cfd-guide-trigger, .cfd-guide-close):focus-visible {
    outline: 2px solid #d75e3e;
    outline-offset: 3px;
}

/* ── Save Design — guest fade ────────────────────────────────────── */
body:not(.logged-in) #cfd-save-design {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

body:not(.logged-in) .cfd-review-actions::after {
    content: 'Log in or create an account to save your design';
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 8px;
}
