/* Final public layout guard: keeps shared header/footer consistent on all public pages. */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--border, #e7e8ec);
    backdrop-filter: blur(14px);
}

.topbar-inner,
.header-inner {
    width: min(100%, 1188px);
    min-height: 66px;
    margin: 0 auto;
    padding: 0 16px;
    display: grid !important;
    grid-template-columns: auto minmax(260px, 1fr) auto !important;
    align-items: center;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text, #151515);
    text-decoration: none;
    white-space: nowrap;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--primary, #08c45c);
}

.brand-mark svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-wordmark {
    display: block;
    width: 118px;
    max-width: 118px;
    height: auto;
}

.main-nav {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 34px;
}

.main-nav a {
    min-height: 66px;
    display: inline-flex;
    align-items: center;
    color: #5f646d;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--text, #151515);
}

.header-actions {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.city-control {
    min-width: 210px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid var(--border, #e7e8ec);
    border-radius: 12px;
    background: var(--surface-muted, #f1f2f4);
    color: var(--text, #151515);
}

.city-control .icon {
    width: 20px;
    height: 20px;
    color: var(--primary, #08c45c);
    display: grid;
    place-items: center;
}

.city-control .city-text {
    display: grid;
    gap: 2px;
    min-width: 0;
    text-align: left;
    line-height: 1.12;
}

.city-control strong,
.city-control .city-line {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 650;
}

.city-control small,
.city-control .address-line {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-soft, #60636b);
    font-size: 13px;
    font-weight: 450;
}

.profile-btn,
.cart-btn {
    width: 48px;
    height: 48px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border, #e7e8ec);
    border-radius: 50%;
    background: #fff;
    color: #111;
    text-decoration: none;
}

.profile-btn svg,
.cart-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.footer {
    padding: 34px 0 42px !important;
    border-top: 1px solid var(--border, #e7e8ec);
    background: #fff;
}

.footer-grid {
    width: min(100%, 1188px);
    margin: 0 auto;
    padding: 0 16px;
    display: grid !important;
    grid-template-columns: minmax(420px, 1.35fr) repeat(3, minmax(150px, .75fr)) !important;
    gap: 28px 46px !important;
    align-items: start;
}

.footer-grid > div:first-child {
    min-width: 0;
}

.footer .footer-brand {
    max-width: none;
    font-size: 0;
    line-height: 1;
    font-weight: 600;
}

.footer .footer-logo {
    display: block;
    width: 118px;
    height: auto;
}

.footer p,
.footer .footer-desc {
    max-width: 640px !important;
    margin-top: 13px;
    color: var(--text-soft, #60636b);
    font-size: 14px;
    line-height: 1.55;
    font-weight: 400 !important;
}

.footer .footer-title {
    margin-bottom: 12px;
    color: var(--text, #151515);
    font-size: 15px;
    line-height: 1.2;
    font-weight: 600 !important;
}

.footer .footer-links {
    list-style: none;
    display: grid;
    gap: 9px;
    padding: 0;
    margin: 0;
    color: var(--text-soft, #60636b);
    font-size: 14px;
    line-height: 1.3;
    font-weight: 400 !important;
}

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

.footer a:hover {
    color: var(--primary, #08c45c);
}

@media (max-width: 980px) {
    .topbar-inner,
    .header-inner {
        grid-template-columns: auto 1fr auto !important;
    }

    .main-nav {
        display: none !important;
    }

    .city-control {
        min-width: 0;
        max-width: 230px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 24px 22px !important;
    }

    .footer-grid > div:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .topbar-inner,
    .header-inner {
        min-height: 72px;
        grid-template-columns: auto minmax(0, 1fr) !important;
        padding: 8px 12px;
        gap: 8px;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
    }

    .brand-wordmark {
        width: 86px;
        max-width: 24vw;
    }

    .header-actions {
        width: 100%;
        min-width: 0;
        display: flex !important;
        justify-content: flex-end;
        gap: 8px;
    }

    .city-control {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        height: 48px;
        padding: 0 10px;
        gap: 8px;
        border-radius: 14px;
    }

    .city-control .icon {
        width: 18px;
        height: 18px;
        flex: 0 0 auto;
    }

    .city-control .city-copy,
    .city-control .city-text {
        min-width: 0;
        max-width: 100%;
    }

    .city-control .city-main,
    .city-control strong,
    .city-control .city-line {
        display: none;
    }

    .city-control .city-sub,
    .city-control small,
    .city-control .address-line {
        display: block;
        max-width: 100%;
        overflow: hidden;
        color: var(--text, #151515);
        font-size: 14px;
        font-weight: 500;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .profile-btn {
        display: none;
    }

    .cart-btn,
    .cart-link {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
    }

    .filters-sticky {
        position: static !important;
        top: auto !important;
        z-index: 1 !important;
        background: var(--bg, #f7f7f8) !important;
        backdrop-filter: none !important;
    }

    .footer {
        padding: 26px 0 92px !important;
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 22px 18px !important;
    }

    .footer p,
    .footer .footer-desc {
        max-width: none !important;
        margin-top: 10px;
        font-size: 13px;
        line-height: 1.45;
    }

    .footer .footer-title {
        margin-bottom: 9px;
        font-size: 13px;
    }

    .footer .footer-links {
        gap: 8px;
        font-size: 12px;
        line-height: 1.35;
    }
}
