/* ========== SHARED FOOTER LAYER ========== */

/* ========== PREVIEW FOOTER ========== */
.preview-footer {
    --footer-accent: #183d5d;
    --footer-accent-soft: #2f5d88;
    --footer-accent-rgb: 24, 61, 93;
    position: relative;
    width: min(1280px, calc(100% - 40px));
    margin: 82px auto 0;
    padding: 38px 28px 20px;
    border-radius: 0;
    background: none;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    color: rgba(28, 30, 34, 0.9);
}

@supports (content-visibility: auto) {
    .preview-footer {
        content-visibility: auto;
        contain-intrinsic-size: 1px 520px;
    }
}

.preview-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 1px;
    background: linear-gradient(
        90deg,
        rgba(var(--footer-accent-rgb), 0),
        rgba(var(--footer-accent-rgb), 0.16) 18%,
        rgba(var(--footer-accent-rgb), 0.16) 82%,
        rgba(var(--footer-accent-rgb), 0)
    );
}

.preview-footer::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 12%;
    right: 12%;
    height: 44px;
    background: radial-gradient(ellipse at center, rgba(var(--footer-accent-rgb), 0.1), rgba(var(--footer-accent-rgb), 0) 72%);
    pointer-events: none;
    opacity: 0.74;
    transform: none;
    transition: opacity 0.34s ease, filter 0.34s ease;
}

.preview-footer__layout {
    display: grid;
    width: min(100%, 1116px);
    margin: 0 0 0 auto;
    grid-template-columns: minmax(0, 0.96fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "company contacts useful";
    column-gap: clamp(34px, 3vw, 48px);
    row-gap: 30px;
    align-items: start;
    padding: 0 0 24px;
}

.preview-footer__brand {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    position: relative;
}

.preview-footer__brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    max-width: 100%;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    transition:
        transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.22s ease;
}

.preview-footer__brand-copy {
    display: grid;
    gap: 2px;
    align-self: center;
    min-width: 0;
    max-width: min(100%, 16rem);
    padding-top: 0;
}

.preview-footer__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    contain: paint;
    padding: 4px;
    border-radius: 16px;
    border: 1px solid rgba(var(--footer-accent-rgb), 0.08);
    background: linear-gradient(180deg, rgba(247, 249, 252, 0.98) 0%, rgba(201, 212, 227, 0.92) 100%);
    box-shadow:
        0 12px 28px rgba(15, 23, 42, 0.09),
        0 2px 6px rgba(var(--footer-accent-rgb), 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
    isolation: isolate;
    transition:
        box-shadow 0.22s ease,
        background 0.22s ease,
        border-color 0.22s ease;
}

.preview-footer__mark::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0) 46%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(167, 119, 60, 0.04));
    opacity: 0.94;
    z-index: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.preview-footer__logo {
    display: block;
    height: 86px;
    width: auto;
    max-width: 328px;
    border-radius: 12px;
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.06));
    transition: filter 0.22s ease;
}

.preview-footer__wave {
    display: block;
    position: absolute;
    inset: -185% -185%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 44%,
        rgba(255, 255, 255, 0.7) 50%,
        rgba(255, 255, 255, 0) 56%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translate(150%, -150%) rotate(10deg);
    opacity: 0.6;
    pointer-events: none;
    filter: blur(0.6px);
    z-index: 2;
    animation: logo-wave-shine 3.1s linear infinite;
    transition: opacity 0.22s ease;
}

.preview-footer__column {
    display: grid;
    align-content: start;
    gap: 14px;
    min-width: 0;
    padding-top: 6px;
}

.preview-footer__column--company {
    grid-area: company;
    gap: 18px;
    padding-top: 0;
    padding-left: 0;
    max-width: 36ch;
}

.preview-footer__column--contacts {
    grid-area: contacts;
    max-width: 34ch;
}

.preview-footer__column--useful {
    grid-area: useful;
    max-width: 34ch;
}

.preview-footer__column--company .preview-footer__brand {
    margin-bottom: 2px;
}

.preview-footer__company {
    display: block;
    margin: 0;
    color: rgba(33, 35, 40, 0.96);
    font-size: clamp(1rem, 0.94rem + 0.26vw, 1.1rem);
    font-weight: 800;
    line-height: 1.1;
    text-wrap: pretty;
    transition: color 0.22s ease;
}

.preview-footer__legal-text {
    margin: 0;
    color: rgba(58, 68, 79, 0.84);
    font-size: 1.04rem;
    line-height: 1.72;
    max-width: 37ch;
    text-wrap: pretty;
    transition: color 0.22s ease;
}

.preview-footer__label {
    display: block;
    color: rgba(var(--footer-accent-rgb), 0.86);
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 4px;
    transition: color 0.22s ease;
}

.preview-footer__brand-copy .preview-footer__label {
    margin-bottom: 0;
}

.preview-footer__column p,
.preview-footer__column a {
    margin: 0;
    color: rgba(40, 46, 53, 0.92);
    font-size: 1.04rem;
    line-height: 1.72;
    min-width: 0;
    text-wrap: pretty;
}

