/* Vehicle hero and gallery */
.car-hero {
    position: relative;
    min-height: 100svh;
    display: grid;
    align-items: end;
    padding: 132px clamp(16px, 4vw, 64px) 74px;
    overflow: hidden;
}

.car-details-shell {
    width: calc(100% - var(--home-content-gutter) - var(--home-content-gutter));
    max-width: none;
    margin: 0 auto;
}

.car-hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    transform: scale(1.05);
    filter: brightness(0.9);
    animation: carHeroZoom 1.4s cubic-bezier(0.16,1,0.3,1) forwards;
}

@keyframes carHeroZoom {
    to {
        transform: scale(1);
        filter: brightness(1);
    }
}

.car-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.24), rgba(0, 0, 0, 0.72));
}

.car-hero strong{

    color:white;

    letter-spacing:.03em;

    text-shadow:

            0 8px 30px rgba(0,0,0,.4);

}

.car-hero::before{

    content:"";

    position:absolute;

    inset:0;

    background:

            linear-gradient(
                    180deg,
                    transparent 45%,
                    #071320 100%
            );

    z-index:-1;

}

.car-hero__content {
    max-width:980px;
    justify-self: end;
    text-align: right;
    opacity:0;
    transform:translateY(30px);
    filter:blur(4px);
    animation:carHeroIn 1s cubic-bezier(.16,1,.3,1) .3s forwards;
}

@keyframes carHeroIn {
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.car-hero h1 {
    margin-bottom: 26px;
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 700;
    line-height: 0.9;
}

.car-hero strong {
    display: block;
    margin: 26px 0;
    font-size: clamp(1.6rem, 3vw, 3.4rem);
}

.car-details,
.equipment-section,
.similar-section {
    background: #071320;
}

.car-description__grid,
.request-section__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: clamp(28px, 5vw, 72px);
}

.car-details__grid{
    display:grid;
    grid-template-columns:
        minmax(0,1fr)
        minmax(320px,.82fr);
    column-gap: clamp(32px, 4vw, 56px);
    row-gap: clamp(32px, 4vw, 56px);
    align-items: start;
}

.car-details__layout,
.car-details__side {
    display: grid;
    gap: clamp(24px, 3vw, 40px);
}

.car-details__side {
    align-content: start;
    min-width: 0;
}

.car-gallery,
.car-summary {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity .6s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1);
    will-change: opacity, transform;
}

.car-gallery.is-visible,
.car-summary.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.car-summary {
    transition-delay: 0.2s;
}

.car-details__kp-button {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
    transition-delay: .25s;
}

.car-details__kp-button.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.car-gallery {
    display: grid;
    gap: 14px;
    position:relative;
    width: 100%;
    min-width: 0;
}

.car-gallery::before{
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;

    background:
            linear-gradient(
                    180deg,
                    rgba(255,255,255,.08),
                    transparent 25%
            );

    z-index:2;
}

.car-gallery__main {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 10;
    object-fit: contain;
    background: #071320;
    border: 1px solid var(--urban-line);
    box-shadow: 0 25px 70px rgba(0,0,0,.45);
    transition: opacity .2s ease;
}

.car-gallery__stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #071320;
}

.car-gallery__arrow {
    position: absolute;
    z-index: 3;
    top: 50%;
    display: grid;
    width: 48px;
    height: 64px;
    place-items: center;
    padding: 0;
    color: var(--urban-white);
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background .2s ease, border-color .2s ease, opacity .2s ease;
}

.car-gallery__arrow span {
    display: block;
    width: 17px;
    height: 17px;
    border-color: currentColor;
    border-style: solid;
    border-width: 0 2px 2px 0;
}

.car-gallery__arrow:hover {
    color: var(--urban-silver);
}

.car-gallery__arrow--prev span {
    margin-left: 7px;
    border-width: 0 0 2px 2px;
    transform: rotate(45deg);
}

.car-gallery__arrow--next span {
    margin-right: 7px;
    transform: rotate(-45deg);
}

.car-gallery__arrow:focus-visible {
    outline: 2px solid var(--urban-white);
    outline-offset: 3px;
}

.car-gallery__arrow--prev { left: 16px; }
.car-gallery__arrow--next { right: 16px; }

@media (max-width: 520px) {
    .car-gallery__arrow {
        width: 40px;
        height: 52px;
    }

    .car-gallery__arrow--prev { left: 10px; }
    .car-gallery__arrow--next { right: 10px; }
}

.car-gallery__thumbs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.car-gallery__thumbs button {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--urban-line);
    background: #111;
    padding: 0;
    cursor: pointer;
    opacity: 0.62;
    transition:
            opacity .25s ease,
            border-color .25s ease,
            box-shadow .25s ease;
}

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

.car-gallery__thumbs .car-gallery__thumb {
    transition: opacity .35s ease, transform .35s cubic-bezier(.16, 1, .3, 1), border-color .25s ease, box-shadow .25s ease;
}

.car-gallery__thumbs .car-gallery__thumb.is-entering,
.car-gallery__thumbs .car-gallery__thumb.is-leaving {
    opacity: 0;
    transform: translateY(12px);
}

