/* Final mobile type rules override collection and page-specific font sizes. */
@media (max-width:575px) {
    body.deep-theme { --type-page:26px; --type-section:20px; --type-subsection:17px; }
    body.deep-theme #main-content h1 { font-size:clamp(23px,6.5vw,26px) !important; line-height:1.3; }
    body.deep-theme #main-content h2 { font-size:clamp(18px,5vw,20px) !important; line-height:1.4; }
    body.deep-theme #main-content h3 { font-size:17px !important; line-height:1.45; }
    body.deep-theme #main-content :is(.dh-product-body,.browse-product-body,.market-product-body,.browse-service-body,.browse-provider-card,.sd-related-card) h3 { font-size:15px !important; line-height:1.5; }
    body.deep-theme #main-content :is(h1,h2,h3) { overflow-wrap:anywhere; }
    body.deep-theme #main-content :is(.dh-section-heading,.popular-services-heading,.arrivals-heading,.dh-collection-header,.ab-section-heading,.sd-related-heading,.browse-hero,.service-hero-copy,.provider-hero-copy,.tiles-intro-copy,.hardware-intro-copy,.paint-intro-copy,.electric-collection-intro,.electrical-support-copy,.service-concierge-intro)>p {
        font-size:13px !important; line-height:1.65;
    }
    body.deep-theme #main-content :is(.deep-kicker,.eyebrow,.dh-hero-eyebrow,.dh-collection-eyebrow,.popular-services-eyebrow,.arrivals-eyebrow,.ab-eyebrow,.cu-eyebrow,.browse-eyebrow,.sd-eyebrow,.tiles-eyebrow,.hardware-eyebrow,.paint-eyebrow,.electric-collection-eyebrow,.electrical-support-eyebrow) {
        font-size:10px !important; line-height:1.6; letter-spacing:.07em;
    }
    body.deep-theme #main-content :is(.btn,.deep-button,.browse-btn,button[type="submit"],.popular-services-browse,.arrivals-browse,.dh-collection-view,.dh-section-heading>a) {
        font-size:12px !important; line-height:1.4; white-space:normal; overflow-wrap:anywhere; min-width:0;
    }
    body.deep-theme #main-content :is(.browse-product-price,.dh-product-price,.price-line)>strong { font-size:21px !important; }
    body.deep-theme #main-content :is(.browse-filter-title,.profile-mini) h2 { font-size:14px !important; }
}

/* Keep storefront item lists in one column below 420px. */
@media (max-width:419.98px) {
    body.deep-theme #main-content :is(.dh-product-grid,.browse-product-grid,.browse-card-grid,.interactive-product-grid,.sd-related-grid) {
        /* Collection-specific layouts use IDs; this rule applies to every list. */
        grid-template-columns:minmax(0,1fr) !important;
        grid-auto-flow:row !important;
        grid-auto-columns:auto !important;
    }

    /* Horizontal product rails become vertical lists at this size too. */
    body.deep-theme #main-content .dh-product-grid {
        overflow:visible !important;
        scroll-snap-type:none;
    }

    body.deep-theme #main-content .dh-product-grid > .dh-product-card {
        grid-column:auto !important;
        grid-row:auto !important;
    }
}
