/* ============================================
   KONFIGURUJ — real manufacturer configurator
   Modern design inspired by oceniamy.to
   ============================================ */

/* --- List page header (now uses ob-hero-mosaic, minimal overrides) --- */
.cfg-list-header { display: none; } /* legacy — replaced by ob-hero-mosaic */

/* --- Embed: ukryj sidebar i zrób layout jednokolumnowy --- */
.ob-sidebar-hidden { display: none !important; }
.ob-sidebar-hidden + .ob-main-col,
.ob-main-col:only-child { max-width: 100%; }
/* Gdy sidebar ukryty, layout = 1 kolumna */
.ob-layout:has(.ob-sidebar-hidden) { grid-template-columns: 1fr !important; }

/* --- List page (uses ob-content + ob-layout now) --- */
.cfg-list-page { padding-top: 0; padding-bottom: 2.5rem; }
.cfg-list-page .ob-adv-filters { margin-bottom: 12px; }
.cfg-list-page .ob-adv-group { flex: 1; min-width: 160px; }
.cfg-list-page .ob-adv-select { width: 100%; }
.cfg-list-page .ob-adv-input { width: 100%; }
.cfg-list-page .sort-bar { margin-bottom: 12px; }
.cfg-model-brand {
    display: flex; align-items: center; gap: .4rem; margin-bottom: .1rem;
}
.cfg-model-brand img {
    width: 24px; height: 24px; object-fit: contain;
    background: #f0f4ff; border-radius: 6px; padding: 2px;
}
/* --- Filters --- */
.cfg-filters {
    display: flex; gap: .75rem; flex-wrap: wrap;
    margin-bottom: 1.25rem; padding: .75rem 1rem;
    background: #fff; border-radius: 10px;
    box-shadow: 0 1px 8px rgba(26,86,219,.05);
    border: 1px solid rgba(26,86,219,.06);
}
.cfg-filter-group { flex: 1; min-width: 160px; }
.cfg-filter-group .form-select {
    width: 100%; padding: .45rem .75rem; border-radius: 8px;
    border: 1px solid #e2e8f0; font-size: .82rem;
    transition: all .25s cubic-bezier(.25,.8,.25,1);
    background: #f8fafc;
}
.cfg-filter-group .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(26,86,219,.1);
    background: #fff;
}
.cfg-no-results {
    text-align: center; padding: 2rem 1rem;
    color: var(--color-gray); font-size: .9rem;
}

