/* TFD Mobile Homepage — phone only */

.home ul.products,
.home .woocommerce ul.products,
.home .wc-block-product-categories-list,
.home .wp-block-woocommerce-product-categories ul {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
    margin: 18px 14px 28px !important;
    padding: 0 !important;
}

.home ul.products li.product-category,
.home .woocommerce ul.products li.product-category,
.home .wc-block-product-categories-list-item,
.home .wp-block-woocommerce-product-categories li {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    text-align: center !important;
    border: 1px solid #e1e1e1 !important;
    border-radius: 8px !important;
    background: #fff !important;
    overflow: hidden !important;
    box-shadow: 0 4px 14px rgba(0,0,0,.055) !important;
}

.home ul.products li.product-category > a,
.home .woocommerce ul.products li.product-category > a,
.home .wc-block-product-categories-list-item > a,
.home .wp-block-woocommerce-product-categories li > a {
    display: block !important;
    color: #222 !important;
    text-decoration: none !important;
}

.home ul.products li.product-category img,
.home .woocommerce ul.products li.product-category img,
.home .wc-block-product-categories-list-item img,
.home .wp-block-woocommerce-product-categories img {
    display: block !important;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    margin: 0 !important;
    object-fit: cover !important;
    background: #f6f6f6 !important;
}

.home ul.products li.product-category h2,
.home .woocommerce ul.products li.product-category h2,
.home .wc-block-product-categories-list-item__name,
.home .wp-block-woocommerce-product-categories .wc-block-product-categories-list-item__name {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 58px !important;
    margin: 0 !important;
    padding: 10px 8px !important;
    color: #222 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    text-transform: none !important;
}

.home ul.products li.product-category .count,
.home .woocommerce ul.products li.product-category .count,
.home .wc-block-product-categories-list-item-count,
.home .wp-block-woocommerce-product-categories .wc-block-product-categories-list-item-count {
    display: none !important;
}

.home .storefront-product-section,
.home .woocommerce,
.home .wp-block-woocommerce-product-categories {
    width: 100% !important;
    max-width: 100% !important;
}

@media (max-width: 390px) {
    .home ul.products,
    .home .woocommerce ul.products,
    .home .wc-block-product-categories-list,
    .home .wp-block-woocommerce-product-categories ul {
        gap: 10px !important;
        margin-left: 10px !important;
        margin-right: 10px !important;
    }

    .home ul.products li.product-category h2,
    .home .woocommerce ul.products li.product-category h2,
    .home .wc-block-product-categories-list-item__name,
    .home .wp-block-woocommerce-product-categories .wc-block-product-categories-list-item__name {
        min-height: 54px !important;
        padding: 9px 6px !important;
        font-size: 13px !important;
    }
}


/* ==========================================================
   v1.3 FIXES
   ========================================================== */

/* Storefront adds clearfix pseudo-elements to product lists.
   In CSS Grid they can occupy the first card position and create
   the blank space seen before the first category. */
.home ul.products::before,
.home ul.products::after,
.home .woocommerce ul.products::before,
.home .woocommerce ul.products::after {
    display: none !important;
    content: none !important;
}

/* Ensure category cards fill the grid in normal order. */
.home ul.products,
.home .woocommerce ul.products {
    grid-auto-flow: row !important;
}

.home ul.products li.product-category,
.home .woocommerce ul.products li.product-category {
    clear: none !important;
}

/* Smaller homepage section titles on phones. */
.home .entry-content > h1,
.home .entry-content > h2,
.home .entry-content > h3,
.home .site-main > h1,
.home .site-main > h2,
.home .site-main > h3,
.home .homepage-section-title,
.home .storefront-product-section .section-title {
    margin-top: 22px !important;
    margin-bottom: 18px !important;
    font-size: 27px !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
}

/* Smaller, tighter category names. */
.home ul.products li.product-category h2,
.home .woocommerce ul.products li.product-category h2,
.home .wc-block-product-categories-list-item__name,
.home .wp-block-woocommerce-product-categories .wc-block-product-categories-list-item__name {
    min-height: 50px !important;
    padding: 8px 7px !important;
    font-size: 12.5px !important;
    line-height: 1.22 !important;
}

/* Compact mobile footer.
   Directions already exist in the mobile header, so the long page list
   and embedded map are unnecessary on phones. */
.site-footer {
    padding-top: 28px !important;
    padding-bottom: 28px !important;
}

