*{box-sizing:border-box}
html{scroll-behavior:smooth}
:root{
    --orange:#ff5a0a;
    --orange-dark:#e64b00;
    --ink:#202a31;
    --ink-soft:#56616a;
    --line:#e6e9ec;
    --bg:#f7f8f9;
    --panel:#fff;
    --muted:#8c959d;
}
body{
    margin:0;
    font-family:Inter,Segoe UI,Arial,sans-serif;
    color:var(--ink);
    background:#fff;
}
button,input{font:inherit}
button{cursor:pointer}
a{color:inherit;text-decoration:none}
.container{width:min(1180px,calc(100% - 40px));margin:0 auto}

.header{
    position:sticky;
    top:0;
    z-index:50;
    background:rgba(255,255,255,.96);
    border-bottom:1px solid var(--line);
    backdrop-filter:blur(12px);
}
.header-inner{
    min-height:86px;
    display:flex;
    align-items:center;
    gap:34px;
}
.brand{display:flex;align-items:center;min-width:250px}
.brand-logo{
    width:235px;
    max-height:72px;
    object-fit:contain;
    object-position:left center;
}
.navigation{
    display:flex;
    align-items:center;
    gap:28px;
    margin-left:auto;
    font-size:14px;
    font-weight:700;
}
.navigation a:hover{color:var(--orange)}
.header-actions{display:flex;align-items:center;gap:10px}
.header-link,.cart-button{
    border:1px solid var(--line);
    background:#fff;
    border-radius:10px;
    min-height:42px;
    padding:0 15px;
    color:var(--ink);
    font-weight:700;
}
.header-link:hover,.cart-button:hover{border-color:#cfd5da}
.cart-button{display:flex;align-items:center;gap:8px}
.cart-count{
    min-width:22px;height:22px;padding:0 6px;
    display:inline-flex;align-items:center;justify-content:center;
    border-radius:20px;background:var(--orange);color:#fff;font-size:12px;
}

.search-section{padding:46px 0 28px}
.search-shell{
    border:1px solid var(--line);
    border-radius:18px;
    padding:34px;
    background:linear-gradient(135deg,#fff 0%,#fafafa 100%);
    box-shadow:0 14px 45px rgba(27,36,43,.06);
}
.search-heading{display:flex;justify-content:space-between;gap:30px;margin-bottom:28px}
.eyebrow,.section-label{
    display:inline-block;
    color:var(--orange);
    font-size:12px;
    letter-spacing:.14em;
    font-weight:800;
}
.search-heading h1,.section-heading h2,.results-header h2,.vin-copy h2{
    margin:7px 0 6px;
    letter-spacing:-.035em;
}
.search-heading h1{font-size:36px}
.search-heading p,.vin-copy p{margin:0;color:var(--ink-soft);line-height:1.6}

.search-box{
    border:1px solid var(--line);
    border-radius:14px;
    background:#fff;
    padding:18px;
}
.search-tabs{display:flex;gap:8px;margin-bottom:14px}
.search-tab{
    border:0;
    background:#f0f2f3;
    color:#5e6870;
    border-radius:8px;
    padding:9px 14px;
    font-weight:700;
}
.search-tab.active{background:var(--ink);color:#fff}
.search-row{display:grid;grid-template-columns:1fr 150px;gap:10px}
.search-input-wrapper{position:relative}
.search-icon{
    position:absolute;left:17px;top:50%;transform:translateY(-50%);
    font-size:24px;color:#90989f;
}
.search-input-wrapper input{
    width:100%;
    height:54px;
    border:1px solid #d9dde1;
    border-radius:9px;
    padding:0 16px 0 50px;
    outline:none;
    font-size:16px;
}
.search-input-wrapper input:focus{
    border-color:var(--orange);
    box-shadow:0 0 0 3px rgba(255,90,10,.12);
}
.search-button,.checkout-submit,.vin-focus-button{
    border:0;
    background:var(--orange);
    color:#fff;
    font-weight:800;
    border-radius:9px;
    padding:0 20px;
}
.search-button:hover,.checkout-submit:hover,.vin-focus-button:hover{background:var(--orange-dark)}
.search-button:disabled{opacity:.55;cursor:wait}
.search-hint{margin-top:10px;color:var(--muted);font-size:12px}
.section-heading{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:20px;
    margin-bottom:22px;
}
.section-heading h2{font-size:28px}
.categories{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:12px;
}
.category{
    min-height:138px;
    display:flex;
    align-items:center;
    gap:18px;
    border:1px solid var(--line);
    background:#f8f8f8;
    border-radius:12px;
    padding:22px;
    transition:.18s ease;
}
.category:hover{
    transform:translateY(-2px);
    background:#fff;
    border-color:#ffb48f;
    box-shadow:0 10px 30px rgba(27,36,43,.07);
}
.category-icon{
    width:54px;height:54px;flex:0 0 54px;
    display:flex;align-items:center;justify-content:center;
    border-radius:50%;
    background:#fff;
    color:var(--orange);
    border:2px solid var(--ink);
    font-size:25px;
    font-weight:900;
}
.category strong{display:block;font-size:16px;margin-bottom:7px}
.category small{display:block;color:var(--ink-soft);line-height:1.35}

.results-section{padding:22px 0 35px}
.results-card{
    border:1px solid var(--line);
    border-radius:16px;
    padding:28px;
    background:#fff;
    box-shadow:0 10px 35px rgba(27,36,43,.05);
}
.results-header{
    display:flex;align-items:flex-end;justify-content:space-between;
    gap:20px;margin-bottom:20px;
}
.results-header h2{font-size:28px}
.results-header p{margin:0;color:var(--ink-soft)}
.results-count{
    background:#f1f3f4;
    border-radius:8px;
    padding:10px 14px;
    font-weight:800;
}
.manufacturer-list{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.manufacturer-button{
    border:1px solid var(--line);
    background:#fff;
    text-align:left;
    border-radius:10px;
    padding:16px;
}
.manufacturer-button:hover{border-color:var(--orange)}
.manufacturer-brand{font-weight:800}
.manufacturer-count{color:var(--muted);margin-top:5px;font-size:13px}
.offer-block+.offer-block{margin-top:26px}
.offer-block-title{
    font-weight:900;
    font-size:18px;
    margin-bottom:10px;
}
.offer{
    display:grid;
    grid-template-columns:minmax(0,1.8fr) 150px 170px 120px;
    align-items:center;
    gap:20px;
    padding:18px;
    border:1px solid var(--line);
    border-radius:10px;
    margin-bottom:9px;
}
.offer.best{border-color:#ffb28a;background:#fffaf7}
.best-label{
    display:inline-block;
    font-size:11px;
    font-weight:900;
    color:#fff;
    background:var(--orange);
    border-radius:5px;
    padding:4px 7px;
    margin-bottom:7px;
}
.offer-title{font-weight:800;line-height:1.35}
.offer-meta{display:flex;gap:7px;margin-top:7px;color:var(--ink-soft);font-size:13px}
.price-label{font-size:10px;color:var(--muted);letter-spacing:.12em;font-weight:800}
.price{font-size:21px;font-weight:900;margin-top:5px}
.stock{font-weight:800;margin-top:5px}
.delivery{font-size:12px;color:var(--muted);margin-top:4px}
.buy-button{
    border:0;
    background:var(--ink);
    color:#fff;
    border-radius:8px;
    min-height:42px;
    font-weight:800;
}
.buy-button:hover{background:var(--orange)}

.vin-section{padding:35px 0 42px}
.vin-card{
    position:relative;
    overflow:hidden;
    min-height:270px;
    border-radius:16px;
    padding:44px;
    background:#f4f5f6;
    border:1px solid var(--line);
    display:grid;
    grid-template-columns:1fr 1fr;
    align-items:center;
}
.vin-copy{max-width:520px;position:relative;z-index:2}
.vin-copy h2{font-size:32px}
.vin-focus-button{height:44px;margin-top:20px}
.vin-graphic{position:relative;height:200px}
.vin-gear{
    position:absolute;right:80px;top:-60px;
    font-size:240px;color:#e2e5e7;line-height:1;
}
.vin-car{
    position:absolute;right:105px;bottom:10px;
    font-size:105px;filter:grayscale(1);opacity:.35;
}

.advantages{padding:8px 0 50px}
.advantages-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:12px;
}
.advantage{
    display:flex;align-items:center;gap:13px;
    border-top:1px solid var(--line);
    padding:22px 4px;
}
.advantage-icon{
    width:42px;height:42px;flex:0 0 42px;
    border-radius:50%;
    display:flex;align-items:center;justify-content:center;
    color:var(--orange);
    border:2px solid var(--ink);
    font-weight:900;
}
.advantage strong{display:block;font-size:14px}
.advantage span{display:block;color:var(--muted);font-size:12px;margin-top:4px;line-height:1.35}

.status{
    position:fixed;
    right:20px;
    bottom:20px;
    z-index:100;
    padding:13px 16px;
    border-radius:9px;
    background:var(--ink);
    color:#fff;
    box-shadow:0 12px 30px rgba(0,0,0,.18);
}
.status.error{background:#b42318}
.hidden{display:none!important}

.cart-panel{
    width:min(1180px,calc(100% - 40px));
    margin:28px auto;
    border:1px solid var(--line);
    border-radius:16px;
    background:#fff;
    padding:28px;
    box-shadow:0 14px 45px rgba(27,36,43,.08);
}
.cart-heading{
    display:flex;align-items:center;justify-content:space-between;gap:15px;
    border-bottom:1px solid var(--line);
    padding-bottom:15px;
    margin-bottom:18px;
}
.cart-heading h2,.cart-heading h3{margin:0}
.cart-heading button,#clearCart,#logoutButton,#refreshOrders,#moreOrders,.account-tabs button{
    border:1px solid var(--line);
    background:#fff;
    border-radius:8px;
    padding:9px 12px;
    font-weight:700;
}
.cart-line{
    display:grid;
    grid-template-columns:minmax(0,1.6fr) 130px 140px 120px auto;
    gap:14px;
    align-items:center;
    padding:15px 0;
    border-bottom:1px solid var(--line);
}
.cart-line p{margin:4px 0;color:var(--muted);font-size:13px}
.cart-quantity{display:flex;gap:5px;align-items:center}
.cart-quantity button{width:30px;height:30px;border:1px solid var(--line);background:#fff;border-radius:6px}
.cart-quantity input{width:52px;height:30px;text-align:center;border:1px solid var(--line);border-radius:6px}
.cart-totals{
    display:flex;justify-content:space-between;align-items:center;
    gap:15px;padding:20px 0;
}
.buyer-fields{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.buyer-fields label,.account-form label{display:grid;gap:6px;font-size:13px;font-weight:700}
.buyer-fields input,.account-form input{
    width:100%;height:44px;border:1px solid #d9dde1;border-radius:8px;padding:0 12px;
}
.checkout-note{color:var(--ink-soft);font-size:13px;line-height:1.5}
.checkout-submit{min-height:44px}
.account-tabs{display:flex;gap:8px;margin-bottom:18px}
.account-form{display:grid;gap:12px;max-width:520px}
.account-order{
    display:grid;
    grid-template-columns:1fr 120px 150px 180px auto;
    gap:14px;align-items:center;
    border-bottom:1px solid var(--line);
    padding:14px 0;
}
.account-order-line{padding:12px 0;border-bottom:1px solid var(--line)}

.footer{
    border-top:1px solid var(--line);
    background:#f7f8f9;
    padding:34px 0;
}
.footer-inner{
    display:grid;
    grid-template-columns:1fr auto auto;
    gap:45px;
    align-items:center;
}
.footer-logo-image{width:190px;max-height:70px;object-fit:contain;object-position:left center}
.footer p{margin:8px 0 0;color:var(--ink-soft);font-size:13px}
.footer-links{display:flex;gap:18px;font-size:13px;font-weight:700}
.footer-links a:hover{color:var(--orange)}
.footer-copy{font-size:12px;color:var(--muted)}

.empty{
    padding:18px;border:1px dashed var(--line);border-radius:8px;color:var(--muted)
}

@media(max-width:980px){
    .navigation{display:none}
    .brand{min-width:0}
    .header-inner{gap:15px}
    .header-actions{margin-left:auto}
    .categories{grid-template-columns:repeat(2,1fr)}
    .advantages-grid{grid-template-columns:repeat(2,1fr)}
    .offer{grid-template-columns:1fr 130px 150px}
    .offer .buy-button{grid-column:1/-1}
    .vin-card{grid-template-columns:1fr}
    .vin-graphic{display:none}
    .manufacturer-list{grid-template-columns:repeat(2,1fr)}
    .cart-line{grid-template-columns:1fr 120px 130px}
    .cart-line>*:nth-child(n+4){grid-column:auto}
    .account-order{grid-template-columns:1fr 1fr}
}

@media(max-width:640px){
    .container,.cart-panel{width:min(100% - 24px,1180px)}
    .header-inner{min-height:72px}
    .brand-logo{width:150px;max-height:54px}
    .header-link{padding:0 10px}
    .cart-button>span:nth-child(2){display:none}
    .search-section{padding-top:22px}
    .search-shell{padding:20px}
    .search-heading h1{font-size:28px}
    .search-row{grid-template-columns:1fr}
    .search-button{height:50px}
    .categories{grid-template-columns:1fr}
    .category{min-height:105px}
    .results-card{padding:18px}
    .results-header{align-items:flex-start;flex-direction:column}
    .manufacturer-list{grid-template-columns:1fr}
    .offer{grid-template-columns:1fr;gap:12px}
    .vin-card{padding:26px}
    .advantages-grid{grid-template-columns:1fr}
    .cart-panel{padding:18px}
    .cart-line{grid-template-columns:1fr}
    .buyer-fields{grid-template-columns:1fr}
    .account-order{grid-template-columns:1fr}
    .footer-inner{grid-template-columns:1fr;gap:18px}
    .footer-links{flex-wrap:wrap}
}

/* KaParts cart refinement */
.cart-panel{
    width:min(100% - 32px,1180px);
    margin:32px auto;
    padding:28px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:18px;
    box-shadow:0 14px 40px rgba(20,28,36,.08);
}

.cart-heading{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding-bottom:18px;
    margin-bottom:20px;
    border-bottom:1px solid var(--line);
}

.cart-heading h2{
    font-size:28px;
    line-height:1.2;
}

#cartItems{
    display:grid;
    gap:12px;
}

.cart-line{
    display:grid;
    grid-template-columns:minmax(0,1fr) 130px 150px 120px 100px;
    align-items:center;
    gap:16px;
    padding:16px;
    background:#fafafa;
    border:1px solid var(--line);
    border-radius:12px;
}

.cart-line strong{
    color:var(--ink);
}

.cart-line p{
    margin:4px 0;
    color:var(--muted);
}

.cart-quantity{
    justify-content:center;
}

.cart-quantity button{
    cursor:pointer;
    transition:.15s ease;
}

.cart-quantity button:hover{
    border-color:var(--orange);
    color:var(--orange);
}

.cart-totals{
    margin-top:20px;
    padding:18px 20px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    background:#fff7f2;
    border:1px solid #ffd8c3;
    border-radius:12px;
}

.cart-totals strong{
    font-size:20px;
}

#checkoutForm{
    margin-top:26px;
    padding-top:24px;
    border-top:1px solid var(--line);
}

#checkoutForm h3{
    margin:0 0 18px;
    font-size:21px;
}

.buyer-fields input{
    min-height:46px;
    padding:0 13px;
    background:#fff;
}

.checkout-note{
    margin:18px 0;
    padding:12px 14px;
    background:#f7f7f7;
    border-radius:9px;
}

.checkout-submit{
    width:100%;
    min-height:50px;
    font-size:16px;
    font-weight:800;
}

#checkoutMessage{
    margin:16px 0 0;
    line-height:1.5;
}

@media (max-width:800px){
    .cart-panel{
        width:min(100% - 20px,1180px);
        margin:18px auto;
        padding:18px;
        border-radius:14px;
    }

    .cart-heading{
        align-items:flex-start;
        flex-direction:column;
    }

    .cart-line{
        grid-template-columns:1fr;
        gap:10px;
    }

    .cart-quantity{
        justify-content:flex-start;
    }

    .cart-totals{
        align-items:flex-start;
        flex-direction:column;
    }
}
/* KaParts mobile refinement */
@media(max-width:640px){
    .header{
        position:sticky;
        top:0;
        z-index:30;
    }

    .header-inner{
        min-height:64px;
        gap:8px;
    }

    .brand-logo{
        width:125px;
        max-height:48px;
    }

    .header-actions{
        gap:6px;
    }

    .header-link,
    .cart-button{
        min-height:38px;
        padding:0 9px;
        border-radius:8px;
        font-size:13px;
    }

    .cart-button{
        gap:5px;
    }

    .cart-count{
        min-width:20px;
        height:20px;
        padding:0 5px;
        font-size:11px;
    }

    .search-shell{
        padding:16px;
        border-radius:14px;
    }

    .search-heading h1{
        font-size:25px;
        line-height:1.15;
    }

    .search-heading p{
        font-size:14px;
        line-height:1.45;
    }

    .search-tabs{
        width:100%;
    }

    .search-tab{
        flex:1;
        text-align:center;
    }

    .search-input-wrapper input{
        min-height:50px;
        font-size:16px;
    }

    .categories{
        gap:9px;
    }

    .category{
        min-height:88px;
        padding:14px;
    }

    .category-icon{
        flex:0 0 auto;
    }

    .category strong{
        font-size:15px;
    }

    .category small{
        font-size:12px;
        line-height:1.35;
    }

    .advantages-grid{
        grid-template-columns:1fr;
    }

    .vin-card{
        padding:20px;
    }

    .vin-copy h2{
        font-size:24px;
    }
}
/* Offer quantity selector */
.offer-quantity{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:6px;
}

.offer-quantity button{
    width:34px;
    height:38px;
    border:1px solid var(--line);
    background:#fff;
    border-radius:8px;
    cursor:pointer;
    font-size:18px;
    line-height:1;
}

.offer-quantity button:hover{
    border-color:var(--orange);
    color:var(--orange);
}

.offer-quantity-input{
    width:52px;
    height:38px;
    padding:0 4px;
    text-align:center;
    border:1px solid var(--line);
    border-radius:8px;
    background:#fff;
    font-weight:700;
    -moz-appearance:textfield;
}

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

@media(max-width:640px){
    .offer-quantity{
        justify-content:flex-start;
    }
}
/* Offer layout with quantity */
.offer{
    grid-template-columns:minmax(0,1.8fr) 150px 170px 130px 120px;
}

@media(max-width:980px){
    .offer{
        grid-template-columns:1fr 130px 150px 120px;
    }

    .offer .offer-quantity{
        grid-column:1/4;
        justify-content:flex-end;
    }

    .offer .buy-button{
        grid-column:4;
    }
}

@media(max-width:640px){
    .offer{
        grid-template-columns:1fr;
    }

    .offer .offer-quantity,
    .offer .buy-button{
        grid-column:1;
    }

    .offer .offer-quantity{
        justify-content:flex-start;
    }

    .offer .buy-button{
        width:100%;
    }
}
/* Separate account page */
.account-page{min-height:calc(100vh - 220px);background:#f7f8f9;padding-bottom:50px}
.account-hero{background:#fff;border-bottom:1px solid var(--line);padding:42px 0 34px}
.account-hero h1{margin:6px 0 8px;font-size:34px;line-height:1.1}
.account-hero p{margin:0;color:var(--ink-soft);font-size:15px}
.account-layout{padding-top:28px;display:grid;gap:20px}
.account-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:24px;box-shadow:0 10px 32px rgba(27,36,43,.06)}
.account-message:empty{display:none}
.account-message{padding:12px 14px;border-radius:8px;background:#fff3ed;border:1px solid #ffd4bf;color:#8a3510;font-size:14px}
.account-tabs .active{border-color:var(--orange);color:var(--orange);background:#fff7f3}
.account-form h2{margin:0 0 4px}
.account-primary-button{min-height:44px;border:0;border-radius:8px;background:var(--orange);color:#fff;font-weight:800;padding:0 18px;cursor:pointer}
.account-secondary-button{border:1px solid var(--line);background:#fff;border-radius:8px;padding:9px 12px;font-weight:700;cursor:pointer}
.account-hint{margin:0;color:var(--muted);font-size:12px;line-height:1.5}
.account-profile-card{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}
.account-profile-card h2{margin:5px 0 12px}
.account-profile{display:grid;gap:5px;color:var(--ink-soft);font-size:14px}
.section-label,.eyebrow{font-size:11px;font-weight:800;letter-spacing:.08em;color:var(--orange)}
.account-orders-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:8px}
.account-orders-header h2{margin:5px 0 0}
.account-orders{display:grid}
.account-order{cursor:pointer}
.account-order:hover{background:#fafafa}
.account-order-details h2{margin-top:0}
.account-order-line{display:grid;grid-template-columns:minmax(0,1fr) 80px 120px;gap:12px;align-items:center}
@media(max-width:760px){.account-hero{padding:28px 0 24px}.account-hero h1{font-size:28px}.account-card{padding:18px}.account-profile-card,.account-orders-header{align-items:stretch;flex-direction:column}.account-order{grid-template-columns:1fr 1fr;gap:8px}.account-order>*:first-child{grid-column:1/-1}.account-order-line{grid-template-columns:1fr;gap:4px}.account-form{max-width:none}}
/* CATALOG FILTER SIDEBAR */

.catalog-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.catalog-results {
    min-width: 0;
}

.catalog-filters {
    position: sticky;
    top: 90px;
    border: 1px solid var(--border, var(--line, #dfe3e8));
    border-radius: 12px;
    background: #fff;
    padding: 18px;
}

.catalog-filters-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border, var(--line, #dfe3e8));
}

.catalog-filters-heading strong {
    font-size: 18px;
}

#filtersReset {
    border: 0;
    background: transparent;
    color: var(--blue, var(--orange, #1769e0));
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.filter-group {
    padding: 17px 0;
    border-bottom: 1px solid var(--border, var(--line, #dfe3e8));
}

.filter-title {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 800;
}

#filterBrands {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

.filter-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.filter-brand input {
    width: 16px;
    height: 16px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--blue, var(--orange, #1769e0));
}

.filter-brand-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-brand-count {
    color: #98a2b3;
    font-size: 11px;
}

.filter-price-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

#filterPriceMin,
#filterPriceMax,
#filterDelivery {
    width: 100%;
    height: 40px;
    min-width: 0;
    border: 1px solid var(--border, var(--line, #d9dde1));
    border-radius: 8px;
    background: #fff;
    padding: 0 10px;
    outline: none;
    font: inherit;
    font-size: 13px;
}

#filterPriceMin:focus,
#filterPriceMax:focus,
#filterDelivery:focus {
    border-color: var(--blue, var(--orange, #1769e0));
}

#filterSummary {
    margin-top: 14px;
    color: #98a2b3;
    font-size: 12px;
    line-height: 1.4;
}

@media (max-width: 900px) {

    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .catalog-filters {
        position: static;
    }

    #filterBrands {
        max-height: 190px;
    }
}

/* BRAND TEXT SEARCH V1 */

#filterBrandSearch {
    width: 100%;
    height: 40px;
    box-sizing: border-box;
    margin-bottom: 12px;
    border: 1px solid var(--border, var(--line, #d9dde1));
    border-radius: 8px;
    background: #fff;
    padding: 0 11px;
    outline: none;
    font: inherit;
    font-size: 13px;
}

#filterBrandSearch:focus {
    border-color: var(--blue, var(--orange, #1769e0));
}

/* DELIVERY EMPHASIS V1 */

.offer .delivery {
    margin-top: 5px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.delivery-choice {
    margin: 20px 0;
}

.delivery-choice h3 {
    margin: 0 0 12px;
}

.delivery-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.delivery-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid #d9dde3;
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
}

.delivery-option input {
    margin-top: 4px;
}

.delivery-option span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.delivery-option strong {
    display: block;
}

.delivery-option small {
    display: block;
    color: #6b7280;
    line-height: 1.35;
}

.ozon-delivery {
    margin-top: 12px;
}

.field-attention {
    border-color: #ff8a00 !important;
    box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.18);
    outline: none;
}

/* OZON DELIVERY PICKER */
.ozon-delivery {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 14px;
    background: rgba(255,255,255,.65);
}

.ozon-delivery > p:first-child {
    margin-top: 0;
}

.ozon-delivery label {
    display: block;
    font-weight: 600;
    margin-top: 12px;
}

.ozon-delivery input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    margin-top: 7px;
    padding: 12px 14px;
    border: 1px solid rgba(0,0,0,.18);
    border-radius: 10px;
    background: #fff;
    font: inherit;
}

.ozon-delivery input[type="text"]:focus {
    outline: 2px solid rgba(0,0,0,.15);
    outline-offset: 1px;
}

#ozonLocalityResults,
#ozonPointResults {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.ozon-choice {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 10px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.ozon-choice:hover {
    border-color: rgba(0,0,0,.28);
    background: rgba(0,0,0,.025);
}

.ozon-choice strong {
    display: block;
    font-weight: 650;
}

.ozon-choice small {
    display: block;
    margin-top: 4px;
    opacity: .65;
}

#ozonSelectedLocality {
    margin: 14px 0 4px;
    font-weight: 600;
}

#ozonSelectedPoint {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(0,0,0,.16);
    border-radius: 12px;
    background: #fff;
}

#ozonSelectedPoint strong {
    display: block;
}

#ozonSelectedPoint p {
    margin: 6px 0 10px;
}

#ozonSelectedPoint button {
    padding: 8px 12px;
    border: 1px solid rgba(0,0,0,.16);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

#ozonPointStep.hidden,
#ozonLocalityStep.hidden,
#ozonSelectedPoint.hidden {
    display: none;
}

@media (max-width: 700px) {
    .ozon-delivery {
        padding: 12px;
    }

    .ozon-choice {
        padding: 11px 12px;
    }
}

/* Shared AI and VIN catalog UI */

.ai-section {
    padding: 34px 0;
    background: #f8fafc;
}

.ai-card {
    background: #fff;
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 12px 35px rgba(25, 60, 100, .06);
}

.ai-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.ai-heading h2 {
    margin: 0 0 6px;
    font-size: 24px;
    color: #101828;
}

.ai-heading p {
    margin: 0;
    color: #667085;
    line-height: 1.5;
}

.ai-badge {
    min-width: 42px;
    height: 42px;
    padding: 0 10px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #edf4ff;
    color: var(--blue);
    font-size: 14px;
    font-weight: 800;
}

.ai-form {
    display: flex;
    gap: 10px;
}

#aiInput {
    flex: 1;
    min-height: 82px;
    resize: vertical;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    padding: 14px 16px;
    font: inherit;
    font-size: 15px;
    line-height: 1.45;
    color: var(--dark);
}

#aiInput:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(23, 105, 224, .10);
}

#aiButton {
    min-width: 145px;
    border: 0;
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    padding: 0 22px;
    font-weight: 700;
}

#aiButton:hover {
    background: var(--blue-dark);
}

#aiButton:disabled {
    opacity: .6;
    cursor: wait;
}

.ai-status {
    margin-top: 16px;
    color: #667085;
    font-size: 14px;
}

.ai-answer {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #f8fbff;
    color: #1d2939;
    line-height: 1.6;
    white-space: pre-wrap;
}

.ai-disclaimer {
    margin-top: 12px;
    color: #98a2b3;
    font-size: 11px;
}

@media (max-width: 650px) {
    .ai-card {
        padding: 20px;
    }

    .ai-form {
        flex-direction: column;
    }

    #aiButton {
        width: 100%;
        min-height: 50px;
    }
}

/* VIN AI V1 */

.vin-part-row {
    margin-bottom: 8px;
}

#vinPartInput {
    width: 100%;
    height: 48px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    padding: 0 16px;
    font: inherit;
    font-size: 15px;
    color: var(--dark);
}

#vinPartInput:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(23, 105, 224, .10);
}