.cfg-models-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.1rem;
}
.cfg-model-card {
    display: block; text-decoration: none; color: inherit;
    border: 1px solid rgba(26,86,219,.08); border-radius: 10px;
    overflow: hidden; background: #fff;
    transition: all .3s cubic-bezier(.25,.8,.25,1);
    box-shadow: 0 1px 6px rgba(15,52,128,.04);
}
.cfg-model-card:hover {
    border-color: rgba(26,86,219,.15);
    box-shadow: 0 6px 24px rgba(26,86,219,.12);
    transform: translateY(-3px);
}
.cfg-model-img {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edf5 100%);
    overflow: hidden; position: relative;
}
.cfg-model-img img {
    width: 100%; height: 170px; object-fit: cover; display: block;
    transition: transform .4s cubic-bezier(.25,.8,.25,1);
}
.cfg-model-card:hover .cfg-model-img img { transform: scale(1.03); }
.cfg-model-info { padding: .9rem 1.1rem; }
.cfg-model-info h3 { font-size: 1rem; font-weight: 700; margin-bottom: .15rem; }
.cfg-model-type { font-size: .78rem; color: var(--color-gray); margin-bottom: .5rem; }
.cfg-model-price { font-size: 1rem; font-weight: 700; color: var(--color-primary); margin-bottom: .65rem; }
.cfg-model-info .btn-primary {
    background: linear-gradient(135deg, #1a56db 0%, #2563eb 100%);
    border-radius: 8px; font-weight: 600; font-size: .85rem; padding: .4rem .9rem;
    box-shadow: 0 2px 8px rgba(26,86,219,.2);
    transition: all .3s cubic-bezier(.25,.8,.25,1);
}
.cfg-model-info .btn-primary:hover {
    box-shadow: 0 4px 14px rgba(26,86,219,.3);
    transform: translateY(-1px);
}

/* --- Configurator page --- */
.cfg-page { padding-bottom: 2.5rem; }

/* Legacy cfg-header (now replaced by ob-hero-bar for detail) */
.cfg-header {
    background: linear-gradient(135deg, #1a56db 0%, #0f3480 50%, #1e40af 100%);
    color: #fff;
    padding: .9rem 0 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cfg-header::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 70% 20%, rgba(255,255,255,.08) 0%, transparent 60%);
    pointer-events: none;
}
.cfg-header::after {
    content: '';
    display: block;
    margin-top: .6rem;
    height: 3px;
    background: linear-gradient(90deg, #1a56db 0%, var(--color-accent) 50%, #1a56db 100%);
}
.cfg-back {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .75rem; color: rgba(255,255,255,.7);
    text-decoration: none; margin-bottom: .35rem;
    transition: all .25s;
    position: relative;
}
.cfg-back:hover { color: #fff; gap: .5rem; }
.cfg-header-content {
    display: flex; align-items: center; justify-content: center; gap: .9rem;
    position: relative;
}
.cfg-header-logo {
    width: 48px; height: 48px; object-fit: contain;
    background: #fff; border-radius: 10px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.cfg-header h1 { font-size: 1.25rem; font-weight: 700; margin-bottom: .05rem; color: #fff; position: relative; }
.cfg-subtitle { font-size: .8rem; color: rgba(255,255,255,.75); position: relative; }

/* ============ NEW DETAIL LAYOUT: Gallery+Tabs LEFT, Summary RIGHT ============ */
.cfg-detail-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    padding-top: 6px;
}
.cfg-detail-left {
    min-width: 0;
}
.cfg-detail-right {
    min-width: 0;
}

/* --- Tab bar --- */
.cfg-tabs {
    display: flex;
    gap: 0;
    margin-top: .6rem;
    border-bottom: 2px solid rgba(26,86,219,.1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.cfg-tabs::-webkit-scrollbar { display: none; }
.cfg-tab {
    flex-shrink: 0;
    padding: .5rem .9rem;
    border: none;
    background: none;
    font-size: .82rem;
    font-weight: 600;
    color: #8896ab;
    cursor: pointer;
    position: relative;
    transition: color .25s, background .25s;
    white-space: nowrap;
    border-radius: 8px 8px 0 0;
}
.cfg-tab:hover {
    color: var(--color-primary);
    background: rgba(26,86,219,.04);
}
.cfg-tab.active {
    color: var(--color-primary);
    background: rgba(26,86,219,.06);
}
.cfg-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2.5px;
    background: linear-gradient(135deg, #1a56db 0%, #2563eb 100%);
    border-radius: 2px 2px 0 0;
}

/* --- Tab panels --- */
.cfg-tab-content {
    min-height: 200px;
}
.cfg-tab-panel {
    display: none;
}
.cfg-tab-panel.active {
    display: block;
}

/* --- Section styling (inside tabs, no numbering) --- */
.cfg-detail-left .cfg-section {
    position: relative;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(26,86,219,.06);
}
.cfg-detail-left .cfg-section:last-child { border-bottom: none; }
.cfg-detail-left .cfg-section .cfg-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: .75rem;
}

/* --- Sidebar summary card --- */
.cfg-sidebar-summary {
    background: #fff; border-radius: 12px;
    border: 1px solid rgba(26,86,219,.06);
    padding: 0; box-shadow: 0 2px 16px rgba(15,52,128,.06);
    overflow: hidden;
}
.cfg-sidebar-summary h4 {
    margin: 0; padding: 12px 16px;
    font-size: 13px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #1a56db 0%, #0f3480 100%);
    position: relative;
}
.cfg-sidebar-summary h4::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 80% 30%, rgba(255,255,255,.1) 0%, transparent 60%);
    pointer-events: none;
}
.cfg-sidebar-rows {
    display: flex; flex-direction: column; gap: 0;
    padding: 4px 16px 0;
}
.cfg-sidebar-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 0; border-bottom: 1px solid rgba(26,86,219,.05);
    font-size: 12px;
}
.cfg-sidebar-row:last-child { border-bottom: none; }
.cfg-sidebar-label { color: #8896ab; font-weight: 500; }
.cfg-sidebar-val { color: #1a1a2e; font-weight: 600; text-align: right; max-width: 60%; }
.cfg-sidebar-total {
    margin: 0 16px; padding: 10px 0;
    border-top: 2px solid rgba(26,86,219,.1);
    display: flex; justify-content: space-between; align-items: center;
}
.cfg-sidebar-total span { font-size: 12px; color: #666; font-weight: 500; }
.cfg-sidebar-total strong { font-size: 1.15rem; font-weight: 800; color: var(--color-primary); }
.cfg-sidebar-actions {
    padding: 4px 16px 14px;
    display: flex; flex-direction: column; gap: 0;
}
.cfg-sidebar-actions .btn {
    border-radius: 8px; font-size: .82rem;
    font-weight: 600;
    transition: all .3s cubic-bezier(.25,.8,.25,1);
}
.cfg-sidebar-actions .btn-accent {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 10px rgba(245,158,11,.25);
}
.cfg-sidebar-actions .btn-accent:hover {
    box-shadow: 0 4px 14px rgba(245,158,11,.35);
    transform: translateY(-1px);
}
.cfg-sidebar-actions .btn-primary {
    background: linear-gradient(135deg, #1a56db 0%, #2563eb 100%);
    box-shadow: 0 2px 10px rgba(26,86,219,.2);
}
.cfg-sidebar-actions .btn-primary:hover {
    box-shadow: 0 4px 14px rgba(26,86,219,.3);
    transform: translateY(-1px);
}
.cfg-sidebar-actions .btn-secondary {
    border: 1.5px solid rgba(26,86,219,.2);
    color: var(--color-primary);
    border-radius: 8px;
}
.cfg-sidebar-actions .btn-secondary:hover {
    background: rgba(26,86,219,.04);
    border-color: var(--color-primary);
}

/* --- Sticky price bar --- */
.cfg-pricebar {
    position: fixed; top: 81px; left: 0; right: 0; z-index: 90;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    box-shadow: 0 2px 16px rgba(0,0,0,.25);
    transform: translateY(-100%);
    transition: transform .3s cubic-bezier(.25,.8,.25,1);
    backdrop-filter: blur(12px);
}
.cfg-pricebar.visible { transform: translateY(0); }
.cfg-pricebar-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: .5rem 0; gap: .75rem;
}
.cfg-pricebar-left {
    display: flex; align-items: center; gap: .5rem;
}
.cfg-pricebar-logo {
    width: 28px; height: 28px; object-fit: contain;
    background: rgba(255,255,255,.1); border-radius: 6px; padding: 2px;
}
.cfg-pricebar-left strong { display: block; font-size: .82rem; line-height: 1.2; color: #fff; }
.cfg-pricebar-version { font-size: .72rem; color: rgba(255,255,255,.6); }
.cfg-pricebar-right { display: flex; align-items: center; gap: .75rem; }
.cfg-pricebar-total { font-size: 1.05rem; font-weight: 800; color: var(--color-accent); white-space: nowrap; }
.cfg-pricebar-total small { font-weight: 400; font-size: .78rem; color: rgba(255,255,255,.5); }

/* --- Layout: gallery left + options right --- */
.cfg-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 1.25rem;
    align-items: start;
}

/* --- Gallery --- */
.cfg-gallery {
    position: relative; align-self: start;
}
.cfg-gallery-main {
    position: relative; border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
    aspect-ratio: 16/10;
    box-shadow: 0 2px 12px rgba(15,52,128,.05);
}
.cfg-gallery-main img {
    width: 100%; height: 100%; object-fit: contain; display: block;
    transition: opacity .3s cubic-bezier(.25,.8,.25,1);
}
.cfg-gallery-prev, .cfg-gallery-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border-radius: 8px;
    background: rgba(255,255,255,.92); border: none;
    font-size: 1.1rem; color: var(--color-dark);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all .25s cubic-bezier(.25,.8,.25,1);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 8px rgba(0,0,0,.07);
}
.cfg-gallery-prev { left: 10px; }
.cfg-gallery-next { right: 10px; }
.cfg-gallery-prev:hover, .cfg-gallery-next:hover {
    background: #fff;
    box-shadow: 0 4px 14px rgba(26,86,219,.12);
    transform: translateY(-50%) scale(1.04);
}
.cfg-gallery-counter {
    position: absolute; bottom: 10px; right: 10px;
    background: rgba(15,52,128,.65); color: #fff;
    padding: .2rem .55rem; border-radius: 6px;
    font-size: .7rem; font-weight: 600;
    backdrop-filter: blur(6px);
}
.cfg-gallery-thumbs {
    display: flex; gap: .35rem; margin-top: .5rem;
    overflow-x: auto; padding-bottom: .2rem;
}
.cfg-gallery-thumbs img {
    width: 64px; height: 44px; object-fit: cover;
    border-radius: 6px; cursor: pointer;
    border: 2px solid transparent;
    opacity: .55; transition: all .25s cubic-bezier(.25,.8,.25,1);
    flex-shrink: 0;
}
.cfg-gallery-thumbs img:hover { opacity: .85; transform: scale(1.03); }
.cfg-gallery-thumbs img.active {
    border-color: var(--color-primary); opacity: 1;
    box-shadow: 0 1px 6px rgba(26,86,219,.18);
}

/* --- Options panel --- */
.cfg-options {
    display: flex; flex-direction: column; gap: 0;
}
.cfg-section {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(26,86,219,.06);
}
.cfg-section:last-child { border-bottom: none; }
.cfg-section-title {
    font-size: .95rem; font-weight: 700; color: var(--color-dark);
    margin-bottom: .7rem;
}

/* --- Version cards --- */
.cfg-version-card {
    display: block; cursor: pointer;
    padding: .85rem 1rem; margin-bottom: .5rem;
    border: 1.5px solid rgba(26,86,219,.08);
    border-radius: 10px;
    background: #fff;
    transition: all .3s cubic-bezier(.25,.8,.25,1);
    box-shadow: 0 1px 4px rgba(15,52,128,.03);
}
.cfg-version-card:hover {
    border-color: rgba(26,86,219,.2);
    box-shadow: 0 4px 16px rgba(26,86,219,.08);
    transform: translateY(-1px);
}
.cfg-version-card.active {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(26,86,219,.03) 0%, rgba(37,99,235,.02) 100%);
    box-shadow: 0 2px 12px rgba(26,86,219,.1), 0 0 0 2px rgba(26,86,219,.06);
}
.cfg-version-card input { display: none; }
.cfg-version-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: .3rem;
}
.cfg-version-name { font-size: .95rem; font-weight: 700; color: var(--color-dark); }
.cfg-version-price {
    font-size: .9rem; font-weight: 700; color: var(--color-primary); white-space: nowrap;
    background: rgba(26,86,219,.06); padding: 1px 8px; border-radius: 6px;
}
.cfg-version-desc { font-size: .75rem; color: var(--color-gray); margin-bottom: .5rem; line-height: 1.45; }
.cfg-version-features {
    list-style: none; padding: 0; margin: 0;
    font-size: .75rem; color: var(--color-dark-2);
    display: grid; gap: .2rem;
    max-height: 0; overflow: hidden;
    transition: max-height .35s cubic-bezier(.25,.8,.25,1);
}
.cfg-version-card.active .cfg-version-features { max-height: 600px; }
.cfg-version-features li { padding-left: 1.2em; position: relative; }
.cfg-version-features li::before {
    content: ''; position: absolute; left: 0; top: .45em;
    width: 6px; height: 6px; border-radius: 50%;
    background: linear-gradient(135deg, #1a56db, #2563eb);
}
.cfg-extra-label {
    font-weight: 600; color: var(--color-primary);
    margin-top: .35rem; padding-left: 0 !important;
}
.cfg-extra-label::before { display: none !important; }

/* --- Swatches (color, interior, wheel) --- */
.cfg-swatches {
    display: flex; gap: .6rem; flex-wrap: wrap;
    margin-bottom: .6rem;
}
.cfg-swatch {
    display: flex; align-items: center; justify-content: center;
    width: 46px; height: 46px;
    border: 2px solid #e8edf3;
    border-radius: 50%; cursor: pointer;
    transition: all .25s cubic-bezier(.25,.8,.25,1); padding: 2px;
    background: #fff;
}
.cfg-swatch:hover {
    border-color: rgba(26,86,219,.3);
    transform: scale(1.06);
    box-shadow: 0 2px 8px rgba(26,86,219,.1);
}
.cfg-swatch.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(26,86,219,.15), 0 2px 10px rgba(26,86,219,.1);
    transform: scale(1.04);
}
.cfg-swatch input { display: none; }
.cfg-swatch-img {
    width: 100%; height: 100%; border-radius: 50%;
    object-fit: cover;
}
.cfg-swatch-color {
    display: block; width: 100%; height: 100%; border-radius: 50%;
    border: 1px solid rgba(0,0,0,.1);
}
.cfg-swatch-text {
    width: auto; height: auto; border-radius: 8px; padding: 6px 10px;
}
.cfg-swatch-label {
    font-size: .65rem; font-weight: 600; color: #334155;
    line-height: 1.2; text-align: center; white-space: nowrap;
}
.cfg-swatch-text.active .cfg-swatch-label { color: var(--color-primary); }
.cfg-color-info {
    display: flex; align-items: center; justify-content: space-between;
    font-size: .82rem;
    padding: 6px 10px; background: #f8fafc; border-radius: 8px;
}
.cfg-color-name { font-weight: 600; color: var(--color-dark); }
.cfg-color-price { font-weight: 600; color: var(--color-primary); font-size: .78rem; }

/* --- Wheel preview --- */
.cfg-wheel-preview-wrap {
    margin-top: .5rem; border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
    box-shadow: 0 1px 6px rgba(15,52,128,.04);
}
.cfg-wheel-preview {
    width: 100%; max-height: 180px;
    object-fit: contain; display: block;
}

/* --- Interior preview --- */
.cfg-interior-preview {
    margin-top: .6rem; border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
    aspect-ratio: 16/10;
    box-shadow: 0 1px 6px rgba(15,52,128,.04);
}
.cfg-interior-preview img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .3s cubic-bezier(.25,.8,.25,1);
}
.cfg-interior-preview:hover img { transform: scale(1.02); }