.preview-footer__column a {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 560;
    text-decoration: none;
    padding: 2px 4px 2px 0;
    margin: -2px -4px -2px 0;
    border-radius: 8px;
    background-color: rgba(var(--footer-accent-rgb), 0);
    box-shadow: inset 0 -0.18em 0 rgba(var(--footer-accent-rgb), 0);
    transition:
        color 0.18s ease,
        transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

.preview-footer__column p {
    color: rgba(68, 78, 88, 0.84);
    font-weight: 510;
}

.preview-footer__column a:hover,
.preview-footer__list a:hover,
.preview-footer__bottom a:hover {
    color: var(--footer-accent-soft);
}

.preview-footer__column i {
    color: rgba(var(--footer-accent-rgb), 0.92);
    margin-top: 3px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.preview-footer__list {
    list-style: none;
    display: grid;
    gap: 11px;
    padding: 0;
    margin: 0;
}

.preview-footer__list li {
    margin: 0;
    color: rgba(40, 46, 53, 0.92);
    font-size: 1.04rem;
    line-height: 1.72;
    min-width: 0;
    text-wrap: pretty;
}

.preview-footer__list a {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    color: rgba(40, 46, 53, 0.92);
    text-decoration: none;
    font-weight: 560;
    min-width: 0;
    overflow-wrap: break-word;
    padding: 2px 4px 2px 0;
    margin: -2px -4px -2px 0;
    border-radius: 8px;
    background-color: rgba(var(--footer-accent-rgb), 0);
    box-shadow: inset 0 -0.18em 0 rgba(var(--footer-accent-rgb), 0);
    transition:
        color 0.18s ease,
        transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

.preview-footer__list--contacts li {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 13px;
    align-items: start;
    min-width: 0;
}

.preview-footer__list--contacts a,
.preview-footer__list--contacts span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.preview-footer__list--contacts a {
    margin-right: 0;
    padding-right: 0;
}

.preview-footer__list--contacts i {
    color: rgba(var(--footer-accent-rgb), 0.92);
    margin-top: 3px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.preview-footer__bottom {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: center;
    gap: 10px;
    padding-top: 26px;
    border-top: 1px solid rgba(var(--footer-accent-rgb), 0.16);
    text-align: center;
}

.preview-footer__bottom p {
    margin: 0;
    color: rgba(76, 86, 96, 0.8);
    font-size: 0.94rem;
    line-height: 1.66;
    max-width: 78ch;
    text-wrap: pretty;
}

.preview-footer__bottom p:first-child {
    color: rgba(66, 76, 86, 0.86);
    font-weight: 560;
}

.preview-footer__bottom p:last-child {
    color: rgba(84, 94, 104, 0.76);
}

.preview-footer__bottom a {
    color: inherit;
    text-decoration: none;
    display: inline-block;
    padding: 1px 3px;
    margin: -1px -3px;
    border-radius: 6px;
    background-color: rgba(var(--footer-accent-rgb), 0);
    box-shadow: inset 0 -0.14em 0 rgba(var(--footer-accent-rgb), 0);
    transition:
        color 0.18s ease,
        transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

.preview-footer__brand-link:hover,
.preview-footer__brand-link:focus-visible {
    transform: translateY(-1px);
    filter: saturate(1.01);
}

.preview-footer__brand-link:hover .preview-footer__mark,
.preview-footer__brand-link:focus-visible .preview-footer__mark {
    border-color: rgba(var(--footer-accent-rgb), 0.14);
    background: linear-gradient(180deg, rgba(252, 253, 255, 1) 0%, rgba(221, 229, 239, 0.96) 100%);
    box-shadow:
        0 14px 28px rgba(15, 23, 42, 0.1),
        0 2px 8px rgba(var(--footer-accent-rgb), 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.preview-footer__brand-link:hover .preview-footer__mark::before,
.preview-footer__brand-link:focus-visible .preview-footer__mark::before {
    opacity: 1;
    transform: none;
}

.preview-footer__brand-link:hover .preview-footer__logo,
.preview-footer__brand-link:focus-visible .preview-footer__logo {
    filter: drop-shadow(0 6px 12px rgba(67, 50, 36, 0.08));
}

.preview-footer__brand-link:hover .preview-footer__wave,
.preview-footer__brand-link:focus-visible .preview-footer__wave {
    opacity: 0.72;
}

.preview-footer__column--company:hover .preview-footer__company,
.preview-footer__column--company:focus-within .preview-footer__company {
    color: rgba(var(--footer-accent-rgb), 0.96);
}

.preview-footer__column--company:hover .preview-footer__legal-text,
.preview-footer__column--company:focus-within .preview-footer__legal-text {
    color: rgba(58, 68, 79, 0.94);
}

.preview-footer__column--company:hover .preview-footer__label,
.preview-footer__column--company:focus-within .preview-footer__label {
    color: rgba(var(--footer-accent-rgb), 0.94);
    letter-spacing: 0.16em;
}

.preview-footer__brand-link:focus-visible,
.preview-footer__column a:focus-visible,
.preview-footer__list a:focus-visible,
.preview-footer__bottom a:focus-visible {
    outline: 2px solid rgba(var(--footer-accent-rgb), 0.28);
    outline-offset: 6px;
    border-radius: 14px;
}

.preview-footer__column a:hover,
.preview-footer__column a:focus-visible,
.preview-footer__list a:hover,
.preview-footer__list a:focus-visible {
    transform: translateY(-1px);
    background-color: rgba(var(--footer-accent-rgb), 0.04);
    box-shadow:
        inset 0 -0.16em 0 rgba(var(--footer-accent-rgb), 0.12),
        0 8px 14px rgba(67, 50, 36, 0.04);
}

.preview-footer__column a:hover i,
.preview-footer__column a:focus-visible i,
.preview-footer__list a:hover i,
.preview-footer__list a:focus-visible i {
    color: var(--footer-accent-soft);
    transform: translateY(-1px);
}

.preview-footer__bottom a:hover,
.preview-footer__bottom a:focus-visible {
    transform: translateY(-1px);
    background-color: rgba(var(--footer-accent-rgb), 0);
    box-shadow: inset 0 -0.14em 0 rgba(var(--footer-accent-rgb), 0.12);
}

@media (max-width: 1100px) {
    .preview-footer {
        width: min(100%, calc(100% - 28px));
        margin-top: 44px;
        padding: 32px 20px 16px;
    }

    .preview-footer__layout {
        width: min(100%, 832px);
        margin: 0 auto;
        justify-content: center;
        justify-items: start;
        grid-template-columns: repeat(3, minmax(0, 15.5rem));
        grid-template-areas: "company contacts useful";
        column-gap: 26px;
        row-gap: 14px;
        padding: 0 0 18px;
        align-items: start;
    }

    .preview-footer__column {
        width: 100%;
        gap: 9px;
    }

    .preview-footer__column--company {
        gap: 10px;
        max-width: 15.5rem;
        justify-self: start;
    }

    .preview-footer__column--contacts,
    .preview-footer__column--useful {
        max-width: 15.5rem;
        justify-self: start;
    }

    .preview-footer__brand {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 7px;
        align-items: start;
    }

    .preview-footer__brand-copy {
        max-width: 8.4rem;
        gap: 2px;
    }

    .preview-footer__mark {
        border-radius: 14px;
        padding: 3px;
    }

    .preview-footer__logo {
        height: 58px;
        max-width: 176px;
    }

    .preview-footer__label {
        font-size: 0.72rem;
        letter-spacing: 0.14em;
    }

    .preview-footer__company {
        font-size: 0.9rem;
        line-height: 1.06;
    }

    .preview-footer__legal-text,
    .preview-footer__column a,
    .preview-footer__column p,
    .preview-footer__list a,
    .preview-footer__bottom p {
        font-size: 0.85rem;
        line-height: 1.42;
    }

    .preview-footer__legal-text {
        max-width: 24ch;
        text-wrap: balance;
    }

    .preview-footer__list {
        gap: 7px;
    }

    .preview-footer__list li {
        gap: 8px;
    }

    .preview-footer__bottom {
        width: min(100%, 832px);
        margin: 0 auto;
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 6px;
        padding-top: 14px;
    }

    .preview-footer__bottom p {
        max-width: none;
        text-align: center;
    }

    .preview-footer__bottom p:last-child {
        justify-self: center;
        text-align: center;
        white-space: normal;
    }
}

@media (min-width: 820px) and (max-width: 1100px) {
    .preview-footer {
        width: min(100%, calc(100% - 28px));
        margin-top: 22px;
        padding: 28px 18px 14px;
    }

    .preview-footer__layout {
        width: min(100%, 960px);
        grid-template-columns: minmax(0, 1.24fr) minmax(0, 1.06fr) minmax(0, 0.92fr);
        column-gap: clamp(24px, 3.2vw, 38px);
        row-gap: 12px;
        padding-bottom: 14px;
    }

    .preview-footer__column {
        gap: 8px;
    }

    .preview-footer__column--company,
    .preview-footer__column--contacts,
    .preview-footer__column--useful {
        max-width: none;
    }

    .preview-footer__brand {
        gap: 8px;
        align-items: center;
    }

    .preview-footer__brand-copy {
        max-width: 11.8rem;
    }

    .preview-footer__logo {
        height: 56px;
        max-width: 184px;
    }

    .preview-footer__company {
        font-size: 0.92rem;
        line-height: 1.08;
    }

    .preview-footer__legal-text {
        max-width: 31ch;
    }

    .preview-footer__legal-text,
    .preview-footer__column a,
    .preview-footer__column p,
    .preview-footer__list a,
    .preview-footer__list li {
        font-size: 0.84rem;
        line-height: 1.38;
    }

    .preview-footer__list {
        gap: 6px;
    }

    .preview-footer__bottom {
        width: min(100%, 960px);
        padding-top: 12px;
        gap: 5px;
    }
}

@media (max-width: 640.98px) {
    .preview-footer {
        width: min(100%, calc(100% - 24px));
        margin-top: 34px;
        padding: 24px 18px 16px;
    }

    .preview-footer::before {
        left: 20px;
        right: 20px;
    }

    .preview-footer__layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "company"
            "contacts"
            "useful";
        gap: 18px;
        padding-bottom: 14px;
    }

    .preview-footer__column,
    .preview-footer__column--company,
    .preview-footer__column--contacts,
    .preview-footer__column--useful {
        max-width: none;
        padding-left: 0;
    }

    .preview-footer__legal-text {
        color: rgba(32, 47, 64, 0.86);
        font-size: 0.96rem;
        line-height: 1.54;
    }

    .preview-footer__column a,
    .preview-footer__list a {
        color: rgba(20, 31, 44, 0.94);
    }

    .preview-footer__list li {
        gap: 10px;
    }

    .preview-footer__bottom {
        gap: 8px;
        padding-top: 14px;
    }

    .preview-footer__bottom p {
        font-size: 0.92rem;
        line-height: 1.42;
    }
}

@media (min-width: 641px) and (max-width: 819px) {
    .preview-footer {
        width: min(100%, calc(100% - 28px));
        margin-top: 22px;
        padding: 22px 16px 14px;
    }

    .preview-footer__layout {
        width: min(100%, 760px);
        grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.14fr) minmax(0, 0.82fr);
        grid-template-areas: "company contacts useful";
        column-gap: clamp(14px, 2.8vw, 22px);
        row-gap: 10px;
        padding-bottom: 14px;
        justify-items: start;
    }

    .preview-footer__column--company {
        display: grid;
        gap: 8px;
        max-width: none;
        padding: 0;
        border-bottom: 0;
    }

    .preview-footer__column--company .preview-footer__brand {
        margin-bottom: 0;
    }

    .preview-footer__brand-copy {
        max-width: 8.2rem;
    }

    .preview-footer__brand {
        gap: 7px;
        align-items: start;
    }

    .preview-footer__logo {
        height: 48px;
        max-width: 150px;
    }

    .preview-footer__company {
        font-size: 0.84rem;
        line-height: 1.06;
    }

    .preview-footer__legal-text {
        max-width: 23ch;
        font-size: 0.74rem;
        line-height: 1.34;
        text-wrap: pretty;
    }

    .preview-footer__column--contacts,
    .preview-footer__column--useful {
        max-width: none;
        justify-self: stretch;
    }

    .preview-footer__column--contacts {
        padding-right: clamp(10px, 2vw, 16px);
        border-right: 1px solid rgba(var(--footer-accent-rgb), 0.08);
    }

    .preview-footer__label {
        font-size: 0.64rem;
        letter-spacing: 0.12em;
    }

    .preview-footer__list {
        gap: 5px;
    }

    .preview-footer__list--contacts li {
        grid-template-columns: 14px minmax(0, 1fr);
        gap: 7px;
    }

    .preview-footer__column a,
    .preview-footer__column p,
    .preview-footer__list a,
    .preview-footer__list li {
        font-size: 0.74rem;
        line-height: 1.32;
    }

    .preview-footer__bottom {
        width: min(100%, 760px);
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        text-align: center;
        gap: 7px;
        padding-top: 12px;
    }

    .preview-footer__bottom p {
        font-size: 0.72rem;
        line-height: 1.32;
        text-align: center;
    }

    .preview-footer__bottom p:last-child {
        justify-self: center;
        text-align: center;
        white-space: nowrap;
    }
}

@media (max-width: 640.98px) {
    .preview-footer__brand {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px;
        align-items: center;
    }

    .preview-footer__brand-copy {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-self: center;
        min-height: 64px;
        max-width: none;
        padding-top: 0;
    }

    .preview-footer__company {
        font-size: 1.02rem;
        line-height: 1.12;
    }

    .preview-footer__logo {
        height: 64px;
        max-width: 220px;
    }
}

@media (min-width: 1101px) and (hover: hover) and (pointer: fine) {
    .preview-footer__brand-link:hover .preview-footer__mark {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
    }

    .preview-footer__brand-link:hover .preview-footer__logo {
        filter: none;
    }

    body#top :is(
        .catalog-page,
        .services-page,
        .gallery-page,
        .prices-page,
        .contacts-page,
        .payment-docs-page,
        .privacy-page,
        .automation-product-page
    ) + .preview-footer {
        margin-top: 22px;
    }
}

@media (max-width: 1100px) {
    body#top .gallery-page + .preview-footer {
        margin-top: clamp(8px, 1.5vw, 14px);
    }
}

@media (max-width: 760px) {
    body#top .gallery-page + .preview-footer {
        margin-top: 34px;
    }
}

/* Tablet and phone desktop-site footer: keep the three footer groups in one compact row. */
@media (min-width: 820px) and (max-width: 1100px),
    (pointer: coarse) and (min-width: 900px) and (max-width: 1600px) and (max-aspect-ratio: 2 / 3),
    (hover: none) and (min-width: 900px) and (max-width: 1600px) and (max-aspect-ratio: 2 / 3),
    (min-width: 900px) and (max-width: 1600px) and (max-height: 900px) and (orientation: landscape) and (pointer: coarse) {
    .preview-footer {
        width: min(100%, calc(100% - 40px));
        margin-top: clamp(22px, 3vw, 36px);
        padding: 26px clamp(18px, 2.4vw, 30px) 16px;
    }

    .preview-footer__layout {
        width: min(100%, 980px);
        margin-inline: auto;
        grid-template-columns: minmax(0, 1.08fr) minmax(0, 1.04fr) minmax(0, 0.88fr);
        grid-template-areas: "company contacts useful";
        column-gap: clamp(20px, 3vw, 36px);
        row-gap: 12px;
        justify-items: stretch;
        padding-bottom: 16px;
    }

    .preview-footer__column,
    .preview-footer__column--contacts,
    .preview-footer__column--useful {
        max-width: none;
        padding-left: 0;
    }

    .preview-footer__column--company {
        display: grid;
        gap: 9px;
        align-items: start;
        max-width: none;
        padding: 0;
        border-bottom: 0;
    }

    .preview-footer__column--company .preview-footer__brand {
        align-self: start;
        margin-bottom: 0;
    }

    .preview-footer__brand-copy {
        max-width: 10.4rem;
    }

    .preview-footer__brand {
        gap: 8px;
        align-items: start;
    }

    .preview-footer__logo {
        height: 54px;
        max-width: 174px;
    }

    .preview-footer__company {
        font-size: 0.9rem;
        line-height: 1.08;
    }

    .preview-footer__legal-text {
        max-width: 31ch;
        font-size: 0.8rem;
        line-height: 1.38;
        text-wrap: pretty;
    }

    .preview-footer__column--contacts {
        padding-right: clamp(12px, 2vw, 24px);
        border-right: 1px solid rgba(var(--footer-accent-rgb), 0.08);
    }

    .preview-footer__label {
        font-size: 0.68rem;
        letter-spacing: 0.13em;
    }

    .preview-footer__list {
        gap: 6px;
    }

    .preview-footer__list--contacts li {
        grid-template-columns: 16px minmax(0, 1fr);
        gap: 8px;
    }

    .preview-footer__column a,
    .preview-footer__column p,
    .preview-footer__list a,
    .preview-footer__list li {
        font-size: 0.8rem;
        line-height: 1.36;
    }

    .preview-footer__bottom {
        width: min(100%, 980px);
        margin-inline: auto;
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        text-align: center;
        gap: 8px;
        padding-top: 14px;
    }

    .preview-footer__bottom p {
        width: auto;
        font-size: 0.78rem;
        line-height: 1.36;
        text-align: center;
    }

    .preview-footer__bottom p:last-child {
        justify-self: center;
        text-align: center;
        white-space: nowrap;
    }
}

@media (min-width: 641px) and (max-width: 819px) {
    body#top .gallery-page + .preview-footer {
        margin-top: clamp(8px, 1.5vw, 12px);
    }
}

@media (max-width: 540px) {
    body#top .gallery-page + .preview-footer {
        margin-top: 28px;
    }
}