.vin-ai-result {
    margin: 10px 4px 2px;
    padding: 12px 14px;
    border-radius: 9px;
    background: #f4f8ff;
    border: 1px solid #d7e5f8;
    color: #344054;
    font-size: 13px;
    line-height: 1.5;
}

/* VIN CONFIRM V2 */

.vin-confirm-panel {
    margin: 12px 0 4px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.vin-confirm-title {
    margin-bottom: 5px;
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
}

.vin-confirm-text {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.45;
    color: #667085;
}

.vin-confirm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.vin-confirm-grid input {
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    padding: 0 12px;
    font: inherit;
    font-size: 14px;
    color: var(--dark);
}

.vin-confirm-grid input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(23, 105, 224, .10);
}

.vin-confirm-button {
    width: 100%;
    min-height: 44px;
    margin-top: 10px;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    background: var(--blue);
    color: #fff;
}

.vin-confirm-button:disabled {
    opacity: .65;
    cursor: default;
}

@media (max-width: 650px) {
    .vin-confirm-grid {
        grid-template-columns: 1fr;
    }
}

/* VIN CATALOG SITE STYLE V2 */

.vin-catalog-section {
    background: #fff;
    padding: 70px 0;
}

.vin-catalog-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 17px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(16, 24, 40, .04);
}