/* --- Option cards (generic: lines, trims, packages, individual options) --- */
.cfg-option-card {
    display: block; cursor: pointer;
    padding: .65rem .9rem; margin-bottom: .4rem;
    border: 1.5px solid rgba(26,86,219,.08);
    border-radius: 8px;
    background: #fff;
    transition: all .25s cubic-bezier(.25,.8,.25,1);
    box-shadow: 0 1px 3px rgba(15,52,128,.02);
}
.cfg-option-card:hover {
    border-color: rgba(26,86,219,.18);
    box-shadow: 0 2px 10px rgba(26,86,219,.07);
    transform: translateY(-1px);
}
.cfg-option-card.active {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(26,86,219,.03) 0%, rgba(37,99,235,.02) 100%);
    box-shadow: 0 2px 10px rgba(26,86,219,.08), 0 0 0 2px rgba(26,86,219,.06);
}
.cfg-option-card input[type="radio"] { display: none; }
.cfg-option-card input[type="checkbox"] { display: none; }
.cfg-option-card.cfg-option-check.active {
    border-color: var(--color-accent);
    background: linear-gradient(135deg, rgba(245,158,11,.04) 0%, rgba(217,119,6,.02) 100%);
    box-shadow: 0 2px 10px rgba(245,158,11,.08), 0 0 0 2px rgba(245,158,11,.07);
}
.cfg-option-header {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.cfg-option-name { font-size: .85rem; font-weight: 600; color: var(--color-dark); }
.cfg-option-price {
    font-size: .8rem; font-weight: 700; color: var(--color-primary); white-space: nowrap;
    background: rgba(26,86,219,.06); padding: 1px 6px; border-radius: 5px;
}
.cfg-option-desc {
    font-size: .72rem; color: var(--color-gray); margin-top: .25rem; line-height: 1.45;
}
.cfg-option-sm { padding: .5rem .75rem; }
.cfg-option-sm .cfg-option-name { font-size: .78rem; font-weight: 500; }
.cfg-option-sm .cfg-option-price { font-size: .75rem; }
.cfg-option-group-title {
    font-size: .75rem; font-weight: 700; color: #fff;
    text-transform: uppercase; letter-spacing: .04em;
    margin: .85rem 0 .4rem; padding: 6px 10px;
    background: linear-gradient(135deg, #1a56db 0%, #2563eb 100%);
    border-radius: 7px;
    box-shadow: 0 1px 6px rgba(26,86,219,.18);
}
.cfg-option-group { margin-bottom: .35rem; }

/* --- Interior mini gallery --- */
.cfg-interior-thumbs {
    display: flex; gap: .35rem; margin-top: .35rem;
    overflow-x: auto; padding-bottom: .2rem;
}
.cfg-interior-thumbs img {
    width: 52px; height: 36px; object-fit: cover;
    border-radius: 5px; cursor: pointer;
    border: 2px solid transparent;
    opacity: .5; transition: all .25s cubic-bezier(.25,.8,.25,1);
    flex-shrink: 0;
}
.cfg-interior-thumbs img:hover { opacity: .8; transform: scale(1.04); }
.cfg-interior-thumbs img.active {
    border-color: var(--color-primary); opacity: 1;
    box-shadow: 0 1px 6px rgba(26,86,219,.12);
}

/* --- Standard equipment list --- */
.cfg-std-equip-list {
    list-style: none; padding: 0; margin: 0 0 .5rem;
    font-size: .78rem; color: var(--color-dark-2);
    display: grid; gap: .2rem;
}
.cfg-std-equip-list li {
    padding: 3px 6px 3px 1.4em; position: relative;
    border-radius: 4px;
    transition: background .2s;
}
.cfg-std-equip-list li:hover { background: rgba(26,86,219,.03); }
.cfg-std-equip-list li::before {
    content: '\2713'; position: absolute; left: 4px;
    color: var(--color-primary); font-weight: 700;
}

/* --- Specs per engine --- */
.cfg-specs-engine {
    font-size: .82rem; font-weight: 700; color: var(--color-dark);
    margin-bottom: .35rem;
    padding: 5px 10px; background: #f0f4ff; border-radius: 6px;
    border-left: 3px solid var(--color-primary);
}
.cfg-specs-subtitle {
    font-size: .78rem; font-weight: 600; color: var(--color-gray);
    margin: .5rem 0 .2rem;
}

/* --- Specs --- */
.cfg-specs {
    display: grid; gap: 0;
    background: #fff; border-radius: 8px;
    border: 1px solid rgba(26,86,219,.05);
    overflow: hidden;
}
.cfg-spec-row {
    display: flex; justify-content: space-between;
    padding: .4rem .65rem;
    border-bottom: 1px solid rgba(26,86,219,.04);
    font-size: .78rem;
    transition: background .2s;
}
.cfg-spec-row:hover { background: rgba(26,86,219,.02); }
.cfg-spec-row:last-child { border-bottom: none; }
.cfg-spec-label { color: var(--color-gray); }
.cfg-spec-value { font-weight: 600; color: var(--color-dark); }

/* --- Summary --- */
.cfg-summary-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(15,52,128,.05);
    border: 1px solid rgba(26,86,219,.05);
}
/* --- Spec hero (top of summary) --- */
.cfg-spec-hero {
    display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.25rem;
    align-items: center; margin-bottom: 1.25rem;
}
.cfg-spec-hero-img { border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.cfg-spec-hero-img img { width: 100%; display: block; }
.cfg-spec-title { font-size: 1.2rem; font-weight: 800; margin-bottom: .15rem; }
.cfg-spec-subtitle { font-size: .82rem; color: var(--color-gray); margin-bottom: .65rem; }
.cfg-spec-total-box {
    display: flex; flex-direction: column;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    padding: .9rem 1.1rem; border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.12);
    position: relative; overflow: hidden;
}
.cfg-spec-total-box::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 80% 20%, rgba(26,86,219,.15) 0%, transparent 60%);
    pointer-events: none;
}
.cfg-spec-total-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: rgba(255,255,255,.6); position: relative; }
.cfg-spec-total-price { font-size: 1.3rem; font-weight: 800; color: var(--color-accent); position: relative; }

