/* ── Configurator page ────────────────────────────────────────────────── */

.cfg-page {
    padding-top: 80px;
    min-height: 100vh;
}

.cfg-page h1 {
    margin: 16px 0 4px;
    font-size: 1.75rem;
}

.cfg-subtitle {
    color: var(--text-sec, #a0a0b0);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

/* ── Progress bar ────────────────────────────────────────────────────── */

.cfg-progress {
    margin-bottom: 32px;
}

.cfg-progress__bar {
    height: 4px;
    background: var(--border, #2a2a3e);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.cfg-progress__fill {
    height: 100%;
    background: var(--accent, #f59e0b);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.cfg-progress__steps {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.cfg-progress__step {
    font-size: 0.7rem;
    color: var(--text-muted, #666);
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-card, #1a1a2e);
    border: 1px solid var(--border, #2a2a3e);
    transition: all 0.3s;
    white-space: nowrap;
}

.cfg-progress__step--active {
    background: var(--accent, #f59e0b);
    color: #000;
    border-color: var(--accent, #f59e0b);
    font-weight: 600;
}

.cfg-progress__step--current {
    border-color: var(--accent, #f59e0b);
    color: var(--accent, #f59e0b);
}

/* ── Layout ──────────────────────────────────────────────────────────── */

.cfg-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}

/* ── Wizard steps ────────────────────────────────────────────────────── */

.cfg-wizard {
    min-width: 0;
}

.cfg-step {
    background: var(--bg-card, #1a1a2e);
    border: 1px solid var(--border, #2a2a3e);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    transition: opacity 0.3s;
}

.cfg-step__title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    font-size: 1.1rem;
}

.cfg-step__num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent, #f59e0b);
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ── Size cards ──────────────────────────────────────────────────────── */

.cfg-sizes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.cfg-size-card {
    cursor: pointer;
}

.cfg-size-card input { display: none; }

.cfg-size-card__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 12px;
    border: 2px solid var(--border, #2a2a3e);
    border-radius: 10px;
    background: var(--bg-primary, #0a0a0f);
    transition: all 0.2s;
    text-align: center;
}

.cfg-size-card:hover .cfg-size-card__inner {
    border-color: var(--accent, #f59e0b);
}

.cfg-size-card input:checked + .cfg-size-card__inner {
    border-color: var(--accent, #f59e0b);
    background: rgba(245, 158, 11, 0.08);
    box-shadow: 0 0 0 1px var(--accent, #f59e0b);
}

.cfg-size-card__inches {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent, #f59e0b);
    font-family: 'JetBrains Mono', monospace;
}

.cfg-size-card__name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text, #e8e8ed);
}

.cfg-size-card__desc {
    font-size: 0.7rem;
    color: var(--text-muted, #666);
    line-height: 1.3;
}

/* ── Link type toggle ────────────────────────────────────────────────── */

.cfg-link-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 4px;
    background: var(--bg-primary, #0a0a0f);
    border-radius: 8px;
    border: 1px solid var(--border, #2a2a3e);
}

.cfg-link-toggle__opt {
    flex: 1;
    cursor: pointer;
}

.cfg-link-toggle__opt input { display: none; }

.cfg-link-toggle__opt span {
    display: block;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-sec, #a0a0b0);
    transition: all 0.2s;
}

.cfg-link-toggle__opt input:checked + span {
    background: var(--accent, #f59e0b);
    color: #000;
    font-weight: 600;
}

/* ── Role sections ───────────────────────────────────────────────────── */

.cfg-role {
    margin-bottom: 16px;
}

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

.cfg-role--hidden {
    display: none;
}

.cfg-role__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-sec, #a0a0b0);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 10px;
}

/* ── Option cards ────────────────────────────────────────────────────── */

.cfg-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cfg-options__empty,
.cfg-options__loading {
    padding: 24px;
    text-align: center;
    color: var(--text-muted, #666);
    font-size: 0.85rem;
}

.cfg-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 2px solid var(--border, #2a2a3e);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-primary, #0a0a0f);
}

.cfg-opt input { display: none; }

.cfg-opt:hover {
    border-color: rgba(245, 158, 11, 0.4);
}

.cfg-opt--selected {
    border-color: var(--accent, #f59e0b);
    background: rgba(245, 158, 11, 0.05);
}

.cfg-opt__img {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-card, #1a1a2e);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cfg-opt__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cfg-opt__info {
    flex: 1;
    min-width: 0;
}

.cfg-opt__brand {
    font-size: 0.7rem;
    color: var(--accent, #f59e0b);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cfg-opt__name {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text, #e8e8ed);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cfg-opt__specs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.cfg-opt__spec {
    font-size: 0.7rem;
    color: var(--text-sec, #a0a0b0);
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.cfg-opt__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.cfg-opt__price {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text, #e8e8ed);
    font-family: 'JetBrains Mono', monospace;
}

.cfg-opt__weight {
    font-size: 0.75rem;
    color: var(--text-muted, #666);
    font-family: 'JetBrains Mono', monospace;
}

/* ── Calculator sidebar ──────────────────────────────────────────────── */

.cfg-calc__sticky {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border, #2a2a3e) transparent;
    background: var(--bg-card, #1a1a2e);
    border: 1px solid var(--border, #2a2a3e);
    border-radius: 12px;
    padding: 20px;
}

.cfg-calc__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cfg-calc__header h3 {
    margin: 0;
    font-size: 1rem;
}

.cfg-calc__size {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent, #f59e0b);
}

/* ── Metrics (reuse calc-metrics pattern) ────────────────────────────── */

.cfg-calc .calc-metrics {
    margin-bottom: 0;
}

.cfg-calc .calc-metric__value {
    font-family: 'JetBrains Mono', monospace;
}

/* ── Gauge ───────────────────────────────────────────────────────────── */

.cfg-gauge {
    padding: 0;
}

.cfg-gauge__label {
    font-size: 0.7rem;
    color: var(--text-sec, #a0a0b0);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    font-weight: 600;
}

.cfg-gauge__bar {
    height: 8px;
    background: var(--bg-primary, #0a0a0f);
    border-radius: 4px;
    overflow: hidden;
}

.cfg-gauge__fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease, background 0.4s ease;
}

.cfg-gauge__scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: var(--text-muted, #666);
    margin-top: 2px;
    font-family: 'JetBrains Mono', monospace;
}

/* ── Warnings ────────────────────────────────────────────────────────── */

.cfg-warnings {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cfg-warnings:empty {
    display: none;
}

.cfg-warn {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    line-height: 1.4;
}

.cfg-warn__icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.65rem;
}

.cfg-warn--danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.cfg-warn--danger .cfg-warn__icon {
    background: #ef4444;
    color: #fff;
}

.cfg-warn--warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}
.cfg-warn--warning .cfg-warn__icon {
    background: #f59e0b;
    color: #000;
}

.cfg-warn--info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}
.cfg-warn--info .cfg-warn__icon {
    background: #3b82f6;
    color: #fff;
}

/* ── Cost summary ────────────────────────────────────────────────────── */

.cfg-cost__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border, #2a2a3e);
    margin-bottom: 8px;
}

.cfg-cost__header span:first-child {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-sec, #a0a0b0);
}

.cfg-cost__total {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text, #e8e8ed);
    font-family: 'JetBrains Mono', monospace;
}

.cfg-cost__items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cfg-cost__item {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-sec, #a0a0b0);
}

.cfg-cost__item .font-mono {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text, #e8e8ed);
}

/* ── Actions ─────────────────────────────────────────────────────────── */

.cfg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cfg-actions__inquiry {
    flex: 1;
    min-width: 150px;
}

/* ── Inquiry summary inside modal ────────────────────────────────────── */

.cfg-inquiry-summary {
    background: var(--bg-primary, #0a0a0f);
    border: 1px solid var(--border, #2a2a3e);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 0.8rem;
}

.cfg-inquiry-summary__title {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-sec, #a0a0b0);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

.cfg-inquiry-summary ul {
    margin: 0;
    padding-left: 16px;
    list-style: disc;
}

.cfg-inquiry-summary li {
    margin-bottom: 2px;
    color: var(--text-sec, #a0a0b0);
}

.cfg-inquiry-summary li strong {
    color: var(--text, #e8e8ed);
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .cfg-layout {
        grid-template-columns: 1fr;
    }

    .cfg-calc__sticky {
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .cfg-page h1 {
        font-size: 1.3rem;
    }

    .cfg-sizes {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .cfg-step {
        padding: 16px;
    }

    .cfg-opt {
        padding: 10px;
        gap: 10px;
    }

    .cfg-opt__img {
        width: 44px;
        height: 44px;
    }

    .cfg-calc__sticky {
        padding: 16px;
    }

    .calc-metrics {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .cfg-sizes {
        grid-template-columns: 1fr 1fr;
    }

    .cfg-opt__specs {
        display: none;
    }

    .cfg-progress__steps {
        display: none;
    }
}