.vin-catalog-heading {
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.vin-catalog-heading h2 {
    margin-top: 8px;
    font-size: 31px;
    letter-spacing: -.8px;
}

.vin-catalog-close {
    border: 1px solid var(--border);
    background: #fff;
    color: #475467;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    transition: .2s;
}

.vin-catalog-close:hover {
    border-color: #b9cef0;
    background: #f4f8ff;
    color: var(--blue);
}

.vin-catalog-status {
    margin: 20px 0;
    padding: 14px 16px;
    border-radius: 10px;
    background: #edf4ff;
    border: 1px solid #d7e5f8;
    color: #344054;
    font-size: 13px;
}

.vin-vehicle-button {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 12px;
    padding: 17px 18px;
    transition: .2s;
}

.vin-vehicle-button:hover {
    border-color: #b9cef0;
    box-shadow: 0 8px 25px rgba(23, 105, 224, .07);
    transform: translateY(-1px);
}

.vin-vehicle-button strong {
    font-size: 15px;
    color: var(--dark);
}

.vin-vehicle-button span {
    margin-top: 5px;
    color: #98a2b3;
    font-size: 12px;
}

.vin-vehicle-info {
    margin: 22px 0;
    padding: 17px 18px;
    border-radius: 12px;
    background: #f8fbff;
    border: 1px solid #dbe3ef;
    color: #344054;
    font-size: 14px;
}

.vin-groups-panel {
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
    padding: 16px;
}

.vin-panel-title {
    padding-bottom: 13px;
    margin-bottom: 9px;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    font-weight: 750;
}

.vin-group-button {
    border: 0;
    background: transparent;
    color: #475467;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 500;
    transition: .15s;
}

.vin-group-button:hover {
    background: #f4f8ff;
    color: var(--blue);
}

.vin-group-button.active {
    background: #edf4ff;
    color: var(--blue);
    font-weight: 700;
}

.vin-unit-button {
    border: 1px solid var(--border);
    background: #fff;
    color: #475467;
    border-radius: 9px;
    padding: 9px 13px;
    font-size: 13px;
    font-weight: 600;
    transition: .15s;
}

.vin-unit-button:hover {
    border-color: #b9cef0;
    background: #f8fbff;
    color: var(--blue);
}

.vin-unit-button.active {
    border-color: var(--blue);
    background: #edf4ff;
    color: var(--blue);
}

.vin-scheme-block {
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(16, 24, 40, .03);
}

.vin-scheme-empty {
    border: 1px dashed #cfd7e3;
    border-radius: 13px;
    background: #f8fafc;
    color: #98a2b3;
}

.vin-part {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 15px 16px;
    transition: .15s;
}

.vin-part:hover {
    border-color: #c3d5ef;
    box-shadow: 0 5px 20px rgba(16, 24, 40, .05);
}

.vin-part.selected {
    border-color: #9fc1ef;
    background: #f4f8ff;
    box-shadow: 0 0 0 2px rgba(23, 105, 224, .06);
}

.vin-part-position {
    color: #98a2b3;
    font-size: 11px;
    font-weight: 600;
}

.vin-part-oem {
    color: #344054;
    font-size: 14px;
    font-weight: 750;
}

.vin-part-name {
    color: #344054;
    font-size: 14px;
    line-height: 1.4;
}

.vin-part-search {
    border: 0;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    padding: 11px 13px;
    font-size: 13px;
    font-weight: 700;
    transition: .2s;
}

.vin-part-search:hover {
    background: var(--blue-dark);
}

.vin-map-area {
    border: 1px solid rgba(23, 105, 224, .6);
    background: rgba(23, 105, 224, .05);
    border-radius: 3px;
}

.vin-map-area:hover {
    border-color: var(--blue);
    background: rgba(23, 105, 224, .18);
}

/* VIN CATALOG LAYOUT V3 */

.vin-catalog-card {
    max-width: 1180px;
    margin: 0 auto;
}

.vin-vehicle-info {
    position: relative;
    margin: 22px 0 26px;
    padding: 20px 22px 20px 64px;
    min-height: 62px;
    display: flex;
    align-items: center;
    background: linear-gradient(
        135deg,
        #f8fbff 0%,
        #eef5ff 100%
    );
    border: 1px solid #dbe8f8;
    font-size: 15px;
    font-weight: 700;
}

.vin-vehicle-info::before {
    content: "🚗";
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 26px;
}

.vin-catalog-layout {
    grid-template-columns:
        275px
        minmax(0, 1fr);

    gap: 28px;
}

.vin-groups-panel {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.vin-scheme-panel {
    min-width: 0;
}

.vin-units {
    margin: 0 0 16px;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--border);
}

.vin-scheme-block {
    width: 100%;
    min-height: 420px;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 24px;
}

.vin-scheme-stage {
    position: relative !important;
    display: inline-block !important;
    width: auto;
    max-width: 100%;
    line-height: 0;
}

#vinSchemeImage {
    position: relative;
    z-index: 1;
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
}