/* Scenic footer contract: one rhythm for the same footer on home and inner pages. */
.preview-footer {
    --footer-gap-before: 0px;
    --footer-gap-adjust: 0px;
    --footer-scene: url("../images/footer/footer-gates-desktop-crop.webp");
    --footer-scene-space: clamp(230px, 15.5vw, 342px);
    --footer-scene-x: center;
    --footer-scene-y: clamp(-24px, -1vw, -12px);
    --footer-scene-size: 100% auto;
    --footer-rule-y: calc(var(--footer-scene-space) - 8px);
    --footer-floor-tint: rgba(246, 235, 218, 0.44);
    --footer-floor-glow: rgba(211, 172, 112, 0.1);
    --footer-floor-height: 56%;
    overflow: hidden;
    width: 100%;
    max-width: none;
    margin: calc(var(--footer-gap-before) + var(--footer-gap-adjust)) 0 0;
    padding: var(--footer-scene-space) clamp(22px, 3vw, 34px) 0;
    border: 0;
    border-radius: 0;
    background-color: #fffefc;
    background-image:
        var(--footer-scene),
        radial-gradient(ellipse at 92% 78%, var(--footer-floor-glow), rgba(211, 172, 112, 0) 38%),
        linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 252, 247, 0.34) 42%, var(--footer-floor-tint) 100%);
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-position:
        var(--footer-scene-x) var(--footer-scene-y),
        center bottom,
        center bottom;
    background-size:
        var(--footer-scene-size),
        100% var(--footer-floor-height),
        100% var(--footer-floor-height);
    content-visibility: visible;
    contain-intrinsic-size: auto;
    box-shadow:
        0 -24px 58px rgba(255, 255, 255, 0.62),
        0 18px 54px rgba(35, 55, 72, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.preview-footer::before {
    top: var(--footer-rule-y);
    left: clamp(22px, 4vw, 64px);
    right: clamp(22px, 4vw, 64px);
    height: 1px;
    background: linear-gradient(
        90deg,
        rgba(var(--footer-accent-rgb), 0),
        rgba(var(--footer-accent-rgb), 0.12),
        rgba(194, 151, 87, 0.16),
        rgba(var(--footer-accent-rgb), 0)
    );
}

.preview-footer::after {
    top: calc(var(--footer-scene-space) - 72px);
    left: auto;
    right: clamp(18px, 5vw, 88px);
    width: min(420px, 42vw);
    height: 150px;
    background:
        radial-gradient(ellipse at 72% 50%, rgba(215, 184, 132, 0.16), rgba(215, 184, 132, 0) 62%),
        radial-gradient(ellipse at center, rgba(var(--footer-accent-rgb), 0.055), rgba(var(--footer-accent-rgb), 0) 70%);
    opacity: 0.52;
    filter: blur(2px);
}

.preview-footer__layout,
.preview-footer__bottom {
    position: relative;
    z-index: 1;
}

.preview-footer__layout {
    padding-top: 0;
    margin-inline: auto;
}

@media (min-width: 1400px) {
    .preview-footer {
        --footer-scene-space: clamp(245px, 14.2vw, 342px);
        --footer-scene-size: 100% auto;
    }
}

@media (min-width: 1200px) and (max-width: 1919px) {
    .preview-footer {
        --footer-scene-size: auto calc(100% + 36px);
    }
}

@media (min-width: 820px) and (max-width: 1199px) and (orientation: landscape) {
    .preview-footer {
        --footer-gap-before: 0px;
        --footer-scene: url("../images/footer/footer-gates-tablet-landscape-tight.webp");
        --footer-scene-y: clamp(-10px, -0.9vw, -4px);
        --footer-scene-space: clamp(154px, 14.8vw, 206px);
        --footer-scene-size: 100% auto;
        --footer-floor-height: 48%;
    }
}

@media (min-width: 641px) and (max-width: 1100px) and (orientation: portrait) {
    .preview-footer {
        --footer-gap-before: 0px;
        --footer-scene: url("../images/footer/footer-gates-tablet-portrait-tight.webp");
        --footer-scene-y: clamp(-22px, -2.2vw, -14px);
        --footer-scene-space: clamp(158px, 19vw, 202px);
        --footer-scene-size: 100% auto;
        --footer-floor-height: 46%;
    }
}

/* Phone desktop-site portrait reports a wide, very tall touch viewport; tighten the footer scene there. */
@media (pointer: coarse) and (min-width: 900px) and (max-width: 1100px) and (max-aspect-ratio: 2 / 3),
    (hover: none) and (min-width: 900px) and (max-width: 1100px) and (max-aspect-ratio: 2 / 3) {
    .preview-footer {
        --footer-gap-before: 0px;
        --footer-scene-y: clamp(-54px, -4.6vw, -36px);
        --footer-scene-space: clamp(138px, 16vw, 166px);
        --footer-floor-height: 54%;
    }
}

@media (pointer: coarse) and (min-width: 1101px) and (max-width: 1300px) and (max-aspect-ratio: 2 / 3),
    (hover: none) and (min-width: 1101px) and (max-width: 1300px) and (max-aspect-ratio: 2 / 3) {
    .preview-footer {
        --footer-gap-before: 0px;
        --footer-scene-y: clamp(-40px, -2.4vw, -24px);
        --footer-scene-space: clamp(178px, 14.5vw, 196px);
        --footer-floor-height: 58%;
    }
}

@media (min-width: 641px) and (max-width: 819px) {
    .preview-footer {
        --footer-gap-before: 0px;
        --footer-scene: url("../images/footer/footer-gates-tablet-portrait-tight.webp");
        --footer-scene-y: clamp(-20px, -2vw, -12px);
        --footer-scene-space: clamp(150px, 20vw, 172px);
        --footer-scene-size: 100% auto;
        --footer-floor-height: 48%;
    }
}

@media (min-width: 900px) and (max-width: 1220px) and (max-height: 560px) {
    .preview-footer {
        --footer-gap-before: 0px;
        --footer-scene: url("../images/footer/footer-gates-tablet-landscape-tight.webp");
        --footer-scene-y: clamp(-6px, -0.6vw, -2px);
        --footer-scene-space: clamp(132px, 12vw, 168px);
        --footer-scene-size: 100% auto;
        --footer-floor-height: 46%;
    }
}

@media (max-width: 640.98px) {
    .preview-footer {
        --footer-gap-before: 0px;
        --footer-scene: url("../images/footer/footer-gates-mobile-tight.webp");
        --footer-scene-y: clamp(-18px, -3.8vw, -10px);
        --footer-scene-space: clamp(128px, 33vw, 208px);
        --footer-scene-size: calc(100% + clamp(76px, 18vw, 116px)) auto;
        --footer-rule-y: calc(var(--footer-scene-space) - 10px);
        --footer-floor-height: 70%;
        --footer-floor-tint: rgba(247, 235, 216, 0.38);
        --footer-floor-glow: rgba(211, 172, 112, 0.08);
        background-image:
            linear-gradient(
                180deg,
                rgba(255, 254, 252, 0) 0%,
                rgba(255, 254, 252, 0) calc(var(--footer-scene-space) - 32px),
                rgba(255, 254, 252, 0.88) var(--footer-scene-space),
                rgba(255, 254, 252, 0.96) 100%
            ),
            var(--footer-scene),
            radial-gradient(ellipse at 92% 78%, var(--footer-floor-glow), rgba(211, 172, 112, 0) 38%),
            linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 252, 247, 0.34) 42%, var(--footer-floor-tint) 100%);
        background-position:
            center top,
            var(--footer-scene-x) var(--footer-scene-y),
            center bottom,
            center bottom;
        background-size:
            100% 100%,
            var(--footer-scene-size),
            100% var(--footer-floor-height),
            100% var(--footer-floor-height);
        padding-inline: 18px;
        border-radius: 0;
    }

    body#top :is(
        .catalog-page,
        .services-page,
        .gallery-page,
        .prices-page,
        .contacts-page,
        .payment-docs-page,
        .privacy-page,
        .automation-product-page
    ) + .preview-footer {
        margin-top: var(--footer-gap-before);
    }

    .preview-footer::after {
        display: none;
    }
}

