:root {
    --bg: #f9f4f7;
    --bg-soft: #f3edf0;
    --surface: #ffffff;
    --surface-soft: #f6f1f4;
    --panel: #a7b831;
    --accent: #619cf5;
    --accent-soft: #a19f9d;
    --text: #17191c;
    --muted: #73767a;
    --line: rgba(161, 159, 157, 0.16);
    --success: #22c55e;
    --danger: #ef4444;
    --shadow: 0 18px 40px rgba(22, 24, 27, 0.05);
    --radius: 22px;
    --radius-sm: 16px;
    --content-width: 1320px;
    --font-body: "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text);
    background: linear-gradient(180deg, #f9f4f7 0%, #f3edf0 100%);
}

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

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

button,
input,
textarea,
select {
    font: inherit;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-main {
    width: min(calc(100% - 2rem), var(--content-width));
    margin: 0 auto;
    padding: 1.2rem 0 5rem;
    flex: 1;
}

.hero,
.auth-layout,
.admin-grid,
.policy-layout,
.inventory-section,
.vehicle-detail,
.admin-panels,
.editorial-grid {
    animation: fade-up 320ms ease both;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 1rem;
    align-items: end;
    padding-top: 1.5rem;
}

.hero__copy {
    padding: 1rem 0 1.5rem 0.25rem;
}

.hero__visual {
    margin: 0;
    display: grid;
    gap: 0.85rem;
}

.hero__media {
    min-height: 46rem;
    border-radius: var(--radius);
    overflow: hidden;
    background: #e7e1e5;
    box-shadow: var(--shadow);
}

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

.hero__caption {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.hero h1,
.auth-layout h1,
.admin-grid h1,
.policy-layout h1 {
    margin: 0.2rem 0 1rem;
    font-size: clamp(3.4rem, 7.5vw, 7.2rem);
    line-height: 0.93;
    letter-spacing: -0.06em;
    font-weight: 400;
    max-width: 7ch;
}

.hero__lead {
    margin: 0;
    max-width: 40ch;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.85;
}

.eyebrow {
    margin: 0;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.72rem;
    font-weight: 700;
}

.stack-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.hero__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2.2rem;
}

.hero__facts span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.hero__facts strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.98rem;
    font-weight: 600;
}

.editorial-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
}

.editorial-card {
    padding: 1.5rem 1.35rem 1.6rem;
    border-top: 1px solid rgba(161, 159, 157, 0.2);
}

.editorial-card--panel {
    background: rgba(167, 184, 49, 0.14);
    border: 1px solid rgba(167, 184, 49, 0.22);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.editorial-card h2,
.section-heading h2,
.inventory-section h1,
.admin-panels h2,
.card h2 {
    margin: 0.35rem 0 0.75rem;
    font-size: clamp(1.7rem, 2.3vw, 2.7rem);
    line-height: 1;
    letter-spacing: -0.05em;
    font-weight: 500;
}

.inventory-section {
    margin-top: 4rem;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.vehicle-grid,
.admin-panels,
.vehicle-detail {
    display: grid;
    gap: 1rem;
}

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

.admin-panels,
.vehicle-detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1.5rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.card,
.vehicle-card,
.cookie-banner {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card,
.vehicle-card {
    padding: 1.35rem;
}

.vehicle-card {
    overflow: hidden;
}

.vehicle-card__image {
    margin: -1.35rem -1.35rem 1rem;
    aspect-ratio: 16 / 10;
    background: #ebe5e8;
    overflow: hidden;
}

.vehicle-card__image img,
.vehicle-gallery__hero img,
.vehicle-gallery__thumb img,
.vehicle-admin-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vehicle-card h2,
.vehicle-card h3 {
    margin: 0.55rem 0 0.7rem;
    font-size: 1.35rem;
    line-height: 1.06;
    letter-spacing: -0.03em;
    font-weight: 500;
}

.vehicle-card p,
.card p,
.policy-body,
.editorial-card p {
    color: var(--muted);
    line-height: 1.75;
}

.vehicle-card__meta,
.spec-list,
.spec-pills,
.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.vehicle-card__meta span,
.table-meta {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
}

.spec-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.spec-list li,
.spec-pills span {
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(161, 159, 157, 0.18);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 0.88rem;
}

.vehicle-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.vehicle-gallery {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.vehicle-gallery__hero {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #ebe5e8;
    position: relative;
}

.vehicle-gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.vehicle-gallery__viewer {
    position: relative;
}

.gallery-slide {
    display: none;
}

.gallery-slide.is-active {
    display: block;
}

.vehicle-gallery__thumb {
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: #ebe5e8;
    border: 1px solid transparent;
    cursor: pointer;
    transition: border-color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.vehicle-gallery__thumb.is-active {
    border-color: rgba(97, 156, 245, 0.44);
    transform: translateY(-2px);
}

.gallery-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(23, 25, 28, 0.72);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.gallery-control:hover,
.gallery-control:focus-visible {
    background: rgba(23, 25, 28, 0.9);
    transform: translateY(-50%) scale(1.03);
}

.gallery-control--prev {
    left: 1rem;
}

.gallery-control--next {
    right: 1rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.8rem 1.15rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--text);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 160ms ease, opacity 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-1px);
    opacity: 0.92;
}

.button--ghost {
    background: transparent;
    color: var(--text);
    border-color: rgba(161, 159, 157, 0.28);
}

.alert {
    border-radius: var(--radius-sm);
    padding: 0.95rem 1rem;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.alert--success {
    background: rgba(167, 184, 49, 0.18);
    border: 1px solid rgba(167, 184, 49, 0.28);
}

.alert--error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.22);
}

.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 50;
    width: min(960px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1rem 1.15rem;
    box-shadow: 0 18px 40px rgba(22, 24, 27, 0.12);
}

.cookie-banner__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.cookie-banner__title {
    margin: 0 0 0.25rem;
    font-weight: 600;
    color: var(--text);
}

.cookie-banner__actions {
    display: flex;
    gap: 0.65rem;
}

.filter-form,
.split-fields {
    display: grid;
    gap: 1rem;
}

.filter-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.policy-layout {
    max-width: 920px;
    margin: 0 auto;
}

.policy-layout .card {
    padding: 2rem;
}

.logo-preview {
    width: 120px;
    height: 120px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
    overflow: hidden;
}

.contact-band {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2.5rem;
}

.contact-band__panel {
    padding: 1.4rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.contact-band__panel h2 {
    margin: 0.35rem 0 0.8rem;
    font-size: clamp(1.35rem, 2vw, 2rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1100px) {
    .hero,
    .editorial-grid,
    .contact-band,
    .vehicle-grid,
    .admin-grid,
    .admin-panels,
    .vehicle-detail,
    .filter-form {
        grid-template-columns: 1fr;
    }

    .hero__media {
        min-height: 28rem;
    }

    .hero__copy {
        padding: 0;
    }
}

@media (max-width: 720px) {
    .page-main {
        width: min(calc(100% - 1.2rem), var(--content-width));
        padding-bottom: 4rem;
    }

    .hero {
        padding-top: 1rem;
    }

    .hero h1,
    .auth-layout h1,
    .admin-grid h1,
    .policy-layout h1 {
        max-width: none;
    }

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

    .cookie-banner__content {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-banner__actions,
    .stack-inline {
        width: 100%;
    }

    .cookie-banner {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        width: auto;
    }

    .gallery-control {
        width: 2.65rem;
        height: 2.65rem;
    }

    .gallery-control--prev {
        left: 0.75rem;
    }

    .gallery-control--next {
        right: 0.75rem;
    }
}
