/* Banner quảng cáo 2 bên + gom mobile dưới cùng */

.buyer-ads-layout {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
}

.buyer-ads-layout__body {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
    width: 100%;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

.buyer-ads-layout__center {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.buyer-ads-layout__side {
    flex: 0 0 160px;
    width: 160px;
    padding: 0.75rem 0.5rem;
    align-items: flex-start;
}

.buyer-ads-layout__side--left {
    padding-left: max(0.5rem, env(safe-area-inset-left));
}

.buyer-ads-layout__side--right {
    padding-right: max(0.5rem, env(safe-area-inset-right));
}

.cms-side-banners {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: sticky;
    top: 5.5rem;
}

.cms-side-banner {
    background: var(--tada-surface, #fff);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.cms-side-banner__img {
    display: block;
    max-height: 280px;
    object-fit: cover;
}

.cms-side-banner__body {
    padding: 0.5rem 0.6rem 0.65rem;
}

.cms-side-banner__title {
    line-height: 1.3;
}

.cms-side-banner__link {
    color: inherit;
}

.cms-side-banner__link:hover {
    color: inherit;
    opacity: 0.92;
}

/* Mobile: gom tất cả quảng cáo (top + 2 bên) xuống dưới, trước footer */
.buyer-ads-mobile-stack {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--buyer-bg, var(--tada-bg, #f5f5f5));
    padding: 0.75rem max(0.75rem, env(safe-area-inset-left)) 1rem max(0.75rem, env(safe-area-inset-right));
}

.buyer-ads-mobile-stack .cms-top-banners,
.buyer-ads-mobile-stack .cms-side-banners {
    position: static;
}

.buyer-ads-mobile-stack .cms-top-banners {
    margin-bottom: 0.75rem;
}

.buyer-ads-mobile-stack .cms-side-banner {
    margin-bottom: 0.65rem;
}

.buyer-ads-mobile-stack .cms-side-banner:last-child {
    margin-bottom: 0;
}

body.theme-buyer.layout-marketplace .cms-side-banner {
    border-color: #d5d9d9;
}

body.theme-buyer.has-mobile-bar .buyer-ads-mobile-stack {
    margin-bottom: 0;
}

@media (max-width: 1199.98px) {
    body.theme-buyer.has-mobile-bar .page-wrap {
        padding-bottom: 0;
    }
}

@media (min-width: 1200px) {
    .buyer-ads-mobile-stack {
        display: none !important;
    }
}

@media (max-width: 1199.98px) {
    .buyer-ads-layout__side,
    .buyer-ads-layout__top-desktop {
        display: none !important;
    }
}