.car-gallery__thumbs .car-gallery__toggle {
    min-height: 74px;
    min-width: 0;
    padding: 12px 18px;
    color: var(--urban-white);
    border: 1px solid var(--urban-line);
    background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .04em;
    opacity: 1;
    transition: background .25s ease, border-color .25s ease, transform .25s ease;
}

.car-gallery__thumbs .car-gallery__toggle:hover {
    border-color: var(--urban-white);
    background: rgba(255,255,255,.1);
    box-shadow: none;
    transform: translateY(-2px);
}

.car-gallery__thumbs button.is-active,
.car-gallery__thumbs button:hover {
    opacity: 1;
    border-color: var(--urban-white);
    box-shadow:
            0 10px 30px rgba(0,0,0,.35);
}

.car-gallery__thumbs button.is-active::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    top: 0;

    height: 2px;

    background: white;
}

.car-gallery__thumbs img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform .35s ease;
}

.car-summary {
    position: relative;
    align-self: start;
    min-width: 0;
    border: 1px solid var(--urban-line);
    background:
            linear-gradient(
                    180deg,
                    rgba(18,40,68,.95),
                    rgba(10,24,42,.95)
            );

    box-shadow:
            0 25px 70px rgba(0,0,0,.35);
    padding: clamp(20px, 2.2vw, 30px);
}

.car-summary--specs {
    position: sticky;
    top: 96px;
}

.car-summary::before{

    content:"";

    position:absolute;

    top:0;
    left:0;

    width:100%;
    height:1px;

    background:

            linear-gradient(
                    90deg,
                    transparent,
                    rgba(255,255,255,.4),
                    transparent
            );

}

.car-summary dl {
    margin: 0;
}

.car-summary__header {
    margin-bottom: 20px;
}

.car-summary__header .eyebrow {
    margin: 0 0 8px;
}

.car-summary__header h2 {
    margin: 0;
    color: var(--urban-white);
    font-size: clamp(1.4rem, 2vw, 1.9rem);
    line-height: 1.15;
    letter-spacing: 0;
}

.car-summary__specs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.car-summary__spec {
    min-width: 0;
    padding: 13px 14px 14px;
    border: 1px solid rgba(255, 255, 255, .09);
    background: rgba(4, 14, 25, .3);
}

.car-summary__spec dt {
    margin-bottom: 6px;
    color: var(--urban-muted);
    font-size: .69rem;
    font-weight: 600;
    letter-spacing: .055em;
    line-height: 1.4;
    text-transform: uppercase;
}

.car-summary__spec dd {
    margin: 0;
    color: var(--urban-white);
    font-size: clamp(.95rem, 1.3vw, 1.12rem);
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    overflow-wrap: anywhere;
}

.car-summary--data {
    position: relative;
    top: auto;
}

.car-equipment__groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 12px;
}

.car-equipment__group {
    min-width: 0;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, .09);
    background: rgba(4, 14, 25, .25);
}

.car-equipment__group h3 {
    margin: 0 0 8px;
    color: var(--urban-silver);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.4;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.car-summary__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: start;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.car-summary__row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.car-summary__row dt,
.car-summary__row dd {
    min-width: 0;
    margin: 0;
    font-size: .84rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.car-summary__row dt {
    color: var(--urban-muted);
}

.car-summary__row dd {
    color: var(--urban-white);
    font-weight: 650;
    text-align: right;
}

.car-summary__list .car-summary__row {
    padding: 13px 0;
}

.car-description {
    background: #10243d;
}

.car-description h2,
.request-section h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 4.7rem);
    font-weight: 700;
    line-height: 0.98;
}

.car-description p,
.request-section p {
    color: var(--urban-muted);
    font-size: 1.08rem;
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--urban-line);
}

.equipment-grid span {
    background: #071320;
    padding: 22px;
    color: var(--urban-silver);
    transition: background 0.3s ease, color 0.3s ease;
}

.equipment-grid span:hover {
    background: #17344f;
    color: var(--urban-white);
}

/* Inquiry form and similar vehicles */
.request-section {
    padding: clamp(64px, 8vw, 120px) 0;
    background: #132b47;
    position: relative;
    overflow: hidden;
}

.request-section__grid > div,
.request-form {
    opacity: 0;
    transform: translateY(30px);
    transition:
            opacity .8s cubic-bezier(.16,1,.3,1),
            transform .8s cubic-bezier(.16,1,.3,1),
            box-shadow .3s ease;
}

.request-section__grid > div.is-visible,
.request-form.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.request-form.is-visible {
    transition-delay: 0.2s;
}

.request-form,
.contacts-form {
    display: grid;
    gap: 12px;
}

.request-form input,
.request-form textarea {
    width: 100%;
    border: 1px solid var(--urban-line);
    border-radius: 0;
    background: #071320;
    color: var(--urban-white);
    padding: 14px 16px;
    outline: 0;
    transition: border-color 250ms ease, background 250ms ease, box-shadow 250ms ease;
}

.request-form input:focus,
.request-form textarea:focus {
    border-color: var(--urban-white);
    background: #10243d;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.04);
}