@media (max-width: 380px) {
    .preview-footer {
        --footer-scene: url("../images/footer/footer-gates-mobile-small-tight.webp");
        --footer-scene-y: clamp(-18px, -4.2vw, -10px);
        --footer-scene-space: clamp(100px, 28vw, 118px);
    }
}

body#top .apple-shell:has(> .preview-footer) {
    padding-bottom: 0;
}

body#top .apple-shell > .preview-footer {
    --footer-gap-adjust: 0px;
    width: calc(100% + 40px);
    margin-right: -20px;
    margin-left: -20px;
}

@media (min-width: 1200px) {
    .preview-footer {
        background-image: var(--footer-scene);
        background-repeat: no-repeat;
        background-position: var(--footer-scene-x) var(--footer-scene-y);
        background-size: var(--footer-scene-size);
    }

    body#top .apple-shell > .preview-footer,
    body#top > .preview-footer,
    body#top :is(
        .catalog-page,
        .services-page,
        .gallery-page,
        .prices-page,
        .contacts-page,
        .payment-docs-page,
        .privacy-page,
        .automation-product-page
    ) + .preview-footer {
        --footer-gap-adjust: -8px;
    }
}

@media (pointer: coarse) and (min-width: 1301px) and (max-width: 1600px) and (min-height: 1200px) and (max-aspect-ratio: 3 / 4) {
    .preview-footer {
        --footer-gap-before: 0px;
        --footer-scene-y: clamp(-44px, -2.4vw, -30px);
        --footer-scene-space: clamp(188px, 13.8vw, 212px);
        --footer-scene-size: 100% auto;
        --footer-floor-height: 58%;
    }
}

