:root {
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-muted: #6b7280;
    --color-accent: #0b1f3a;

    --color-border: #e5e7eb;
    --color-overlay: rgba(0, 0, 0, 0.6);

    --radius: 8px;
    --transition: 0.3s ease;

    --container-width: 1200px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.5;
    font-size: 15px;
}

img {
    max-width: 100%;
    display: block;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 24px;
}

h2 {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 16px;
}

h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 8px;
}

h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px;
}

p {
    margin: 0 0 16px;
    color: var(--color-text);
}

.text-muted {
    color: var(--color-muted);
    font-size: 14px;
}

ul {
    margin: 0 0 16px;
    padding-left: 20px;
}

ul li {
    margin-bottom: 6px;
    line-height: 1.5;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus-visible {
    color: #132f57;
    text-decoration: underline;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--color-text);
}

section + section {
    margin-top: 48px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}


button {
    font-family: inherit;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    font-weight: 600;
    transition: background-color var(--transition), color var(--transition);
}

.btn-primary {
    background-color: var(--color-accent);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: #132f57;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-border);
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.header-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 32px;
    background-color: var(--color-accent);
    color: #fff;
    z-index: 1000;
    overflow: hidden;
}

.header-top .marquee {
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.header-top .marquee span {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 15s linear infinite;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

.header-middle {
    background-color: #f9fafb;
    border-bottom: 1px solid var(--color-border);
        height: 30px;
}

.header-middle__content {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 6px 16px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.header-bottom {
    position: fixed;
    top: 32px;
    left: 0;
    width: 100%;
    z-index: 999;
    background-color: #fff;
    transition: transform 0.3s ease;
}

.header-bottom.is-collapsed {
    transform: translateY(-32px);
}

.header-main {
    background-color: #fff;
    border-bottom: 1px solid var(--color-border);
}

.header-main__content {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    font-weight: 700;
    font-size: 18px;
}

.main-nav {
    margin-left: auto;
}

.main-nav ul {
    display: flex;
    gap: 24px;
    list-style: none;
    padding: 5px 0 0;
    margin: 0;
}

.burger {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: none;
    display: none;
    align-items: center;
    justify-content: center;
}

.burger span {
    position: relative;
    width: 22px;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 1px;
    transition: background-color 0.2s ease;
}

.burger span::before,
.burger span::after {
    content: '';
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 1px;
    transition: transform 0.2s ease, top 0.2s ease, bottom 0.2s ease;
}

.burger span::before {
    top: -6px;
}

.burger span::after {
    bottom: -6px;
}

.burger:hover span,
.burger:focus-visible span,
.burger:hover span::before,
.burger:hover span::after,
.burger:focus-visible span::before,
.burger:focus-visible span::after {
    background-color: var(--color-accent);
}

.burger[aria-expanded="true"] span {
    background-color: transparent;
}

.burger[aria-expanded="true"] span::before {
    top: 0;
    transform: rotate(45deg);
}

.burger[aria-expanded="true"] span::after {
    bottom: 0;
    transform: rotate(-45deg);
}

.site-main {
    padding-top: 100px;
}

.catalog {
    padding: 40px 16px;
}

.catalog-layout {
    max-width: var(--container-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
}

.catalog-filter {
    border: 1px solid rgb(165, 170, 180);
    border-radius: var(--radius);
    padding: 16px;
        height: max-content;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group input {
    width: 100%;
    margin-top: 6px;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.catalog-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.catalog-filter-toggle {
    display: none;
    position: relative;
    z-index: 5;
}

.catalog-empty {
    text-align: center;
    margin: 40px 0;
    font-size: 16px;
    color: #666;
}

@media (hover: hover) {
    .catalog-filter-toggle:hover {
        border-color: var(--color-accent);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

.input-unit {
    position: relative;
    margin-top: 6px;
}

.input-unit input {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-unit input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(11, 31, 58, 0.1);
}

.input-unit .unit {
    position: absolute;
    right: 12px;
    top: 55%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--color-muted);
    pointer-events: none;
}

.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.filter-actions .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
}

.btn-reset {
    width: 100%;
    padding: 12px;
    background-color: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--color-muted);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-reset:hover,
.btn-reset:focus-visible {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.filter-hint {
    margin-top: 4px;
    font-size: 12px;
    color: #b36b00;
}

.car-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    max-height: 400px;
    overflow: hidden;
    padding: 12px;
    border: 1px solid rgb(165, 170, 180);
    border-radius: var(--radius);
    background-color: #fff;
    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease,
        border-color 0.2s ease;
}

@media (hover: hover) {
    .car-card:hover {
        border-color: var(--color-accent);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        transform: translateY(-2px);
    }
}

.car-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius);
}

.car-card h3 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 8px 0 6px;
}

.car-specs {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--color-muted);
    margin-bottom: 8px;
}
.car-specs li {
    margin-bottom: 4px;
}

.car-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.car-card .btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius);
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.car-card .btn {
        width: 100%;
    background-color: transparent;
    color: var(--color-accent);
    border: 1px solid #6b7280;
}

@media (hover: hover) {
    .car-card .btn:hover,
    .car-card .btn:focus-visible {
        background-color: var(--color-accent);
        color: #fff;
    }
}

.car-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}


