/* ===== Footer ===== */
.hm-footer {
    padding-block: clamp(40px, 4vw, 56px) 32px;
    font-family: var(--hm-font-body);
    font-size: var(--hm-fs-small);
    line-height: 1.45;
}
.hm-footer [hidden] { display: none !important; }
.hm-footer__inner {
    display: grid;
    grid-template-columns: minmax(140px, 200px) minmax(0, 1fr) auto;
    grid-template-areas:
        "logo   nav contacts"
        "social nav contacts"
        "bottom bottom bottom";
    grid-template-rows: auto 1fr auto;
    column-gap: clamp(24px, 3vw, 48px);
    row-gap: 18px;
    max-width: calc(1400px + var(--hm-gutter) * 2);
}

/* Logo & messengers */
.hm-footer__logo { grid-area: logo; display: block; justify-self: start; line-height: 0; }
.hm-footer__logo-img { width: auto; height: 40px; }
.hm-footer__social { grid-area: social; display: flex; gap: 14px; margin: 0; padding: 0; list-style: none; align-self: start; }
.hm-footer__social a {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    color: var(--hm-c-on-dark-muted);
    transition: color var(--hm-dur) var(--hm-ease);
}
.hm-footer__social a:hover { color: var(--hm-c-on-dark); }
.hm-footer__social svg { width: 22px; height: 22px; }

.hm-footer__slogan { display: none; }

/* Menu columns */
.hm-footer__nav {
    --_cols: var(--hm-footer-cols, auto-fit);   /* admin option: style="--hm-footer-cols: 5" on the root */
    grid-area: nav;
    display: grid;
    grid-template-columns: repeat(var(--_cols), minmax(112px, 1fr));
    align-items: stretch;
    min-width: 0;
}
.hm-footer__col { min-width: 0; padding: 0 14px 12px; }
.hm-footer__col + .hm-footer__col { border-left: 1px solid var(--hm-c-line); }
.hm-footer__col:first-child { padding-left: 0; }
.hm-footer__col:last-child { border-right: 1px solid var(--hm-c-line); }
.hm-footer__col-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.hm-footer__col-title a,
.hm-footer__col--plain .hm-footer__links a {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    text-decoration: none;
}
.hm-footer__links { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; margin: 0; padding: 0; list-style: none; }
.hm-footer__links a {
    display: block;
    overflow: hidden;
    font-size: 12px;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color var(--hm-dur) var(--hm-ease), opacity var(--hm-dur);
}
.hm-footer__col--plain .hm-footer__links { gap: 9px; }
.hm-footer__nav a:hover { color: var(--hm-c-accent); }
.hm-footer__toggle { display: none; }

/* Contacts */
.hm-footer__contacts {
    grid-area: contacts;
    display: grid;
    align-content: start;
    justify-items: end;
    gap: 10px;
    font-style: normal;
    text-align: right;
}
.hm-footer__contact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    word-break: break-word;
}
.hm-footer__contact svg { flex: none; width: 18px; height: 18px; }
.hm-footer__contact:hover { color: var(--hm-c-accent); }
.hm-footer__address { margin-top: 8px; font-size: 13px; }
.hm-footer__hours { color: var(--hm-c-on-dark-muted); font-size: 12px; }
.hm-footer__route {
    --hm-btn-h: 38px;
    margin-top: 4px;
    padding-inline: 22px;
    font-size: 11px;
}
.hm-footer__route svg { width: 16px; height: 16px; transition: transform var(--hm-dur) var(--hm-ease); }
.hm-footer__route:hover svg { transform: translateX(3px); }

/* Copyright */
.hm-footer__bottom {
    grid-area: bottom;
    margin: 28px 0 0;
    color: var(--hm-c-on-dark-muted);
    font-size: 11px;
    text-align: center;
    text-wrap: pretty;
}

/* ---------- Tablet ---------- */
@media (max-width: 1023px) {
    .hm-footer__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "logo     contacts"
            "social   contacts"
            "nav      nav"
            "bottom   bottom";
        grid-template-rows: auto 1fr auto auto;
        row-gap: 24px;
    }
    .hm-footer__nav { --_cols: 3; margin-top: 12px; row-gap: 28px; }
    .hm-footer__col:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
}

/* ---------- Mobile: contacts first, menu in two columns ---------- */
@media (max-width: 767px) {
    .hm-footer { padding-top: 44px; font-size: 15px; }
    .hm-footer__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "logo     social"
            "contacts contacts"
            "nav      nav"
            "bottom   bottom";
        grid-template-rows: none;
        row-gap: 36px;
    }
    .hm-footer__logo-img { height: 38px; }
    .hm-footer__social { align-self: center; gap: 18px; }
    .hm-footer__social a { width: 32px; height: 32px; }
    .hm-footer__social svg { width: 28px; height: 28px; }

    .hm-footer__contacts { justify-items: start; gap: 14px; text-align: left; }
    .hm-footer__contact { gap: 14px; font-size: 16px; font-weight: 400; }
    .hm-footer__contact svg { width: 22px; height: 22px; }
    .hm-footer__address { margin-top: 18px; color: var(--hm-c-on-dark-muted); font-size: 15px; }
    .hm-footer__hours { margin-top: -6px; font-size: 14px; }
    .hm-footer__route { --hm-btn-h: 46px; margin-top: 12px; padding-inline: 20px 18px; font-size: 14px; }
    .hm-footer__route svg { width: 20px; height: 20px; }

    .hm-footer__nav { --_cols: var(--hm-footer-cols-m, 2); margin-top: 0; grid-template-columns: repeat(var(--_cols), minmax(0, 1fr)); row-gap: 32px; }
    .hm-footer__col,
    .hm-footer__col + .hm-footer__col,
    .hm-footer__col:nth-child(n) { padding: 0 16px 4px 0; border: 0; }
    .hm-footer__col:nth-child(even) { padding: 0 0 4px 16px; border-left: 1px solid var(--hm-c-line); }
    .hm-footer__col-title { margin-bottom: 16px; }
    .hm-footer__col-title a,
    .hm-footer__col--plain .hm-footer__links a { font-size: 15px; letter-spacing: .04em; }
    .hm-footer__links { gap: 6px; }
    .hm-footer__links a { font-size: 15px; font-weight: 300; white-space: normal; }
    .hm-footer__col--plain .hm-footer__links { gap: 10px; }

    .hm-footer__bottom { margin-top: 8px; font-size: 11px; }
}