@media (pointer: coarse) and (min-width: 1601px) and (max-width: 2200px) and (min-height: 1200px) and (max-aspect-ratio: 3 / 4),
    (hover: none) and (min-width: 1601px) and (max-width: 2200px) and (min-height: 1200px) and (max-aspect-ratio: 3 / 4) {
    .preview-footer {
        --footer-gap-before: 0px;
        --footer-scene-y: clamp(-50px, -2.35vw, -32px);
        --footer-scene-space: clamp(158px, 9vw, 190px);
        --footer-scene-size: 100% auto;
        --footer-floor-height: 56%;
    }

    .preview-footer__layout {
        padding-bottom: 18px;
    }

    .preview-footer__bottom {
        gap: 8px;
        padding-top: 18px;
    }
}

/* Tall desktop-site portrait: keep page content intrinsic and let only the direct footer absorb spare height. */
@media (min-width: 1101px) and (min-height: 1400px) and (max-aspect-ratio: 9 / 10) {
    html {
        min-height: 100%;
    }

    body#top {
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
    }

    body#top > .header,
    body#top > .apple-shell {
        flex: 0 0 auto;
        min-width: 0;
    }

    body#top > :is(
        .catalog-page,
        .services-page,
        .gallery-page,
        .prices-page,
        .contacts-page,
        .payment-docs-page,
        .privacy-page,
        .automation-product-page
    ) {
        display: block !important;
        flex: 0 0 auto !important;
        min-width: 0;
        min-height: 0 !important;
    }

    body#top :is(
        .catalog-page,
        .services-page,
        .gallery-page,
        .prices-page,
        .contacts-page,
        .payment-docs-page,
        .privacy-page,
        .automation-product-page
    ) > .container {
        display: block !important;
        flex: 0 0 auto !important;
        min-width: 0;
        min-height: 0 !important;
    }

    .preview-footer {
        --footer-gap-before: 0px;
        --footer-gap-adjust: 0px;
        --footer-scene: url("../images/footer/footer-gates-desktop-crop.webp");
        --footer-scene-y: clamp(-36px, -1.4vw, -22px);
        --footer-scene-space: clamp(214px, 11.8vw, 252px);
        --footer-scene-size: auto calc(100% + 48px);
        --footer-rule-y: calc(var(--footer-scene-space) - 22px);
        --footer-floor-height: 56%;
        padding-bottom: clamp(22px, 1.2vw, 34px);
    }

    body#top > .preview-footer {
        display: block !important;
        flex: 1 0 auto !important;
        margin-top: 0 !important;
        min-height: 0 !important;
        --footer-scene-y: clamp(-88px, -5.8vw, -62px);
        --footer-scene-size: auto clamp(760px, 62vw, 860px);
        --footer-scene-space: clamp(184px, 14.2vw, 212px);
        --footer-rule-y: calc(var(--footer-scene-space) - 6px);
        background-color: #fffefc;
        background-image:
            var(--footer-scene),
            radial-gradient(ellipse at 88% 72%, rgba(211, 172, 112, 0.12), rgba(211, 172, 112, 0) 42%),
            linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 252, 247, 0.3) 48%, rgba(246, 235, 218, 0.34) 100%);
        background-repeat: no-repeat, no-repeat, no-repeat;
        background-position:
            var(--footer-scene-x) var(--footer-scene-y),
            center bottom,
            center bottom;
        background-size:
            var(--footer-scene-size),
            100% 100%,
            100% 100%;
    }

    .preview-footer__layout {
        padding-bottom: clamp(10px, 0.9vw, 16px);
    }

    .preview-footer__bottom {
        justify-content: center;
        gap: 8px 14px;
        padding-top: clamp(10px, 0.9vw, 18px);
        padding-bottom: clamp(14px, 0.9vw, 22px);
        text-align: center;
    }

    body#top .apple-shell > .preview-footer,
    body#top > .preview-footer,
    body#top :is(
        .catalog-page,
        .services-page,
        .gallery-page,
        .prices-page,
        .contacts-page,
        .payment-docs-page,
        .privacy-page,
        .automation-product-page
    ) + .preview-footer {
        --footer-gap-adjust: 0px;
    }

    body#top > .preview-footer .preview-footer__layout {
        margin: 0 auto !important;
    }
}

