:root {
    --bb-gutter: 24px;
}

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

*,
*::before,
*::after {
    min-width: 0;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

iframe {
    border: 0;
}

.container,
.container-fluid,
.wrap,
.shell {
    width: min(100% - var(--bb-gutter), 1200px) !important;
    max-width: 100% !important;
    margin-inline: auto !important;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-inline: calc(var(--bb-gutter) / -4);
}

.row > * {
    flex: 1 0 0;
    min-width: 0;
    padding-inline: calc(var(--bb-gutter) / 4);
}

.col-12 { flex: 0 0 auto; width: 100%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-3 { flex: 0 0 auto; width: 25%; }

.table-responsive,
.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

table {
    max-width: 100%;
}

.nav,
.navbar,
.nav-links,
.site-menu,
.account,
.actions,
.quick-links,
.social-links,
.footer-bottom,
.section-head,
.brand-toolbar {
    max-width: 100%;
}

.btn,
.nav-link,
.nav-links > a,
.site-menu a,
.account-link,
.account-button,
button,
input,
select,
textarea {
    max-width: 100%;
}

input,
select,
textarea {
    min-width: 0;
}

.details,
.card-details,
.gallery-body p,
.gallery-dialog-copy,
.dialog-body {
    overflow-wrap: anywhere;
}

#products,
#brands,
#gallery,
#brand-list,
#gallery-list,
.content,
.library-head {
    scroll-margin-top: 96px;
}

@media (max-width: 1180px) {
    :root { --bb-gutter: 22px; }

    .site-header .shell,
    .header .wrap {
        width: min(100% - var(--bb-gutter), 1180px) !important;
    }

    .site-menu,
    .nav-links {
        max-height: calc(100vh - 88px);
        overflow-y: auto;
    }

    .catalog-bar-inner,
    .location-layout,
    .hero-card,
    .panel {
        max-width: 100%;
    }

    .form-layout,
    .layout,
    .content,
    .dashboard,
    .about-layout,
    .location-layout {
        grid-template-columns: 1fr !important;
    }

    .crop-area {
        grid-template-columns: 1fr !important;
    }

    .gallery-grid,
    .brand-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 820px) {
    :root { --bb-gutter: 18px; }

    .products-grid,
    .brand-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .gallery-grid {
        grid-template-columns: 1fr !important;
    }

    .footer-main,
    .stats,
    .section-list,
    .fields,
    .filters {
        grid-template-columns: 1fr !important;
    }

    .intro,
    .hero-card,
    .library-head,
    .panel-head,
    .section-head,
    .brand-toolbar,
    .social-band-inner {
        align-items: flex-start !important;
        flex-direction: column !important;
    }
}

@media (max-width: 430px) {
    :root { --bb-gutter: 14px; }

    .products-grid,
    .brand-grid {
        gap: 10px !important;
    }
}