.form-legal {
    margin: 2px 0 8px;
    color: var(--urban-muted);
    font-size: 0.82rem;
}

.form-legal a {
    color: var(--urban-white);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.similar-section .section-heading {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.similar-section .section-heading.is-visible {
    opacity: 1;
    transform: translateY(0);
}

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

.request-form:hover {
    box-shadow:
            0 20px 40px rgba(0,0,0,.18);
}

@media (max-width: 980px) {
    .car-details__grid,
    .car-description__grid,
    .request-section__grid {
        grid-template-columns: 1fr;
    }

    .car-summary {
        position: static;
    }

    .equipment-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.car-hero { min-height: 100vh; min-height: 100svh; }
.car-hero h1 { font-size: clamp(2.8rem, 7vw, 7rem); line-height: 1.04; letter-spacing: 0; overflow-wrap: anywhere; }
.car-hero strong { line-height: 1.2; }
.request-form input, .request-form textarea { width: 100%; min-width: 0; height: auto; min-height: 52px; line-height: 1.5; }
.request-form textarea { min-height: 128px; padding-block: 14px; resize: vertical; }
.form-legal { line-height: 1.55; overflow-wrap: anywhere; }
.car-description h2, .request-section h2 { line-height: 1.08; letter-spacing: 0; }

@media (max-width: 720px) {
    .car-hero { padding: 112px 16px 72px; }
    .car-hero h1 { font-size: clamp(2.5rem, 11vw, 4.5rem); }
    .car-summary { padding: 20px; }
    .car-gallery__thumbs { gap: 8px; }
}

@media (max-width: 520px) {
    .car-equipment__groups { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .car-summary__specs { grid-template-columns: 1fr; }
}

/* ===== Модальное окно "Получить КП" ===== */
.kp-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;

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

    padding: 24px;

    opacity: 0;
    pointer-events: none;
    transition: opacity 260ms ease;
}

.kp-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.kp-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 12, 22, .62);
    backdrop-filter: blur(8px);
}

.kp-modal__panel {
    position: relative;

    width: min(460px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;

    border: 1px solid var(--urban-line);
    border-radius: 0;

    background: linear-gradient(180deg, #10243d, #071320);
    box-shadow: 0 40px 80px rgba(0, 0, 0, .55);

    padding: clamp(28px, 4vw, 44px);

    color: var(--urban-white);

    transform: translateY(20px) scale(.98);
    transition: transform .45s cubic-bezier(.16, 1, .3, 1);
}

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

/* Кнопка закрытия — крестик как в меню */
.kp-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;

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

    width: 40px;
    height: 40px;

    border: 1px solid transparent;
    background: rgba(255, 255, 255, .02);
    color: var(--urban-white);
    cursor: pointer;

    transition: border-color 180ms ease, background 180ms ease;
}

.kp-modal__close:hover {
    border-color: var(--urban-line-strong);
    background: rgba(255, 255, 255, .08);
}

.kp-modal__close-icon {
    position: relative;
    width: 18px;
    height: 2px;
    background: transparent;
}

.kp-modal__close-icon::before,
.kp-modal__close-icon::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: 2px;
    background: var(--urban-white);
}

.kp-modal__close-icon::before { transform: rotate(45deg); }
.kp-modal__close-icon::after  { transform: rotate(-45deg); }

/* Заголовки */
.kp-modal__eyebrow {
    margin: 0 0 10px;
    color: var(--urban-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.kp-modal__title {
    margin: 0 0 24px;
    font-family: var(--urban-font-display);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1.1;
}

/* Форма — стили как в .request-form */
.kp-form {
    display: grid;
    gap: 12px;
}

.kp-form input[type="text"],
.kp-form input[type="tel"] {
    width: 100%;
    border: 1px solid var(--urban-line);
    border-radius: 0;
    background: #071320;
    color: var(--urban-white);
    padding: 14px 16px;
    outline: 0;
    transition: border-color 250ms ease, background 250ms ease, box-shadow 250ms ease;
}

.kp-form input:focus {
    border-color: var(--urban-white);
    background: #10243d;
    box-shadow: 0 0 15px rgba(255, 255, 255, .04);
}

.kp-form .text-danger {
    display: block;
    margin-top: 6px;
    color: #ff7a7a;
    font-size: .82rem;
}

.kp-form__submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
}

/* Блокировка скролла body */
body.kp-modal-open {
    overflow: hidden;
}

@media (max-width: 480px) {
    .kp-modal { padding: 12px; }
    .kp-modal__panel { padding: 24px 20px; }
}

.kp-form__spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, .2);
    border-top-color: #071320;
    border-radius: 50%;
    animation: kp-spin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes kp-spin {
    to { transform: rotate(360deg); }
}

.kp-form.is-loading .kp-form__spinner {
    display: inline-block;
}

.kp-form.is-loading .kp-form__submit {
    opacity: .75;
    cursor: progress;
    pointer-events: none;
}

.kp-form.is-loading input {
    opacity: .6;
    pointer-events: none;
}

.kp-modal.is-loading .kp-modal__close {
    opacity: .4;
    pointer-events: none;
}