.site-footer h2,
.site-footer h3,
.site-footer .widget-title {
    margin-bottom: 14px !important;
    font-size: 24px !important;
    line-height: 1.2 !important;
}

.site-footer p,
.site-footer li,
.site-footer a {
    font-size: 14px !important;
    line-height: 1.55 !important;
}

.site-footer .widget_pages,
.site-footer .widget_nav_menu,
.site-footer .widget_meta,
.site-footer .widget_categories,
.site-footer iframe,
.site-footer .wp-block-embed,
.site-footer .google-map,
.site-footer [class*="map"] iframe {
    display: none !important;
}

.site-footer .widget {
    margin-bottom: 20px !important;
}

.site-footer .footer-widgets,
.site-footer .col-full {
    padding-left: 18px !important;
    padding-right: 18px !important;
}

/* Reduce oversized footer buttons. */
.site-footer .button,
.site-footer a.button,
.site-footer .wp-block-button__link {
    min-width: 0 !important;
    width: auto !important;
    margin: 8px 8px 8px 0 !important;
    padding: 11px 18px !important;
    border-radius: 999px !important;
    font-size: 14px !important;
}

@media (max-width: 390px) {
    .home .entry-content > h1,
    .home .entry-content > h2,
    .home .entry-content > h3,
    .home .site-main > h1,
    .home .site-main > h2,
    .home .site-main > h3,
    .home .homepage-section-title,
    .home .storefront-product-section .section-title {
        font-size: 25px !important;
    }

    .home ul.products li.product-category h2,
    .home .woocommerce ul.products li.product-category h2,
    .home .wc-block-product-categories-list-item__name,
    .home .wp-block-woocommerce-product-categories .wc-block-product-categories-list-item__name {
        min-height: 48px !important;
        font-size: 12px !important;
    }
}


/* ==========================================================
   v1.4 MOBILE TYPOGRAPHY + LEARN MORE
   ========================================================== */

/* Smaller homepage H1 only on phones */
.home h1,
.home .entry-title,
.home .page-title,
.home .site-main > h1,
.home .entry-content > h1 {
    font-size: 34px !important;
    line-height: 1.12 !important;
    letter-spacing: -0.025em !important;
    margin-top: 24px !important;
    margin-bottom: 22px !important;
}

/* Smart Slider mobile typography */
.home .n2-ss-slider h1,
.home .n2-ss-slider h2,
.home .n2-ss-slider h3,
.home .n2-ss-slider .n2-ss-text,
.home .n2-ss-slider [class*="n2-ss-text"] {
    line-height: 1.1 !important;
}

.home .n2-ss-slider h1,
.home .n2-ss-slider .n2-ss-text[data-fontsize*="px"] {
    font-size: 30px !important;
}

.home .n2-ss-slider h2 {
    font-size: 27px !important;
}

.home .n2-ss-slider h3 {
    font-size: 22px !important;
}

/* Catch common Smart Slider text layers */
.home .n2-ss-slider .n2-ow,
.home .n2-ss-slider .n2-ss-item-content {
    max-width: 100% !important;
}

.home .n2-ss-slider .n2-ss-item-content > div {
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

/* Mobile SEO content collapsed with Learn More button */
.home .entry-content .tfd-mobile-seo-wrap {
    position: relative;
}

.home .entry-content .tfd-mobile-seo-content {
    max-height: 150px;
    overflow: hidden;
    transition: max-height .35s ease;
}

.home .entry-content .tfd-mobile-seo-content::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 48px;
    height: 54px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #fff);
    pointer-events: none;
}

.home .entry-content .tfd-mobile-seo-wrap.is-open .tfd-mobile-seo-content {
    max-height: 4000px;
}

.home .entry-content .tfd-mobile-seo-wrap.is-open .tfd-mobile-seo-content::after {
    display: none;
}

.home .tfd-mobile-seo-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 14px 0 8px;
    padding: 10px 18px;
    border: 1px solid #b72b22;
    border-radius: 999px;
    background: #fff;
    color: #b72b22;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

/* Smaller phones */
@media (max-width: 390px) {
    .home h1,
    .home .entry-title,
    .home .page-title,
    .home .site-main > h1,
    .home .entry-content > h1 {
        font-size: 31px !important;
    }

    .home .n2-ss-slider h1 {
        font-size: 27px !important;
    }

    .home .n2-ss-slider h2 {
        font-size: 24px !important;
    }

    .home .n2-ss-slider h3 {
        font-size: 20px !important;
    }
}