#vinSchemeMap {
    position: absolute !important;
    z-index: 2;
    left: 0 !important;
    top: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
}

.vin-map-area {
    position: absolute !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(23,105,224,.65) !important;
    border-radius: 3px;
    background: rgba(23,105,224,.06) !important;
    min-width: 6px;
    min-height: 6px;
    font-size: 0;
    line-height: 0;
    box-shadow: none;
}

.vin-map-area:hover {
    background: rgba(23,105,224,.22) !important;
    border-color: var(--blue) !important;
}

.vin-catalog-parts {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.vin-part {
    grid-template-columns:
        60px
        145px
        minmax(220px, 1fr)
        150px;
}

.vin-part-position {
    text-align: center;
    padding: 6px 8px;
    border-radius: 7px;
    background: #f2f4f7;
    color: #667085;
    font-weight: 700;
}

.vin-part.selected .vin-part-position {
    background: #dceaff;
    color: var(--blue);
}

@media (max-width: 900px) {

    .vin-catalog-layout {
        grid-template-columns: 1fr;
    }

    .vin-groups-panel {
        position: static;
        max-height: 340px;
    }

    .vin-scheme-block {
        min-height: 300px;
        padding: 12px;
    }
}

/* VIN CATALOG LAYOUT FIX V4 */

.vin-catalog-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

/* Левое дерево больше не висит поверх остального каталога */
.vin-groups-panel {
    position: static !important;
    top: auto !important;
    align-self: start;
    max-height: 650px;
    overflow-y: auto;
}

/* Правая область */
.vin-scheme-panel {
    min-width: 0;
    width: 100%;
}

/* Выбор схем */
.vin-units {
    width: 100%;
    margin-bottom: 16px;
}

/* Никакой внутренней вертикальной прокрутки схемы */
.vin-scheme-block {
    width: 100%;
    min-height: 0 !important;
    height: auto !important;

    overflow-x: auto !important;
    overflow-y: visible !important;

    display: block !important;

    padding: 20px;
    text-align: center;
}

/* Сам рисунок строго по центру */
.vin-scheme-stage {
    position: relative !important;
    display: inline-block !important;

    width: auto !important;
    max-width: 100%;

    margin-left: auto !important;
    margin-right: auto !important;

    line-height: 0;
    vertical-align: top;
}

#vinSchemeImage {
    display: block !important;

    width: auto !important;
    max-width: 100% !important;

    height: auto !important;

    margin: 0 auto !important;
}

