:root {
    --color-bg: #f4f3ef;
    --color-surface: #ffffff;
    --color-graphite: #111315;
    --color-graphite-soft: #1c1f22;
    --color-text: #191b1d;
    --color-muted: #6f7378;
    --color-border: rgba(17, 19, 21, 0.12);
    --color-red: #df2b34;
    --color-red-dark: #b71925;
    --color-gold: #c7a86b;
    --color-gold-light: #ead9b6;
    --color-telegram: #229ed9;
    --color-max: #6657ff;
    --container-width: 1240px;
    --header-height: 76px;
    --radius-small: 12px;
    --radius-medium: 20px;
    --radius-large: 32px;
    --shadow-small: 0 12px 30px rgba(17, 19, 21, 0.08);
    --shadow-large: 0 30px 80px rgba(17, 19, 21, 0.16);
    --transition: 220ms ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
    margin: 0;
    overflow-x: hidden;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}

body.modal-open {
    overflow: hidden;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

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

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
blockquote {
    margin-top: 0;
}

h1,
h2,
h3 {
    text-wrap: balance;
}

ul,
ol {
    padding: 0;
}

address {
    font-style: normal;
}

::selection {
    background: var(--color-red);
    color: #ffffff;
}

:focus-visible {
    outline: 3px solid rgba(223, 43, 52, 0.45);
    outline-offset: 4px;
}

.container {
    width: min(calc(100% - 32px), var(--container-width));
    margin-inline: auto;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 2000;
    padding: 10px 16px;
    transform: translateY(-150%);
    border-radius: 8px;
    background: #ffffff;
    color: #111315;
    font-weight: 700;
    transition: transform var(--transition);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    height: var(--header-height);
    border-bottom: 3px solid var(--color-red);
    background: rgba(17, 19, 21, 0.84);
    color: #ffffff;
    backdrop-filter: blur(18px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
    transition:
        background var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

.site-header.is-scrolled {
    background: rgba(17, 19, 21, 0.96);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.brand {
    display: inline-flex;
    align-items: center;
}

.brand-logo {
    display: block;
    height: 44px;
    width: auto;
}

.header-messengers {
    display: flex;
    align-items: center;
    gap: 8px;
}

.messenger {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 9px;
    padding: 5px 14px 5px 5px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 750;
    transition: transform var(--transition), filter var(--transition);
}

.messenger:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.messenger__icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    overflow: hidden;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

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

.messenger--telegram {
    background: var(--color-telegram);
}

.messenger--max {
    background: linear-gradient(135deg, #7b5cff 0%, #b04dff 45%, #ff4d8d 100%);
}

.button {
    display: inline-flex;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 22px;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 750;
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background var(--transition),
        border-color var(--transition);
}

.button:hover {
    transform: translateY(-2px);
}

.button--primary {
    background: var(--color-red);
    color: #ffffff;
    box-shadow: 0 12px 34px rgba(223, 43, 52, 0.28);
}

.button--primary:hover {
    background: var(--color-red-dark);
    box-shadow: 0 16px 40px rgba(223, 43, 52, 0.36);
}

.button--secondary {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    backdrop-filter: blur(12px);
}

.button--secondary:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.1);
}

.button--dark {
    background: var(--color-graphite);
    color: #ffffff;
}

.button--dark:hover {
    background: #292d31;
    box-shadow: var(--shadow-small);
}

.button--full {
    width: 100%;
}

.hero {
    position: relative;
    display: flex;
    min-height: calc(100svh + 110px);
    flex-direction: column;
    overflow: hidden;
    padding-top: var(--header-height);
    background:
        linear-gradient(180deg, rgba(17, 19, 21, 0.72) 0%, rgba(17, 19, 21, 0.35) 45%, rgba(17, 19, 21, 0.6) 100%),
        url("/static/images/hero_section.jpg") center bottom 24px / auto 60% no-repeat,
        #010811;
    color: #ffffff;
    text-align: center;
}

.hero__inner {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    padding-bottom: clamp(72px, 10vh, 120px);
}

.hero h1 {
    max-width: 900px;
    margin: clamp(28px, 6vh, 64px) auto 0;
    font-size: clamp(38px, 8vw, 84px);
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1.02;
}

.hero__highlight {
    background: linear-gradient(135deg, #ffe9c4, #e9c37e 45%, #ffb199);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__subtitle {
    max-width: 620px;
    margin: clamp(16px, 3vh, 26px) auto 0;
    color: #ffffff;
    font-size: clamp(12px, 3.4vw, 16px);
    line-height: 1.5;
}

.hero__dot {
    color: var(--color-red);
    font-weight: 700;
}

.hero-saving {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: clamp(28px, 5vh, 52px) auto 0;
    padding: clamp(20px, 3.5vw, 32px) clamp(28px, 6vw, 56px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-large);
    background: linear-gradient(160deg, #1e2124, #111315);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    animation: hero-saving-pop 700ms cubic-bezier(0.34, 1.56, 0.64, 1) 200ms both;
}

.hero-saving::before {
    position: absolute;
    inset: -1px;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 233, 196, 0.9),
        rgba(233, 195, 126, 0.25) 40%,
        rgba(255, 177, 153, 0.7)
    );
    content: "";
    pointer-events: none;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.hero-saving::after {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    background: linear-gradient(
        115deg,
        transparent 30%,
        rgba(255, 255, 255, 0.14) 48%,
        rgba(255, 233, 196, 0.22) 52%,
        transparent 70%
    );
    background-size: 250% 100%;
    content: "";
    pointer-events: none;
    animation: hero-saving-sheen 4.5s ease-in-out 1.4s infinite;
}

@keyframes hero-saving-sheen {
    0% {
        background-position: 120% 0;
    }
    45%, 100% {
        background-position: -120% 0;
    }
}

.hero-saving__label {
    color: rgba(255, 255, 255, 0.85);
    font-size: clamp(13px, 2vw, 18px);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero-saving__amount {
    background: linear-gradient(135deg, #ffe9c4, #e9c37e 45%, #ffb199);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 10px 35px rgba(223, 43, 52, 0.35));
    font-size: clamp(46px, 9vw, 104px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    transform-origin: center;
}

.hero-saving__note {
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    line-height: 1.4;
}

@keyframes hero-saving-pop {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.7);
    }
    60% {
        opacity: 1;
        transform: translateY(-6px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.section {
    padding: 48px 0 80px;
}

.section-heading {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

.section-heading h2,
.reviews-heading h2,
.office-content h2,
.logistics-content h2 {
    margin: 0;
    font-size: clamp(34px, 8vw, 60px);
    font-weight: 620;
    letter-spacing: -0.055em;
    line-height: 1.03;
}

.section-heading > p {
    max-width: 480px;
    margin: 0;
    color: var(--color-muted);
    font-size: 16px;
}

.section-kicker {
    display: block;
    margin-bottom: 14px;
    color: var(--color-red);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.section-kicker--light {
    color: var(--color-gold-light);
}

.text-red {
    color: var(--color-red);
}

.section-heading--light {
    color: #ffffff;
}

.section-heading--light > p {
    color: rgba(255, 255, 255, 0.55);
}

.logistics-section {
    background: #eeede9;
}

.logistics-layout {
    display: grid;
    align-items: center;
    gap: 36px;
}

.logistics-content p {
    max-width: 560px;
    margin: 20px 0 0;
    color: var(--color-muted);
    font-size: 17px;
}

.logistics-media {
    margin: 0;
}

.cars-section {
    background: var(--color-surface);
}

.cars-grid {
    display: grid;
    gap: 18px;
}

.car-card {
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    background: var(--color-surface);
    transition:
        transform 280ms ease,
        box-shadow 280ms ease;
}

.car-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-large);
}

.placeholder-image {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent),
        #292c2f;
}

.car-card__media {
    min-height: 240px;
    color: #ffffff;
    cursor: pointer;
}

.placeholder-image::after {
    position: absolute;
    right: -15%;
    bottom: -55%;
    width: 240px;
    height: 240px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    content: "";
    box-shadow: 0 0 0 45px rgba(255, 255, 255, 0.025);
}

.placeholder-image--gold {
    background: linear-gradient(135deg, #4a4031, #1c1e20);
}

.placeholder-image--blue {
    background: linear-gradient(135deg, #263c4a, #171a1e);
}

.placeholder-image--green {
    background: linear-gradient(135deg, #294139, #171a1d);
}

.placeholder-image--purple {
    background: linear-gradient(135deg, #3c3448, #17191c);
}

.placeholder-image--red {
    background: linear-gradient(135deg, #512d31, #17191c);
}

.placeholder-image__brand {
    position: absolute;
    top: 23px;
    left: 23px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.placeholder-image__model {
    position: absolute;
    top: 42px;
    left: 23px;
    font-size: 24px;
    font-weight: 650;
    letter-spacing: -0.04em;
}

.placeholder-image__silhouette {
    position: absolute;
    z-index: 2;
    right: 9%;
    bottom: 48px;
    left: 9%;
    height: 47px;
    border-radius: 42px 58px 12px 12px;
    background: linear-gradient(180deg, #d9dcdd, #858b8e);
    box-shadow: 0 18px 28px rgba(0, 0, 0, 0.28);
    transition: transform 350ms ease;
}

.car-card:hover .placeholder-image__silhouette {
    transform: translateX(5px);
}

.placeholder-image__silhouette::before {
    position: absolute;
    top: -26px;
    left: 20%;
    width: 57%;
    height: 32px;
    border-radius: 50px 60px 5px 5px;
    background: linear-gradient(155deg, #c9cdcf 50%, #667076 51%);
    clip-path: polygon(18% 0, 76% 0, 100% 100%, 0 100%);
    content: "";
}

.placeholder-image__silhouette::after {
    position: absolute;
    right: 12%;
    bottom: -10px;
    left: 12%;
    height: 21px;
    background:
        radial-gradient(circle at 8% 50%, #111315 0 9px, #7d8285 10px 13px, transparent 14px),
        radial-gradient(circle at 92% 50%, #111315 0 9px, #7d8285 10px 13px, transparent 14px);
    content: "";
}

.car-card__content {
    padding: 22px;
}

.car-card__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 21px;
}

.car-card__heading span {
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.car-card__heading h3 {
    margin: 2px 0 0;
    font-size: 24px;
    letter-spacing: -0.045em;
}

.car-card__heading > strong {
    padding: 5px 8px;
    border-radius: 6px;
    background: #f1f0ec;
    font-size: 11px;
}

.car-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0 0 22px;
    list-style: none;
}

.car-specs li {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 10px;
    border-radius: 9px;
    background: #f5f4f1;
}

.car-specs span {
    overflow: hidden;
    color: var(--color-muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.car-specs strong {
    margin-top: 3px;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.car-card__footer {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--color-border);
}

.car-card__price-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-small);
    background: #faf9f7;
}

.car-card__prices {
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
}

.car-price-label {
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.car-price-old {
    color: var(--color-muted);
    font-size: 18px;
    font-weight: 650;
    text-decoration: line-through;
    text-decoration-color: rgba(223, 43, 52, 0.85);
    white-space: nowrap;
}

.car-price-current {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.details-button {
    min-height: 39px;
    padding: 9px 13px;
    cursor: pointer;
    border-radius: 9px;
    background: var(--color-graphite);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    transition: background var(--transition), transform var(--transition);
}

.details-button:hover {
    transform: translateY(-2px);
    background: var(--color-red);
}

.car-saving {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    margin: 0 -16px -14px;
    padding: 14px 16px;
    border-top: 1px solid rgba(223, 43, 52, 0.25);
    border-radius: 0 0 var(--radius-small) var(--radius-small);
    background: linear-gradient(135deg, #fff5f2, #ffe9e2);
}

.car-saving__badge {
    position: relative;
    overflow: hidden;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-red) 0%, #ff5a3c 100%);
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(223, 43, 52, 0.4);
}

.car-saving__badge::after {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        115deg,
        transparent 30%,
        rgba(255, 255, 255, 0.25) 48%,
        rgba(255, 255, 255, 0.4) 52%,
        transparent 70%
    );
    background-size: 250% 100%;
    content: "";
    pointer-events: none;
    animation: hero-saving-sheen 4.5s ease-in-out 1.4s infinite;
}

.car-saving__amount {
    color: var(--color-red);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    white-space: nowrap;
}

.car-card__footer .details-button {
    width: 100%;
    min-height: 48px;
    background: var(--color-red);
    font-size: 13px;
    box-shadow: 0 10px 24px rgba(223, 43, 52, 0.28);
}

.car-card__footer .details-button:hover {
    background: var(--color-red-dark);
    box-shadow: 0 14px 30px rgba(223, 43, 52, 0.38);
}

.car-card__guarantee {
    color: var(--color-muted);
    font-size: 11px;
    text-align: center;
}

.office-section {
    background: var(--color-bg);
}

.office-grid {
    display: grid;
    overflow: hidden;
    border-radius: var(--radius-large);
    background: var(--color-surface);
    box-shadow: var(--shadow-small);
}

.office-map {
    position: relative;
    min-height: 370px;
    overflow: hidden;
    background: #e9e8e4;
}

.office-map__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.office-content {
    padding: 33px 25px;
}

.office-content h2 {
    margin-bottom: 20px;
}

.office-content > p {
    margin-bottom: 28px;
    color: var(--color-muted);
}

.office-details {
    display: grid;
    gap: 0;
    margin-bottom: 28px;
}

.office-details div {
    display: flex;
    flex-direction: column;
    padding: 13px 0;
    border-top: 1px solid var(--color-border);
}

.office-details span {
    color: var(--color-muted);
    font-size: 10px;
}

.office-details strong {
    margin-top: 3px;
    font-size: 14px;
}

.reviews-section {
    overflow: hidden;
    background: var(--color-surface);
}

.reviews-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 38px;
}

.carousel-controls {
    display: none;
    flex: 0 0 auto;
    gap: 8px;
}

.carousel-button {
    display: grid;
    width: 46px;
    height: 46px;
    cursor: pointer;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: #ffffff;
    color: var(--color-graphite);
    font-size: 19px;
    transition:
        background var(--transition),
        color var(--transition),
        transform var(--transition);
}

.carousel-button:hover {
    transform: translateY(-2px);
    background: var(--color-graphite);
    color: #ffffff;
}

.reviews-carousel {
    overflow: hidden;
    touch-action: pan-y;
}

.reviews-track {
    display: flex;
    transition: transform 480ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.review-card {
    flex: 0 0 100%;
    min-height: 310px;
    padding: 25px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    background: #f7f6f2;
}

.review-card__top {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 11px;
    margin: -25px -25px 27px;
    padding: 18px 25px;
    border-radius: calc(var(--radius-medium) - 1px) calc(var(--radius-medium) - 1px) 0 0;
    background: #2a2e32;
}

.client-avatar {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    background: var(--color-red);
    color: #ffffff;
    font-size: 11px;
    font-weight: 750;
}

.review-card h3 {
    margin: 0;
    font-size: 15px;
    color: #ffffff;
}

.review-card__top div:nth-child(2) span {
    color: rgba(255, 255, 255, 0.55);
    font-size: 10px;
}


.review-card__video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 0 16px;
    border-radius: 10px;
    background: #000000;
}

.review-card blockquote {
    margin: 0;
    color: #4e5256;
    font-size: 15px;
    line-height: 1.75;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 23px;
}

.carousel-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    cursor: pointer;
    border-radius: 10px;
    background: #c9c8c4;
    transition:
        width var(--transition),
        background var(--transition);
}

.carousel-dot.is-active {
    width: 24px;
    background: var(--color-red);
}

.site-footer {
    padding: 45px 0 22px;
    background: #0b0c0d;
    color: #ffffff;
}

.footer-top {
    display: grid;
    gap: 28px;
    align-items: center;
}

.footer-address {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-address span {
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.footer-address strong {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 650;
}

.footer-messengers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-bottom p {
    margin: 0;
    color: rgba(255, 255, 255, 0.3);
    font-size: 9px;
}

.scroll-top {
    position: fixed;
    z-index: 1200; /* выше header (1000), но ниже модалки (1500) */
    right: 16px;
    bottom: 16px;
    display: grid;
    width: 46px;
    height: 46px;
    cursor: pointer;
    place-items: center;
    border-radius: 50%;
    background: var(--color-graphite);
    color: #ffffff;
    font-size: 20px;
    box-shadow: var(--shadow-small);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition:
        opacity var(--transition),
        visibility var(--transition),
        transform var(--transition),
        background var(--transition);
}

.scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    background: var(--color-red);
}

.modal {
    position: fixed;
    z-index: 1500;
    inset: 0;
    display: grid;
    visibility: hidden;
    padding: 12px;
    place-items: center;
    opacity: 0;
    transition:
        opacity 250ms ease,
        visibility 250ms;
}

.modal.is-open {
    visibility: visible;
    opacity: 1;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 7, 8, 0.78);
    backdrop-filter: blur(8px);
}

.modal__dialog {
    position: relative;
    z-index: 2;
    display: grid;
    width: min(100%, 1060px);
    max-height: calc(100svh - 24px);
    overflow: auto;
    transform: translateY(24px) scale(0.98);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.45);
    transition: transform 300ms ease;
}

.modal.is-open .modal__dialog {
    transform: translateY(0) scale(1);
}

.modal__close {
    position: absolute;
    z-index: 5;
    top: 12px;
    right: 12px;
    display: grid;
    width: 40px;
    height: 40px;
    cursor: pointer;
    place-items: center;
    border-radius: 50%;
    background: rgba(17, 19, 21, 0.78);
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    transition: background var(--transition), transform var(--transition);
}

.modal__close:hover {
    transform: rotate(90deg);
    background: var(--color-red);
}

.modal-gallery {
    padding: 12px;
    background: #e9e8e4;
}

.modal-gallery__main {
    position: relative;
    min-height: 290px;
    overflow: hidden;
    aspect-ratio: 1;
    border-radius: 15px;
    color: #ffffff;
    cursor: pointer;
}

.modal-gallery__brand {
    position: absolute;
    top: 22px;
    left: 22px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.modal-gallery__model {
    position: absolute;
    top: 42px;
    left: 22px;
    font-size: 24px;
    font-weight: 700;
}

.gallery-counter {
    position: absolute;
    z-index: 3;
    right: 15px;
    bottom: 15px;
    padding: 6px 9px;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.78);
    font-size: 9px;
}

.modal-gallery__thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 7px;
    margin-top: 8px;
}

.modal-gallery__thumbs[hidden] {
    display: none;
}

.gallery-thumb {
    min-height: 52px;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #d4d3cf;
    color: #6d7073;
    font-size: 9px;
    font-weight: 700;
    transition:
        border-color var(--transition),
        background var(--transition);
}

.gallery-thumb.is-active {
    border-color: var(--color-red);
    background: #ffffff;
    color: var(--color-text);
}

.modal-content {
    padding: 27px 23px;
}

.modal-content__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 17px;
}

.modal-brand {
    color: var(--color-red);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.modal-content__heading h2 {
    margin: 2px 0 0;
    font-size: 31px;
    letter-spacing: -0.05em;
}

.modal-year {
    padding: 5px 9px;
    border-radius: 7px;
    background: #f0efeb;
    font-size: 11px;
    font-weight: 700;
}

.modal-description {
    color: var(--color-muted);
    font-size: 13px;
}

.modal-specifications {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 21px 0;
}

.modal-specifications div {
    padding: 11px;
    border-radius: 9px;
    background: #f4f3ef;
}

.modal-specifications dt {
    color: var(--color-muted);
    font-size: 9px;
}

.modal-specifications dd {
    margin: 3px 0 0;
    font-size: 12px;
    font-weight: 750;
}

.modal-equipment,
.delivery-terms {
    margin-top: 20px;
}

.modal-equipment h3,
.delivery-terms h3 {
    margin-bottom: 10px;
    font-size: 14px;
}

.modal-equipment ul {
    display: grid;
    gap: 7px;
    margin: 0;
    list-style: none;
}

.modal-equipment li {
    position: relative;
    padding-left: 21px;
    color: #565a5e;
    font-size: 11px;
}

.modal-equipment li::before {
    position: absolute;
    left: 0;
    color: var(--color-red);
    content: "✓";
    font-weight: 800;
}

.delivery-terms p {
    margin: 0;
    padding: 12px;
    border-left: 2px solid var(--color-gold);
    background: #f7f3ea;
    color: #696258;
    font-size: 10px;
}

.modal-price {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0 20px;
    margin: 0 0 20px;
    padding: 16px 20px;
    border-radius: var(--radius-small);
    background: #faf9f7;
}

.modal-price__info {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.modal-price__label {
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.modal-price__values {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.modal-price__old {
    color: var(--color-muted);
    font-size: 18px;
    font-weight: 650;
    text-decoration: line-through;
    text-decoration-color: rgba(223, 43, 52, 0.85);
    white-space: nowrap;
}

.modal-price__current {
    color: var(--color-graphite);
    font-size: clamp(28px, 4vw, 34px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    white-space: nowrap;
}

.reveal {
    opacity: 0;
    transform: translateY(25px);
    transition:
        opacity 650ms ease,
        transform 650ms ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal--delay {
    transition-delay: 140ms;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

@media (min-width: 480px) {
    .carousel-controls {
        display: flex;
    }
}

@media (min-width: 650px) {
    .container {
        width: min(calc(100% - 48px), var(--container-width));
    }

    .section {
        padding: 64px 0 105px;
    }

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

    .review-card {
        flex-basis: calc(50% - 8px);
        margin-right: 16px;
    }

    .office-content {
        padding: 45px;
    }

    .footer-top {
        grid-template-columns: auto 1fr auto;
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }

    .modal {
        padding: 24px;
    }

    .modal__dialog {
        max-height: calc(100svh - 48px);
    }

    .modal-gallery {
        padding: 17px;
    }

    .modal-gallery__main {
        min-height: 420px;
        aspect-ratio: 16 / 9;
    }

    .modal-content {
        padding: 38px;
    }

    .scroll-top {
        right: 28px;
        bottom: 28px;
        width: 54px;
        height: 54px;
    }
}

@media (min-width: 900px) {
    :root {
        --header-height: 84px;
    }

    .hero {
        min-height: 125svh;
        justify-content: flex-start;
        padding-top: calc(var(--header-height) + 38px);
        background:
            linear-gradient(
                180deg,
                rgba(17, 19, 21, 0.82) 0%,
                rgba(17, 19, 21, 0.55) 30%,
                rgba(17, 19, 21, 0.25) 55%,
                rgba(17, 19, 21, 0.45) 100%
            ),
            url("/static/images/hero_desktop.webp") center / cover no-repeat,
            var(--color-graphite);
    }

    .hero__inner {
        justify-content: flex-start;
    }

    /* Карточка больше не прижимается к низу — идёт сразу после подзаголовка
       и имеет компактный размер: текст читается, но без гигантизма. */
    .hero-saving {
        gap: 6px;
        margin-top: clamp(12px, 2vh, 20px);
        padding: 14px 32px;
        backdrop-filter: blur(10px);
        background: linear-gradient(160deg, rgba(30, 33, 36, 0.88), rgba(17, 19, 21, 0.88));
    }

    .hero-saving__label {
        font-size: 12px;
        letter-spacing: 0.14em;
    }

    .hero-saving__amount {
        font-size: clamp(34px, 3.5vw, 48px);
    }

    .hero-saving__note {
        font-size: 11px;
    }

    .hero h1 {
        max-width: none;
        margin-top: 0;
        font-size: clamp(40px, 4.5vw, 56px);
        text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
    }

    /* Подзаголовок всегда в одну строку */
    .hero__subtitle {
        max-width: none;
        white-space: nowrap;
        margin-bottom: 16px;
        text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
    }

    .section-heading {
        grid-template-columns: 1.35fr 0.65fr;
        align-items: end;
        margin-bottom: 55px;
    }

    .section-heading > p {
        justify-self: end;
    }

    .cars-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .office-grid {
        grid-template-columns: 1.1fr 0.9fr;
        align-items: stretch;
    }

    .office-map {
        min-height: 570px;
    }

    .office-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 60px;
    }

    .review-card {
        flex-basis: calc(33.333% - 14px);
        margin-right: 21px;
    }

    .modal__dialog {
        grid-template-columns: 1.02fr 0.98fr;
        overflow: hidden;
    }

    .modal-gallery {
        display: flex;
        flex-direction: column;
    }

    .modal-gallery__main {
        flex: 1;
        min-height: 520px;
        aspect-ratio: auto;
    }

    .modal-content {
        max-height: calc(100svh - 48px);
        overflow-y: auto;
    }
}

/* Desktop width but portrait-shaped viewport: "Desktop site" mode on
   phones (~980×2200 CSS px), portrait monitors, tall narrow windows.
   The image is now cover-sized and anchored to the bottom so the
   characters remain visible. */
@media (min-width: 900px) and (max-aspect-ratio: 1/1) {
    .hero {
        background:
            linear-gradient(
                180deg,
                rgba(17, 19, 21, 0.82) 0%,
                rgba(17, 19, 21, 0.55) 30%,
                rgba(17, 19, 21, 0.25) 55%,
                rgba(17, 19, 21, 0.45) 100%
            ),
            url("/static/images/hero_desktop.webp") center bottom / cover no-repeat,
            var(--color-graphite);
    }
}

@media (min-width: 1160px) {
    .car-card__media {
        min-height: 260px;
    }
}

/* === Logistics: горизонтальная схема маршрута === */
.logistics-scene {
    display: grid;
    gap: clamp(20px, 3vw, 32px);
    padding: clamp(22px, 4vw, 44px);
    border-radius: var(--radius-large);
    background: var(--color-surface);
    box-shadow: var(--shadow-small);
}

.logistics-diagram {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2.5vw, 32px);
}

.logistics-endpoint {
    display: flex;
    min-width: 72px;
    flex: 0 1 20%;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.logistics-endpoint__img {
    width: 100%;
    max-width: 170px;
    height: auto;
    transition: transform var(--transition);
}

.logistics-endpoint:hover .logistics-endpoint__img {
    transform: scale(1.04);
}

.logistics-endpoint__label {
    position: relative;
    padding: 1px;
    border-radius: 9999px;
    background: linear-gradient(
        135deg,
        rgba(223, 43, 52, 0.55),
        rgba(223, 43, 52, 0.12) 45%,
        rgba(199, 168, 107, 0.6)
    );
    box-shadow: 0 8px 22px rgba(17, 19, 21, 0.1);
}

.logistics-endpoint__text {
    display: block;
    padding: 8px 20px;
    border-radius: inherit;
    background: var(--color-graphite);
    color: #ffffff;
    font-size: clamp(13px, 1.5vw, 16px);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    white-space: nowrap;
}

.logistics-route {
    flex: 1 1 auto;
    min-width: 0;
}

.logistics-route__svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Движение пунктира в сторону медведя */
@keyframes route-dash-move {
    to { stroke-dashoffset: -26; }
}

.logistics-route__path {
    animation: route-dash-move 1.6s linear infinite;
}

/* Последовательная пульсация стрелок слева направо */
@keyframes route-arrow-pulse {
    0%, 100% { opacity: 0.35; }
    50%      { opacity: 1; }
}

.route-arrow__body,
.route-vehicle__body {
    transform-box: fill-box;
    transform-origin: center;
}

.route-arrow__body {
    animation: route-arrow-pulse 1.8s ease-in-out infinite;
}

.route-arrow--2 .route-arrow__body { animation-delay: 0.3s; }
.route-arrow--3 .route-arrow__body { animation-delay: 0.6s; }

/* Преимущества — карточки-пилюли под маршрутом */
.logistics-benefits {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.logistics-benefit {
    display: flex;
    flex: 0 1 260px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 6px 18px rgba(17, 19, 21, 0.06);
    transition:
        transform var(--transition),
        box-shadow var(--transition);
}

.logistics-benefit:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(17, 19, 21, 0.1);
}

.logistics-benefit__icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
}

.logistics-benefit__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Mobile: схема остаётся горизонтальной, уменьшаем головы,
   компенсируем масштаб машин и толщину маршрута */
@media (max-width: 768px) {
    .logistics-endpoint {
        min-width: 0;
        flex-basis: 64px;
    }

    .logistics-endpoint__text {
        padding: 6px 14px;
        font-size: 12px;
    }

    .route-arrow__body {
        transform: scale(1.35);
    }

    .logistics-route__path {
        stroke-width: 7;
    }

    .logistics-route__glow {
        stroke-width: 20;
    }

    .logistics-benefit {
        font-size: 13px;
    }
}

/* === Модальное окно преимуществ === */
.modal__dialog--benefit {
    width: min(100%, 460px);
    padding: 0;
    overflow: hidden;
}

.benefit-modal__media {
    position: relative;
    aspect-ratio: 1;
    background: #e9e8e4;
}

.benefit-modal__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 200ms ease;
}

.benefit-modal__content {
    padding: 32px 28px 28px;
}

.benefit-modal__title {
    margin: 0 0 14px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.benefit-modal__text {
    margin: 0;
    color: var(--color-muted);
    font-size: 15px;
    line-height: 1.65;
}

@media (min-width: 650px) {
    .modal__dialog--benefit {
        width: min(100%, 720px);
        grid-template-columns: 1fr 1fr;
    }

    .benefit-modal__content {
        order: 1;              /* заголовок + текст — колонкой слева */
        align-self: center;
        padding: 44px 36px 36px;
    }

    .benefit-modal__media {
        order: 2;              /* иллюстрация справа */
        min-height: 300px;
        aspect-ratio: auto;
    }
}

/* Клоны карточек для бесшовного зацикливания слайдера */
.review-card--clone {
    pointer-events: none;
}

/* === Заявка в модале автомобиля === */
.modal-actions {
    position: relative;        /* якорь для выезжающих кнопок */
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    margin-top: 18px;
}

.modal-request {
    width: 100%;
    transition:
        background 350ms ease,
        color 350ms ease,
        box-shadow 350ms ease,
        transform var(--transition);
}

.modal-request.is-sent,
.modal-request.is-sent:hover {
    background: #d9d8d4;
    color: #83868a;
    box-shadow: none;
    cursor: default;
    transform: none;
}

/* Две «половины одной кнопки»: выезжают слева и справа,
   встречаются по центру и перекрывают кнопку заявки */
.modal-messengers {
    position: absolute;
    inset: 0;                  /* точно поверх .modal-request */
    display: flex;
    overflow: hidden;
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 200ms ease,
        visibility 450ms;
}

.modal-messengers.is-visible {
    opacity: 1;
    visibility: visible;
}

.modal-messenger {
    display: inline-flex;
    min-width: 0;
    min-height: 50px;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 6px 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 750;
    white-space: nowrap;
    transition:
        transform 450ms cubic-bezier(0.22, 0.61, 0.36, 1),
        filter var(--transition);
}

.modal-messenger--telegram {
    background: var(--color-telegram);
    transform: translateX(-105%);   /* старт слева за пределами */
}

.modal-messenger--max {
    background: linear-gradient(135deg, #7b5cff 0%, #b04dff 45%, #ff4d8d 100%);
    transform: translateX(105%);    /* старт справа за пределами */
}

.modal-messengers.is-visible .modal-messenger {
    transform: translateX(0);       /* встречаются по центру */
}

.modal-messenger:hover {
    filter: brightness(1.08);
}

.modal-messenger .messenger__icon {
    width: 26px;
    height: 26px;
}

/* === Блок экономии в модале автомобиля === */
.modal-saving {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    margin: -16px -20px -16px 0;
    padding: 16px 20px;
    border-left: 1px solid rgba(223, 43, 52, 0.25);
    border-radius: 0 var(--radius-small) var(--radius-small) 0;
    background: linear-gradient(135deg, #fff5f2, #ffe9e2);
}

/* Маленький бейдж с премиальной анимацией блеска */
.modal-saving .modal-saving__badge {
    position: relative;
    overflow: hidden;
    padding: 5px 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-red) 0%, #ff5a3c 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(223, 43, 52, 0.4);
    line-height: 1.2;
}

/* Блеск — та же анимация, что у hero */
.modal-saving .modal-saving__badge::after {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        115deg,
        transparent 30%,
        rgba(255, 255, 255, 0.25) 48%,
        rgba(255, 255, 255, 0.4) 52%,
        transparent 70%
    );
    background-size: 250% 100%;
    content: "";
    pointer-events: none;
    animation: hero-saving-sheen 4.5s ease-in-out 1.4s infinite;
}

/* Сумма — крупно, акцентным цветом */
.modal-saving .modal-saving__amount {
    color: var(--color-red);
    font-size: clamp(22px, 3.4vw, 28px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    white-space: nowrap;
}

/* Если части не помещаются в одну строку — экономия уходит вниз,
   вертикальная черта заменяется горизонтальной */
@media (max-width: 479px) {
    .modal-price {
        flex-direction: column;
        gap: 16px;
    }

    .modal-saving {
        align-items: flex-start;
        margin: 0 -20px -16px;
        border-top: 1px solid rgba(223, 43, 52, 0.25);
        border-left: 0;
        border-radius: 0 0 var(--radius-small) var(--radius-small);
    }
}

/* === Реальные фото автомобилей (django-pictures) === */
.car-card__media picture,
.car-card__media img {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: cover;
}

@media (min-width: 1160px) {
    .car-card__media picture,
    .car-card__media img {
        height: 260px;
    }
}

/* Скрываем заглушку в галерее модалки, когда есть реальные фото */
.modal-gallery__main--has-photos::after,
.modal-gallery__main--has-photos .modal-gallery__brand,
.modal-gallery__main--has-photos .modal-gallery__model,
.modal-gallery__main--has-photos .placeholder-image__silhouette {
    display: none;
}

.modal-gallery__slide {
    position: absolute;
    inset: 0;
    display: none;
}

.modal-gallery__slide.is-active {
    display: block;
}

.modal-gallery__slide picture,
.modal-gallery__slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb {
    height: 52px;
    overflow: hidden;
    padding: 0;
    border: 1px solid transparent;
}

.gallery-thumb picture,
.gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