/* Wide desktop-site portrait: the footer is full width, so keep the gates artwork full width too. */
@media (min-width: 1900px) and (min-height: 2600px) and (max-aspect-ratio: 9 / 10) {
    body#top .preview-footer {
        --footer-scene-size: 100% auto;
        --footer-scene-space: clamp(218px, 9.8vw, 258px);
        --footer-rule-y: calc(var(--footer-scene-space) - 10px);
    }

    body#top .apple-shell > .preview-footer,
    body#top > .preview-footer {
        --footer-scene-y: clamp(-96px, -4.1vw, -78px);
    }
}

/* Extreme Android Chrome desktop-site zoom: scale inner pages instead of stretching their cards. */
@media (min-width: 2200px) and (min-height: 3200px) and (max-aspect-ratio: 9 / 10) {
    body#top > :is(
        .catalog-page,
        .services-page,
        .gallery-page,
        .prices-page,
        .contacts-page,
        .payment-docs-page,
        .privacy-page,
        .automation-product-page
    ) {
        zoom: 1.1;
    }
}

@media (min-width: 2600px) and (min-height: 3800px) and (max-aspect-ratio: 9 / 10) {
    body#top > :is(
        .catalog-page,
        .services-page,
        .gallery-page,
        .prices-page,
        .contacts-page,
        .payment-docs-page,
        .privacy-page,
        .automation-product-page
    ) {
        zoom: 1.25;
    }
}

