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

/* ===== 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: 10px;
    min-width: 0;
}

.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 12px;
    cursor: pointer;
    text-transform: uppercase;
}

.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);
}

.cfd-chevron-mount-layer-secondary {
    position: absolute;
    inset: 18px 18px 18px 18px;
    border: 1px solid rgba(34, 49, 63, 0.12);
}

.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 {
    position: relative;
    z-index: 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
}

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

.cfd-2d-aperture {
    width: 100%;
    height: 100%;
    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 {
    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 ===== */
.cfd-price-container {
    background: white;
    padding: 16px;
    border-radius: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    margin-bottom: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

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

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

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

.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;
}

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

/* ===== 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 84px 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;
}

.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: wrap;
    gap: 8px;
    margin-top: 2px;
}

.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: 64px;
}

.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;
}

.cfd-frame-profile-controls {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #e6edf4;
    border-radius: 0;
    background: #fafcfe;
}

.cfd-frame-profile-controls h3 {
    margin: 0 0 4px;
    font-size: 0.82rem;
    color: #4a5a6a;
    font-weight: 600;
}

.cfd-frame-profile-controls-desc {
    display: none;
}

.cfd-frame-profile-control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (min-width: 1700px) {
    .cfd-layout-vertical .cfd-frame-profile-control-grid {
        grid-template-columns: repeat(2, minmax(100px, 1fr));
        gap: 8px;
    }
}

.cfd-frame-profile-control {
    background: #fff;
    border: 1px solid #e8edf2;
    border-radius: 0;
    padding: 6px 10px;
}

.cfd-frame-profile-control label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
    font-size: 0.7rem;
    color: #6f7b85;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.cfd-frame-profile-value {
    color: #D75E3E;
    font-weight: 700;
}

.cfd-frame-profile-control input[type="range"] {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e6ec;
    border-radius: 0;
    outline: none;
    margin: 0;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #D75E3E;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #D75E3E;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

@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;
    }

    .cfd-frame-profile-control-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Step 3: Mounting Styles ===== */
.cfd-mounting-styles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    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: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    transition: all 0.25s ease;
    gap: 10px;
    min-height: 118px;
}

.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-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: 3px;
}

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

.cfd-mount-style-desc {
    font-size: 0.8rem;
    color: #666;
}

/* ===== 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);
}

.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 === */
.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: repeat(auto-fill, minmax(190px, 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;
    gap: 5px;
}

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

.cfd-option-details {
    display: flex;
    align-items: center;
    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: 14px;
}

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

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

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

.cfd-review-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.cfd-review-value {
    font-size: 0.94rem;
    color: #333;
    font-weight: 600;
}

.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;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
}

.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;
    max-height: 100vh;
    overflow-y: auto;
}

.cfd-layout-vertical .cfd-preview-panel .cfd-canvas-container {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    z-index: 5;
}

.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;
    }

    .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-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;
}

.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;
}

/* 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-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;
}

.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-container {
        flex: 0 0 auto;
        padding: 12px;
        padding-top: 108px;
        margin-bottom: 8px;
    }

    .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;
    }
}
