/* Keep shared grids, navigation and quote controls usable at narrow widths. */
:where(.hero-copy, .catalogue-hero, .product-gallery, .products-toolbar, .product-copy,
       .drawer-head > div, .drawer-body, .site-footer__grid > *) {
    min-inline-size: 0;
}

.hero--studio :is(.hero-copy, .hero-media, #heroImage) {
    animation: none;
}

:where(.catalogue-crumbs, .product-copy, .drawer-head, .site-footer) {
    overflow-wrap: anywhere;
}

.drawer-body :is(input, textarea, select):not([type="checkbox"]):not([type="radio"]) {
    font-size: max(1rem, 16px);
}

.drawer-head .icon-button {
    align-self: start;
}

.drawer-body :is(.button, .line-item button) {
    min-block-size: 44px;
}

@media (max-width: 599px) {
    .products-toolbar .catalogue-search {
        flex: 1 1 100%;
    }
    .products-toolbar .products-sort {
        flex-wrap: wrap;
        max-inline-size: 100%;
    }
    .products-toolbar .products-sort select {
        max-inline-size: 100%;
    }
    .hero-actions .button, .corporate-actions .button, .drawer-actions .button {
        white-space: normal;
    }
}

@media (max-width: 359px) {
    .site-footer__grid { grid-template-columns: minmax(0, 1fr); }
    .site-footer__grid > :is(section, nav) { grid-column: auto; }
    .products-results .product-grid { grid-template-columns: minmax(0, 1fr); }
    .bottom-nav a, .bottom-nav button { line-height: 1.12; }
    .drawer-head, .drawer-body { padding-inline: 12px; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .header { position: static; }
    html { scroll-padding-block-start: .75rem; }
    #drawer, .drawer-layout {
        max-height: 100vh;
        max-height: 100dvh;
    }
    .drawer-head { padding-block: 8px; }
    .drawer-head h2 { font-size: clamp(1.5rem, 5vh, 2rem); }
    .drawer-head .label { font-size: .65rem; }
    .drawer-body { padding-block: 10px; }
}