/* --- Spec blocks --- */
.cfg-spec-block {
    margin-bottom: 1rem; padding-bottom: 1rem;
    border-bottom: 1px solid rgba(26,86,219,.06);
}
.cfg-spec-block:last-of-type { border-bottom: none; }
.cfg-spec-block-title {
    font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: #fff;
    margin-bottom: .6rem; padding: 5px 10px;
    background: linear-gradient(135deg, #1a56db 0%, #2563eb 100%);
    border-radius: 7px;
    box-shadow: 0 1px 6px rgba(26,86,219,.18);
}
.cfg-spec-engine-label {
    font-size: .72rem; font-weight: 600; color: var(--color-gray);
    margin-bottom: .35rem;
}
.cfg-spec-subgroup {
    font-size: .72rem; font-weight: 700; color: var(--color-dark);
    margin: .5rem 0 .25rem; text-transform: uppercase; letter-spacing: .03em;
}
.cfg-spec-equip-list {
    list-style: none; padding: 0; margin: 0 0 .35rem;
    display: grid; grid-template-columns: 1fr 1fr; gap: .1rem .5rem;
}
.cfg-spec-equip-list li {
    font-size: .72rem; color: var(--color-text);
    padding: .15rem 0 .15rem 1.1rem; position: relative;
}
.cfg-spec-equip-list li::before {
    content: '\2713'; position: absolute; left: 0;
    color: var(--color-success); font-weight: 700;
}

.cfg-summary-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
    align-items: start;
}
.cfg-summary-img { border-radius: 8px; overflow: hidden; }
.cfg-summary-img img { width: 100%; display: block; }
.cfg-summary-details h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .65rem; }
.cfg-summary-table { display: grid; gap: 0; margin-bottom: 1rem; }
.cfg-summary-row {
    display: grid; grid-template-columns: 1fr 1fr auto;
    gap: .4rem; padding: .4rem 0;
    border-bottom: 1px solid rgba(0,0,0,.06);
    font-size: .78rem;
}
.cfg-summary-row:last-child { border-bottom: none; }
.cfg-summary-row span:first-child { color: var(--color-gray); }
.cfg-summary-row span:nth-child(2) { font-weight: 500; color: var(--color-dark); }
.cfg-summary-row span:last-child { font-weight: 600; text-align: right; white-space: nowrap; }
.cfg-summary-total {
    background: var(--color-white); padding: .5rem .4rem !important;
    border-radius: var(--radius); margin-top: .35rem;
}
.cfg-summary-total span:last-child { font-size: .95rem; font-weight: 800; color: var(--color-primary); }