/* Слой областей строго поверх картинки */
#vinSchemeMap {
    position: absolute !important;

    left: 0 !important;
    top: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    z-index: 5;
}

/*
    Детали теперь находятся под всем каталогом,
    а не только под правой колонкой.
*/
.vin-catalog-parts {
    width: 100%;

    margin-top: 28px;
    padding-top: 24px;

    border-top: 1px solid var(--border);

    clear: both;
}

.vin-catalog-parts:not(:empty)::before {
    content: "Детали схемы";

    display: block;

    margin-bottom: 14px;

    font-size: 18px;
    font-weight: 750;

    color: var(--dark);
}

.vin-part {
    width: 100%;

    grid-template-columns:
        70px
        150px
        minmax(220px, 1fr)
        160px;
}

/* На небольших экранах */
@media (max-width: 900px) {

    .vin-catalog-layout {
        grid-template-columns: 1fr;
    }

    .vin-groups-panel {
        max-height: 330px;
    }

    .vin-scheme-block {
        padding: 12px;
        overflow-x: auto !important;
    }
}

/* VIN SCHEME HIDDEN FIX V5 */

#vinSchemeBlock.hidden {
    display: none !important;
}

#vinSchemeImage:not([src]),
#vinSchemeImage[src=""] {
    display: none !important;
}
