.mg-models {
    padding: 0 0 4rem;
}

.mg-models__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.mg-models__intro {
    flex: 0 1 auto;
    min-width: 0;
}

.mg-models__title {
    margin: 0 0 0.25rem;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
}

.mg-models__catalog-link {
    display: inline-block;
    font-size: 0.875rem;
    line-height: 1.2;
    color: var(--mg-accent);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.mg-models__catalog-link:hover {
    color: #fff;
}

.mg-models__search {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    max-width: 660px;
    min-width: 0;
}

.mg-models__search-icon {
    position: absolute;
    top: 50%;
    left: 0.875rem;
    width: 25px;
    height: 25px;
    color: rgba(255, 255, 255, 0.55);
    transform: translateY(-50%);
    pointer-events: none;
}

.mg-models__search-input {
    width: 100%;
    height: 45px;
    padding: 0 1rem 0 2.75rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 65px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font: inherit;
    font-size: 0.875rem;
}

.mg-models__search-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.mg-models__search-input:focus {
    outline: none;
    border-color: rgba(199, 169, 67, 0.65);
}

.mg-models__suggest {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    max-height: 320px;
    margin: 0;
    padding: 0.375rem;
    list-style: none;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: #202020;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.mg-models__suggest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0.5rem 0.875rem;
    border-radius: 10px;
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.25;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.mg-models__suggest-item:hover,
.mg-models__suggest-item.is-active {
    background: rgba(255, 255, 255, 0.08);
}

.mg-models__suggest-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mg-models__suggest-link {
    flex-shrink: 0;
    color: var(--mg-accent);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.mg-models__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.875rem;
}

.mg-car-card {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 270px;
    max-width: calc(25% - 1.41rem);
    min-height: 501px;
    --mg-card-btn: 50px;
    --mg-card-btn-gap: 3px;
    --mg-card-btn-bottom-gap: 8px;
    border: 0;
    border-radius: 20px;
    background: rgba(18, 18, 18, 0.85);
    overflow: hidden;
}

.mg-car-card__outline {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    z-index: 2;
}

.mg-car-card--hidden {
    display: none;
}

.mg-car-card.is-filter-hidden,
.mg-car-card.is-paged-out {
    display: none !important;
}

.mg-car-card__media {
    position: relative;
    z-index: 1;
    height: 240px;
    background: #121212;
    overflow: hidden;
}

.mg-car-card__media picture.mg-car-card__photo,
.mg-car-card__media > picture {
    display: block;
    width: 100%;
    height: 100%;
}

.mg-car-card__media picture img {
    transition: opacity 0.15s ease;
}

.mg-car-card__media.is-loading picture img {
    opacity: 0.55;
}

.mg-car-card__media > img,
.mg-car-card__media picture,
.mg-car-card__media picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-car-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.875rem;
}

.mg-car-card__nav {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.5rem;
    pointer-events: none;
}

.mg-car-card__nav-btn {
    display: inline-flex;
    padding: 0;
    border: 0;
    background: transparent;
    opacity: 0.85;
    cursor: pointer;
    pointer-events: auto;
    transition: opacity 0.2s ease;
}

.mg-car-card__nav-btn:hover {
    opacity: 1;
}

.mg-car-card__nav-btn:focus-visible {
    outline: 2px solid var(--mg-accent);
    outline-offset: 2px;
}

.mg-car-card__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding:
        1.875rem
        calc(var(--mg-card-btn) + var(--mg-card-btn-gap) * 2 + 0.5rem)
        0.75rem
        1.6875rem;
}

.mg-car-card__name {
    margin: 0 0 1.25rem;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
}

.mg-car-card__name a {
    color: var(--mg-accent);
}

.mg-car-card__name a:hover {
    color: #fff;
}

.mg-car-card__specs {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 auto;
    margin: 0 0 1.25rem;
    font-size: 15px;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.88);
}

.mg-car-card__specs strong {
    font-weight: 700;
    color: #fff;
}

.mg-car-card__prices {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.125rem;
    max-width: min(100%, calc(270px - var(--mg-card-btn) - var(--mg-card-btn-gap) * 3 - 1.6875rem));
    min-height: var(--mg-card-btn);
    margin-top: auto;
    margin-bottom: var(--mg-card-btn-bottom-gap);
    padding-right: 0.25rem;
}

.mg-car-card__price-old {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
    text-decoration: line-through;
    opacity: 0.75;
}

.mg-car-card__price {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--mg-accent);
}

.mg-car-card__price-byn {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.1;
    color: rgba(255, 255, 255, 0.78);
}

.mg-car-card__more {
    position: absolute;
    right: var(--mg-card-btn-gap);
    bottom: var(--mg-card-btn-bottom-gap);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--mg-card-btn);
    height: var(--mg-card-btn);
    border-radius: 10px;
    background: var(--mg-accent);
    color: #fff;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mg-car-card__more img {
    display: block;
    width: 26px;
    height: 26px;
}

.mg-car-card__more:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.mg-models__pagination {
    display: none;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: clamp(2rem, 4vw, 3rem);
}

.mg-models__pagination:not([hidden]) {
    display: flex;
}

.mg-models__pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.mg-models__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 8px;
    background: var(--mg-panel-bg);
    color: #fff;
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mg-models__page:hover {
    background: rgba(199, 169, 67, 0.3);
}

.mg-models__page.is-active {
    background: var(--mg-accent);
    color: #171717;
    font-weight: 700;
}

.mg-models__page--arrow svg {
    width: 20px;
    height: 20px;
}

.mg-models__page[disabled] {
    opacity: 0.4;
    cursor: default;
}

.mg-models__page[disabled]:hover {
    background: var(--mg-panel-bg);
}

.mg-models__more {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.mg-models__more.is-hiding {
    opacity: 0;
    transform: translateY(0.75rem);
    pointer-events: none;
}

.mg-models__more-btn {
    min-height: 48px;
    padding: 0 1.5rem;
    border: 1px solid var(--mg-accent);
    border-radius: 65px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.mg-models__more-btn:hover {
    background: var(--mg-accent);
    color: #171717;
    box-shadow: 0 8px 28px rgba(199, 169, 67, 0.35);
}

.mg-models__more-btn:active {
    transform: scale(0.98);
}

.mg-models__more-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

@keyframes mg-car-card-reveal {
    from {
        opacity: 0;
        transform: translateY(2rem) scale(0.97);
    }

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

.mg-car-card--revealing {
    animation: mg-car-card-reveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    .mg-models__more,
    .mg-models__more-btn,
    .mg-car-card--revealing {
        transition: none;
        animation: none;
    }
}

.mg-models__empty {
    margin: 2rem 0 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 1199px) {
    .mg-car-card {
        max-width: calc(33.333% - 1.25rem);
    }
}

@media (max-width: 991px) {
    .mg-models__head {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .mg-models__search {
        flex: 0 0 auto;
        max-width: none;
    }

    .mg-car-card {
        max-width: calc(50% - 0.9375rem);
    }
}

@media (max-width: 639px) {
    .mg-car-card {
        max-width: 100%;
        min-height: auto;
    }

    .mg-models__head {
        margin-bottom: 1rem;
    }
}