.cfg-summary-actions {
    display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem;
}
.cfg-disclaimer {
    font-size: .7rem; color: var(--color-gray); line-height: 1.4;
}

/* --- Contact form --- */
.cfg-contact-section {
    margin-top: 1.25rem; padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid rgba(26,86,219,.06);
    border-radius: 10px;
    box-shadow: 0 1px 10px rgba(15,52,128,.04);
}
.cfg-contact-form { margin-top: 1rem; }
.cfg-contact-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: .75rem; }
.cfg-contact-form .form-group { margin-bottom: 0; }
.cfg-contact-form textarea { resize: vertical; min-height: 70px; }

.cfg-success-msg {
    margin-top: .75rem; padding: .75rem 1rem;
    background: #ecfdf5; border: 1px solid #a7f3d0;
    border-radius: var(--radius); color: #065f46;
    font-size: .82rem;
}

.btn-success { background: #16a34a !important; color: #fff !important; }

/* --- Summary fullpage mode --- */
.cfg-page.summary-active .cfg-layout { display: none; }
.cfg-page.summary-active .cfg-detail-layout { display: none; }
.cfg-header.cfg-header-hidden { display: none; }
.cfg-page.summary-active .cfg-summary-section { display: block; }
.cfg-page:not(.summary-active) .cfg-summary-section { display: none; }
.cfg-summary-back {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .9rem; color: var(--color-primary);
    text-decoration: none; cursor: pointer;
    margin-bottom: 1.5rem; font-weight: 500;
    background: none; border: none; padding: 0;
}
.cfg-summary-back:hover { text-decoration: underline; }

/* --- Compare button --- */
.cfg-compare-added {
    background: var(--color-success) !important;
    color: #fff !important;
    pointer-events: none;
}

/* --- Login gate for compare --- */
.cfg-compare-gate {
    text-align: center; padding: 2.5rem 1.75rem;
    background: #fff; border-radius: 12px;
    max-width: 480px; margin: 0 auto;
    box-shadow: 0 2px 16px rgba(15,52,128,.05);
    border: 1px solid rgba(26,86,219,.05);
}
.cfg-compare-gate-icon { color: var(--color-primary); margin-bottom: 1rem; }
.cfg-compare-gate h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: .5rem; }
.cfg-compare-gate p { color: var(--color-gray); margin-bottom: 1rem; font-size: .85rem; line-height: 1.5; }
.cfg-compare-gate .btn-primary {
    background: linear-gradient(135deg, #1a56db 0%, #2563eb 100%);
    box-shadow: 0 2px 10px rgba(26,86,219,.25);
    border-radius: 8px; padding: .55rem 1.5rem; font-size: .85rem;
}
.cfg-compare-gate-note { font-size: .72rem; color: var(--color-gray-light); margin-top: .75rem; }

/* --- Compare table --- */
.cfg-compare-table-wrap { overflow-x: auto; }
.cfg-compare-table {
    width: 100%; border-collapse: collapse;
    font-size: .82rem;
}
.cfg-compare-table th, .cfg-compare-table td {
    padding: .5rem .75rem; border-bottom: 1px solid var(--color-bg-alt);
    text-align: left; vertical-align: top;
}
.cfg-compare-table th { background: var(--color-bg); font-weight: 600; }
.cfg-cmp-car-cell { text-align: center; min-width: 180px; }
.cfg-cmp-car-img {
    width: 100%; max-width: 190px; height: auto;
    border-radius: var(--radius); margin-bottom: .35rem; display: block;
    margin-left: auto; margin-right: auto;
}
.cfg-cmp-label { font-weight: 600; color: var(--color-gray); white-space: nowrap; min-width: 110px; }
.cfg-compare-empty { text-align: center; padding: 2rem; color: var(--color-gray); }
.cfg-compare-actions {
    display: flex; gap: .5rem; justify-content: center;
    margin-top: 1.25rem; padding-top: 1rem;
    border-top: 1px solid var(--color-bg-alt);
}
.btn-error { background: var(--color-error) !important; color: #fff !important; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .cfg-layout { grid-template-columns: 1fr; }
    .cfg-detail-layout { grid-template-columns: 1fr; }
    .cfg-detail-right { position: static; order: 1; }
    .cfg-gallery { position: relative; top: 0; }
    .cfg-summary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .cfg-header h1 { font-size: 1.05rem; }
    .cfg-header-logo { width: 38px; height: 38px; padding: 4px; }
    .cfg-header-content { gap: .5rem; }
    .cfg-gallery-main { aspect-ratio: 16/9; }
    .cfg-gallery-thumbs img { width: 52px; height: 36px; }
    .cfg-pricebar-inner { padding: .35rem .75rem; }
    .cfg-pricebar-logo { width: 22px; height: 22px; }
    .cfg-pricebar-total { font-size: .9rem; }
    .cfg-tab { padding: .4rem .65rem; font-size: .75rem; }
    .cfg-version-features { font-size: .7rem; }
    .cfg-summary-section { padding: 1rem; }
    .cfg-summary-row { grid-template-columns: 1fr 1fr; }
    .cfg-summary-row span:first-child { grid-column: 1 / -1; }
    .cfg-spec-hero { grid-template-columns: 1fr; }
    .cfg-spec-equip-list { grid-template-columns: 1fr; }
    .cfg-contact-form .form-row { grid-template-columns: 1fr; }
    .cfg-models-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .cfg-swatch { width: 38px; height: 38px; }
    .cfg-models-grid { grid-template-columns: 1fr; }
    .cfg-summary-actions { flex-direction: column; }
    .cfg-summary-actions .btn { width: 100%; justify-content: center; }
}

/* ============================================
   SIMPLE MODE — BMW / Audi / Ford configurator
   ============================================ */
.cfg-simple { padding-bottom: 2rem; }
.cfg-simple-hero {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
    box-shadow: 0 2px 12px rgba(15,52,128,.05);
}
.cfg-simple-hero img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .4s cubic-bezier(.25,.8,.25,1);
}
.cfg-simple-hero:hover img { transform: scale(1.02); }
.cfg-simple-price-badge {
    position: absolute;
    bottom: .85rem;
    right: .85rem;
    background: linear-gradient(135deg, rgba(15,23,42,.85) 0%, rgba(30,41,59,.9) 100%);
    color: #fff;
    padding: .4rem 1rem;
    border-radius: 8px;
    font-size: .85rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.cfg-simple-price-badge strong {
    font-size: 1.1rem;
    color: var(--color-accent);
}

.cfg-simple-section {
    margin-bottom: 1.25rem;
}

.cfg-simple-versions {
    display: grid;
    gap: .65rem;
}
.cfg-simple-version-card {
    background: #fff;
    border: 1.5px solid rgba(26,86,219,.08);
    border-radius: 10px;
    padding: .85rem 1.1rem;
    transition: all .3s cubic-bezier(.25,.8,.25,1);
    box-shadow: 0 1px 4px rgba(15,52,128,.03);
}
.cfg-simple-version-card:hover {
    border-color: rgba(26,86,219,.2);
    box-shadow: 0 4px 16px rgba(26,86,219,.08);
    transform: translateY(-1px);
}
.cfg-simple-version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .3rem;
}
.cfg-simple-version-header .cfg-version-name {
    font-weight: 700;
    font-size: .95rem;
}
.cfg-simple-version-header .cfg-version-price {
    font-weight: 700;
    font-size: .95rem;
    color: var(--color-primary);
    background: rgba(26,86,219,.06); padding: 1px 8px; border-radius: 6px;
}
.cfg-simple-version-card .cfg-version-desc {
    color: var(--color-gray);
    font-size: .8rem;
    margin: 0;
    line-height: 1.45;
}

