/* Layout dimensions; colours and spacing inherit editable WordPress presets. */
:root {
    --borz-sidebar-width: 17.5rem;
    --borz-cart-thumbnail-width: 5rem;
    --borz-control-target: 2.75rem;
    --borz-focus-width: 0.125rem;
    --borz-focus-offset: 0.25rem;
}

.borz-shell {
    display: grid;
    grid-template-columns: var(--borz-sidebar-width) minmax(0, 1fr);
    gap: 0;
    align-items: start;
    margin-block-start: 0;
}

.borz-shell > .borz-sidebar,
.borz-shell > .borz-content {
    min-width: 0;
    margin-block-start: 0;
}

.borz-sidebar {
    position: sticky;
    top: var(--wp-admin--admin-bar--height, 0);
}

.borz-content {
    overflow-wrap: anywhere;
    container-type: inline-size;
}

.borz-content > main {
    padding-inline: var(--wp--style--root--padding-left);
    padding-block: var(--wp--preset--spacing--40);
}

.borz-header :is(button, a):focus-visible {
    outline: var(--borz-focus-width) solid currentColor;
    outline-offset: var(--borz-focus-offset);
}

/* Keep the menu usable without scrolling past a desktop sidebar on phones. */
@media (max-width: 782px) {
    .borz-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .borz-sidebar {
        position: static;
    }

    .borz-header .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: none;
    }

    .borz-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
        display: flex;
        min-width: var(--borz-control-target);
        min-height: var(--borz-control-target);
        align-items: center;
        justify-content: center;
    }
}

/* Core columns otherwise use viewport width even beside a desktop sidebar. */
@container (max-width: 40rem) {
    .borz-content .wp-block-columns:not(.is-not-stacked-on-mobile) {
        flex-direction: column;
    }

    .borz-content .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
        flex-basis: auto !important;
        width: 100%;
    }
}

.borz-header .wp-block-site-title a:hover {
    color: inherit;
    text-decoration: underline;
}

@media (min-width: 783px) {
    .borz-full-width-header .borz-header > .wp-block-group,
    .borz-full-width-header .borz-brand,
    .borz-full-width-header .borz-actions,
    .borz-full-width-header .wp-block-navigation__container {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--wp--preset--spacing--30);
    }

    .borz-full-width-header .borz-header > .wp-block-group {
        justify-content: space-between;
    }
}
