/* ── Layout ──────────────────────────────────────────────────────────────── */
.cfg-layout {
    display: flex;
    height: calc(100vh - 100px);
    overflow: hidden;
}

/* ── Canvas ──────────────────────────────────────────────────────────────── */
.cfg-canvas-wrapper {
    flex: 1 1 0;
    position: relative;
    min-width: 0;
    background: #dde8d8;
}

#cfgCanvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

.cfg-canvas-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 0.75rem;
    padding: 5px 14px;
    border-radius: 20px;
    pointer-events: none;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* ── Panel ───────────────────────────────────────────────────────────────── */
.cfg-panel {
    width: 360px;
    flex-shrink: 0;
    background: #fff;
    border-left: 1px solid #e5e7eb;
    overflow-y: auto;
    padding: 0 0 32px;
    display: flex;
    flex-direction: column;
}

.cfg-panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a2332;
    padding: 20px 22px 16px;
    border-bottom: 2px solid #FF8C42;
    margin: 0;
    letter-spacing: 0.01em;
}

/* ── Sections ────────────────────────────────────────────────────────────── */
.cfg-section {
    padding: 16px 22px;
    border-bottom: 1px solid #f1f3f5;
}

.cfg-section h3 {
    font-size: 0.78rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 12px;
}

/* ── Sliders ─────────────────────────────────────────────────────────────── */
.cfg-slider-row {
    margin-bottom: 14px;
}

.cfg-slider-row:last-child {
    margin-bottom: 0;
}

.cfg-slider-row label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 6px;
    font-weight: 500;
}

.cfg-slider-row label span {
    font-weight: 700;
    color: #FF8C42;
    min-width: 38px;
    text-align: right;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FF8C42;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(255,140,66,0.4);
    transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: #FF8C42;
    cursor: pointer;
}

/* ── Radio buttons ───────────────────────────────────────────────────────── */
.cfg-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cfg-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #374151;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.cfg-radio:hover {
    border-color: #FF8C42;
    background: #fff8f4;
}

.cfg-radio input[type="radio"] {
    accent-color: #FF8C42;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.cfg-radio input[type="radio"]:checked + * {
    color: #FF8C42;
}

.cfg-radio:has(input:checked) {
    border-color: #FF8C42;
    background: #fff8f4;
    font-weight: 600;
    color: #1a2332;
}

.cfg-radio-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.cfg-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15);
    flex-shrink: 0;
}

/* ── Checkboxes ──────────────────────────────────────────────────────────── */
.cfg-check-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cfg-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #374151;
    user-select: none;
}

.cfg-check input[type="checkbox"] {
    accent-color: #FF8C42;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── Toggle switch ───────────────────────────────────────────────────────── */
.cfg-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.cfg-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cfg-toggle-track {
    position: relative;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.cfg-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: transform 0.2s;
}

.cfg-toggle input:checked ~ .cfg-toggle-track {
    background: #FF8C42;
}

.cfg-toggle input:checked ~ .cfg-toggle-track .cfg-toggle-thumb {
    transform: translateX(20px);
}

.cfg-toggle-label {
    font-size: 0.88rem;
    color: #374151;
}

/* ── Price block ─────────────────────────────────────────────────────────── */
.cfg-price-block {
    margin: auto 22px 0;
    padding: 18px 20px;
    background: linear-gradient(135deg, #fff8f4 0%, #fff3eb 100%);
    border: 1px solid #fcd9b8;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
}

.cfg-price-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9a6030;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.cfg-price-value {
    font-size: 2rem;
    font-weight: 800;
    color: #FF8C42;
    line-height: 1.1;
    margin-bottom: 4px;
}

.cfg-price-disclaimer {
    font-size: 0.72rem;
    color: #9a6030;
    margin-bottom: 16px;
}

.cfg-quote-btn {
    width: 100%;
    font-size: 0.95rem;
    padding: 12px 20px;
}

.cfg-share-btn {
    width: 100%;
    font-size: 0.85rem;
    padding: 10px 16px;
    margin-top: 8px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    color: #1C2A4B;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.cfg-share-btn:hover {
    background: #e9ecef;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.cfg-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
}

.cfg-modal-content {
    background: #fff;
    border-radius: 14px;
    padding: 32px;
    width: 100%;
    max-width: 540px;
    position: relative;
    margin: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.cfg-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    padding: 4px;
}

.cfg-modal-close:hover { color: #374151; }

.cfg-modal-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a2332;
    margin: 0 0 8px;
}

.cfg-modal-intro {
    font-size: 0.88rem;
    color: #6b7280;
    margin-bottom: 16px;
}

.cfg-modal-summary {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.82rem;
    color: #374151;
    margin-bottom: 18px;
    line-height: 1.6;
    white-space: pre-line;
}

.cfg-form-row {
    display: flex;
    gap: 12px;
}

.cfg-form-group {
    flex: 1;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
}

.cfg-form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.cfg-form-group input,
.cfg-form-group textarea {
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.88rem;
    color: #1a2332;
    outline: none;
    transition: border-color 0.15s;
    resize: vertical;
}

.cfg-form-group input:focus,
.cfg-form-group textarea:focus {
    border-color: #FF8C42;
    box-shadow: 0 0 0 3px rgba(255,140,66,0.12);
}

/* ── Nav active state ────────────────────────────────────────────────────── */
.nav-menu li a.active {
    color: #FF8C42;
    font-weight: 700;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .cfg-canvas-hint { display: none; }
    .cfg-layout {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .cfg-canvas-wrapper {
        height: 55vw;
        min-height: 260px;
        max-height: 420px;
        flex: none;
    }

    .cfg-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e5e7eb;
        overflow-y: visible;
    }

    .cfg-form-row {
        flex-direction: column;
        gap: 0;
    }

    .cfg-modal-content {
        padding: 24px 18px;
    }
}

/* ── Wall plan hint ───────────────────────────────────────────────────────── */
.cfg-wall-hint {
    font-size: 0.78rem;
    color: #6b7280;
    margin: 0 0 10px;
    line-height: 1.4;
}

#cfgWallPlan {
    border-radius: 8px;
    overflow: hidden;
}