.cfg-simple-actions {
    display: flex;
    gap: .65rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.cfg-simple-actions .btn {
    flex: 1;
    min-width: 180px;
    text-align: center;
    border-radius: 8px;
    font-size: .85rem;
}
.cfg-simple-actions .btn-primary {
    background: linear-gradient(135deg, #1a56db 0%, #2563eb 100%);
    box-shadow: 0 2px 10px rgba(26,86,219,.2);
}
.cfg-simple-actions .btn-accent {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 10px rgba(245,158,11,.2);
}

@media (max-width: 768px) {
    .cfg-simple-version-header {
        flex-direction: column;
        align-items: flex-start;
        gap: .2rem;
    }
    .cfg-simple-actions {
        flex-direction: column;
    }
    .cfg-simple-actions .btn {
        min-width: auto;
    }
}

/* --- Print --- */
@media print {
    /* Hide everything except summary */
    .site-header, .accent-bar, .mobile-menu, .site-stats-bar,
    #footer-brand, footer, .cfg-pricebar, .cfg-back,
    .cfg-gallery-prev, .cfg-gallery-next, .cfg-gallery-counter,
    .cfg-contact-section, .cfg-summary-back, .cfg-summary-actions,
    .cfg-layout, .cfg-detail-layout, .cfg-header, .compare-badge,
    .ob-breadcrumb-bar, .ob-hero-bar { display: none !important; }

    /* Show and style summary */
    .cfg-summary-section {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
    }
    .cfg-page { padding: 0 !important; margin: 0 !important; }
    .cfg-page.summary-active { margin: 0; }

    /* Hero layout */
    .cfg-spec-hero { grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
    .cfg-spec-hero-img img { max-height: 220px; object-fit: contain; }
    .cfg-spec-total-box { background: #222 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .cfg-spec-total-price { color: #e68a00 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    /* Tables */
    .cfg-summary-table { margin-bottom: .75rem; }
    .cfg-summary-row { padding: .35rem 0 !important; font-size: .8rem !important; }
    .cfg-summary-total { background: #f5f5f5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    /* Blocks */
    .cfg-spec-block { break-inside: avoid; margin-bottom: 1rem; padding-bottom: .75rem; }
    .cfg-spec-block-title {
        font-size: .75rem !important;
        color: #1a56db !important;
        border-bottom-color: #1a56db !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Equipment list */
    .cfg-spec-equip-list { grid-template-columns: 1fr 1fr; }
    .cfg-spec-equip-list li { font-size: .7rem !important; }
    .cfg-spec-equip-list li::before { color: #16a34a !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    /* Disclaimer */
    .cfg-disclaimer { font-size: .65rem !important; }

    /* Remove container max-width and background for clean print */
    .container { max-width: 100% !important; padding: 0 1rem !important; }
    body, .cfg-page, .cfg-summary-section { background: #fff !important; }
    html { background: #fff !important; }
}

/* =========================================================
   LEASING PRINT BLOCK (in summary/spec printout)
========================================================= */
.cfg-leasing-print-box {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
    border-radius: 10px; padding: 16px; margin-bottom: 6px;
    border: 1px solid rgba(26,86,219,.12);
}
.cfg-leasing-print-main {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    margin-bottom: 14px;
}
.cfg-leasing-print-rata {
    text-align: center; padding: 14px 10px;
    background: #fff; border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.cfg-leasing-print-label {
    display: block; font-size: .7rem; color: #64748b;
    text-transform: uppercase; letter-spacing: .03em;
    margin-bottom: 4px;
}
.cfg-leasing-print-value {
    display: block; font-size: 1.3rem; font-weight: 800;
    color: #1a56db; letter-spacing: -.01em;
}
.cfg-leasing-print-details .cfg-summary-row {
    padding: .35rem 0; font-size: .82rem;
}
.cfg-leasing-print .lc-disclaimer {
    font-size: .68rem; color: #94a3b8; margin-top: 8px;
}
@media print {
    .cfg-leasing-print-box {
        background: #f5f7ff !important;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
        border: 1px solid #ccc !important;
    }
    .cfg-leasing-print-rata {
        background: #fff !important;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    .cfg-leasing-print-value {
        color: #1a56db !important;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
}

/* =========================================================
   LEASING CALCULATOR WIDGET
========================================================= */
.cfg-leasing-calc {
    margin-top: 10px;
    background: #fff; border-radius: 12px;
    border: 1px solid rgba(26,86,219,.06);
    box-shadow: 0 2px 16px rgba(15,52,128,.06);
    overflow: hidden;
}
.cfg-leasing-calc h4 {
    margin: 0; padding: 10px 14px;
    font-size: 12px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #1a56db 0%, #0f3480 100%);
    position: relative;
}
.cfg-leasing-calc h4::after {
    content: ; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 80% 30%, rgba(255,255,255,.1) 0%, transparent 60%);
    pointer-events: none;
}
.lc-result {
    padding: 12px 14px; background: #f0f4ff;
    border-bottom: 1px solid rgba(26,86,219,.08);
}
.lc-result-main {
    display: flex; justify-content: space-between; align-items: center;
}
.lc-result-label { font-size: 11px; color: #666; }
.lc-result-val { font-size: 20px; font-weight: 800; color: var(--color-primary, #1a56db); }
.lc-result-sub {
    display: flex; justify-content: space-between; font-size: 11px; color: #888; margin-top: 4px;
}
.lc-result-sub strong { font-weight: 700; color: #555; }
.lc-toggle-wrap { padding: 8px 14px 0; }
.lc-toggle {
    display: flex; border: 1px solid rgba(26,86,219,.15); border-radius: 6px;
    overflow: hidden; font-size: 11px;
}
.lc-toggle label {
    flex: 1; text-align: center; padding: 6px 8px; cursor: pointer;
    font-weight: 600; color: #888; transition: all .2s; margin: 0;
}
.lc-toggle input { display: none; }
.lc-toggle input:checked + label {
    background: var(--color-primary, #1a56db); color: #fff;
}
.lc-form { display: flex; flex-direction: column; gap: 8px; padding: 8px 14px 12px; }
.lc-row label {
    display: block; font-size: 11px; font-weight: 600; color: #555; margin-bottom: 2px;
}
.lc-cur { color: var(--color-primary, #1a56db); font-weight: 700; }
.lc-val-display {
    font-size: 13px; font-weight: 700; color: #222; padding: 5px 8px;
    background: #f5f3fa; border-radius: 6px; text-align: center;
}
.lc-range {
    width: 100%; height: 5px; border-radius: 3px; background: #e0dce8;
    outline: none; appearance: none; -webkit-appearance: none; cursor: pointer; margin: 3px 0;
}
.lc-range::-webkit-slider-thumb {
    appearance: none; -webkit-appearance: none; width: 16px; height: 16px;
    border-radius: 50%; background: var(--color-primary, #1a56db); cursor: pointer;
}
.lc-range::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--color-primary, #1a56db); cursor: pointer; border: none;
}
.lc-range-labels {
    display: flex; justify-content: space-between; font-size: 9px; color: #999; margin-top: 1px;
}
.lc-disclaimer {
    font-size: 9px; color: #999; padding: 0 14px 10px; line-height: 1.3;
}

/* Kompaktowy sidebar */
.cfg-sidebar-summary h4 { padding: 10px 14px; font-size: 12px; }
.cfg-sidebar-rows { padding: 2px 14px 0; }
.cfg-sidebar-row { padding: 5px 0; font-size: 11px; }
.cfg-sidebar-total { margin: 0 14px; padding: 8px 0; }
.cfg-sidebar-total strong { font-size: 1.05rem; }
.cfg-sidebar-actions { padding: 4px 14px 10px; }
.cfg-sidebar-actions .btn { font-size: .78rem; padding: 8px 12px; }
.cfg-sidebar-actions .btn-sm { padding: 6px 10px; font-size: .72rem; }

.cfg-sidebar-sticky {
    position: sticky;
    top: 76px;
}

/* ─── EMBED MODE — kompaktowe kafelki konfiguratora ─── */
body.embed-mode .cfg-models-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem; }
body.embed-mode .cfg-model-card { border-radius: 8px; }
body.embed-mode .cfg-model-img img { height: 110px; }
body.embed-mode .cfg-model-info { padding: .5rem .7rem; }
body.embed-mode .cfg-model-info h3 { font-size: .8rem; }
body.embed-mode .cfg-model-type { font-size: .68rem; margin-bottom: .3rem; }
body.embed-mode .cfg-model-price { font-size: .85rem; margin-bottom: .3rem; }
body.embed-mode .cfg-model-rate { font-size: .68rem !important; }
body.embed-mode .cfg-model-info .btn-primary { font-size: .75rem; padding: .3rem .7rem; }
body.embed-mode .cfg-model-brand img { height: 18px; }