@media (min-width: 2750px) and (min-height: 4000px) and (max-aspect-ratio: 9 / 10) {
    body#top > :is(
        .catalog-page,
        .services-page,
        .gallery-page,
        .prices-page,
        .contacts-page,
        .payment-docs-page,
        .privacy-page,
        .automation-product-page
    ) {
        zoom: 1.38;
    }
}

@media (max-width: 640.98px) {
    body#top .apple-shell:has(> .preview-footer) {
        padding-bottom: 0;
    }
}

@media (max-width: 1100px) {
    body#top .apple-shell > .preview-footer {
        width: calc(100% + 24px);
        margin-right: -12px;
        margin-left: -12px;
    }
}

/* Final guardrail: old page-specific footer margins must use the same contract variable. */
body#top .apple-shell > .preview-footer,
body#top > .preview-footer,
body#top :is(
    .catalog-page,
    .services-page,
    .gallery-page,
    .prices-page,
    .contacts-page,
    .payment-docs-page,
    .privacy-page,
    .automation-product-page
) + .preview-footer {
    margin-top: calc(var(--footer-gap-before) + var(--footer-gap-adjust));
}

/* Final footer brand polish: only the original logo mark lifts, not the company copy. */
.preview-footer__brand,
.preview-footer__brand:hover,
.preview-footer__brand:focus-visible {
    transform: none !important;
    filter: none !important;
    background: none !important;
    box-shadow: none !important;
}