.car-price {
    font-weight: 700;
    color: var(--color-accent);
}

.site-footer {
    background-color: #f9fafb;
    border-top: 1px solid var(--color-border);
    padding: 80px 16px;
}

.footer-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 40px;
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
}

.footer-nav li {
    margin-bottom: 10px;
}

.footer-nav a {
    color: var(--color-text);
    font-size: 14px;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
    color: var(--color-accent);
    text-decoration: underline;
}

.footer-brand {
    margin-top: auto;
    font-size: 13px;
    color: var(--color-muted);
}

.footer-contacts a {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--color-text);
}

.footer-contacts a:hover,
.footer-contacts a:focus-visible {
    color: var(--color-accent);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal[hidden] {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 32px 28px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #000;
}

.modal-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
}

.modal-description {
    margin: 0 0 24px;
    font-size: 14px;
    color: #666;
}

.modal-form {
    display: grid;
    gap: 5px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 13px;
    color: #444;
}

.form-group input {
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #0b1f3a;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
    border-color: #ddd;
    box-shadow: 0 0 0 2px #0b1f3a;
}

.form-group .error {
    min-height: 14px;
    font-size: 12px;
    color: #d33;
}

.form-group input.is-error {
    border-color: #d33;
    box-shadow: 0 0 0 3px rgba(211, 51, 51, 0.15);
}

.modal-form .btn-primary {
    margin-top: 6px;
    height: 46px;
    border-radius: 10px;
    font-size: 15px;
}

.modal-success {
    padding: 20px;
    text-align: center;
    font-size: 15px;
    color: #2e7d32;
    background: #e8f5e9;
    border-radius: 10px;
}

.no-scroll {
    overflow: hidden;
}

.filter-close {
    display: none;
}


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

    .catalog-products {
        grid-template-columns: repeat(2, 1fr);
    }

    .catalog-filter {
        display: none;
    }
        
    .catalog {
        display: flex;
        flex-direction: column;
    }

    .catalog-filter-toggle {
        order: -1;
        margin-bottom: 16px;
        display: block;
        width: 100%;
        max-width: 320px;
        margin: 0 auto 15px;
    }

    .main-nav .to-hide {
        display: none;
    }
    .main-nav.is-open {
        display: block;
    }
    
}


@media (max-width: 768px) {
    h1 {
        font-size: 26px;
    }

    h2 {
        font-size: 20px;
    }

    .main-nav {
        position: fixed;
        top: 32px;
        left: 0;
        width: 100%;
        height: calc(100vh - 32px);

        background-color: #fff;
        z-index: 900;

        display: flex;
        align-items: center;
        justify-content: center;

        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }

    .main-nav.is-open {
        transform: translateY(0);
        padding-top: 20px;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .main-nav a {
        font-size: 20px;
        font-weight: 600;
    }
    
    .main-nav .to-hide {
        display: block;
    }
    
    .header-main .logo {
        display: none;
    }

    .catalog-filter {
        position: fixed;
        inset: 0;
        z-index: 1000;
        background-color: #fff;
        padding: 24px 16px;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }
    
    .catalog-filter.is-open {
        transform: translateY(0);
        display: block;
        height: 100%;
    }

    .filter-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 24px;
    }

    .filter-close {
        background: none;
        border: none;
        font-size: 20px;
        cursor: pointer;
        margin-bottom: 20px;
    }

    .catalog-filter-toggle {
        max-width: 100%;
        margin: 0 auto 10px;
        display: block;
    }
        
    .catalog-products {
        grid-template-columns: 1fr;
    }

    .car-card {
        max-height: none;
    }

    .car-card img {
        height: 300px;
    }
        
    .header-main__content .btn-primary {
        margin-left: 0;
    }

    .burger {
        display: flex;
        margin-left: auto;
    }
        
    .header-main__content {
        justify-content: space-between;
    }
    .modal {
        align-items: stretch;
        justify-content: stretch;
    }
    .modal-content {
        width: 100%;
        max-width: none;
        height: 100dvh;
        border-radius: 0;
        padding: 24px 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-close {
        top: 16px;
        right: 16px;
        font-size: 28px;
    }
}