.preview-footer__brand .preview-footer__brand-copy,
.preview-footer__brand:hover .preview-footer__brand-copy,
.preview-footer__brand:focus-visible .preview-footer__brand-copy {
    transform: none !important;
}

.preview-footer__mark {
    transition:
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.22s ease,
        border-color 0.22s ease,
        background 0.22s ease !important;
}

.preview-footer__logo {
    object-fit: contain !important;
    transform: none !important;
    transform-origin: center !important;
    transition: filter 0.22s ease !important;
}

.preview-footer__wave {
    inset: -185% -185% !important;
}

.preview-footer__brand:hover .preview-footer__mark,
.preview-footer__brand:focus-visible .preview-footer__mark {
    transform: translateY(-4px) !important;
    border-color: rgba(var(--footer-accent-rgb), 0.18) !important;
    background: linear-gradient(180deg, rgba(252, 253, 255, 1) 0%, rgba(221, 229, 239, 0.96) 100%) !important;
    box-shadow:
        0 14px 28px rgba(15, 23, 42, 0.1),
        0 2px 8px rgba(var(--footer-accent-rgb), 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.86) !important;
}

.preview-footer__brand:hover .preview-footer__logo,
.preview-footer__brand:focus-visible .preview-footer__logo {
    filter: drop-shadow(0 8px 14px rgba(67, 50, 36, 0.1)) !important;
    transform: none !important;
}

.preview-footer__column a.preview-footer__brand:hover,
.preview-footer__column a.preview-footer__brand:focus-visible {
    color: rgba(40, 46, 53, 0.92) !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.preview-footer__column--company:hover .preview-footer__brand-copy .preview-footer__label,
.preview-footer__column--company:focus-within .preview-footer__brand-copy .preview-footer__label {
    color: rgba(var(--footer-accent-rgb), 0.86) !important;
    letter-spacing: 0.16em !important;
}

.preview-footer__column--company:hover .preview-footer__company,
.preview-footer__column--company:focus-within .preview-footer__company {
    color: rgba(33, 35, 40, 0.96) !important;
}

@media (min-width: 820px) and (max-width: 1100px),
    (pointer: coarse) and (min-width: 900px) and (max-width: 1600px) and (max-aspect-ratio: 2 / 3),
    (hover: none) and (min-width: 900px) and (max-width: 1600px) and (max-aspect-ratio: 2 / 3),
    (min-width: 900px) and (max-width: 1600px) and (max-height: 900px) and (orientation: landscape) and (pointer: coarse) {
    .preview-footer__brand {
        pointer-events: none !important;
        cursor: default !important;
    }

    .preview-footer__mark {
        pointer-events: auto !important;
        cursor: pointer !important;
    }

    .preview-footer__brand-copy {
        pointer-events: none !important;
        cursor: default !important;
    }
}

@media (max-width: 819px) {
    .preview-footer__brand {
        pointer-events: none !important;
        cursor: default !important;
    }

    .preview-footer__mark {
        pointer-events: auto !important;
        cursor: pointer !important;
    }

    .preview-footer__brand-copy {
        pointer-events: none !important;
        cursor: default !important;
    }
}
