/* Product collections on the homepage; preserve the shop and product templates. */
.stm-home { padding-bottom: 30px; }
.stm-home-section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 0 0;
}
.stm-home-section-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    font-size: 12px;
    font-weight: 650;
    color: var(--ink);
}
.stm-home-section-nav a:first-child { border-color: var(--brand); background: var(--brand); color: #fff; }
.stm-home-section-nav a:hover { border-color: var(--accent); }
.stm-home-section-nav .stm-icon { width: 17px; height: 17px; }
.stm-home-section-nav .stm-icon:last-child { width: 12px; height: 12px; margin-left: 8px; }
.stm-home-collections { display: grid; gap: 24px; margin-top: 16px; }
.stm-home-collection {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 22px #182f2310;
    scroll-margin-top: 24px;
}
.stm-home-collection-accessories { background: #f8f5f1; }
.palette-green .stm-home-collection-accessories { background: #f3f7f4; }
.stm-collection-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}
.stm-collection-eyebrow {
    margin: 0 0 5px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 750;
    line-height: 1.4;
    letter-spacing: .08em;
}
.stm-collection-heading h2 {
    margin: 0 0 6px;
    font-size: 27px;
    color: var(--ink);
    line-height: 1.25;
}
.stm-collection-description { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.stm-collection-more {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    font-size: 12px;
    font-weight: 650;
}
.stm-collection-more .stm-icon { width: 17px; height: 17px; }
.stm-theme .stm-home-collection .stm-home-products ul.products {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}
.stm-theme .stm-home-collection ul.products > li.product {
    margin: 0;
    padding: 11px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    box-shadow: 0 2px 8px #182f2305;
}
.stm-theme .stm-home-collection ul.products > li.product:hover {
    border-color: var(--accent);
    box-shadow: 0 5px 16px #182f2312;
}
.stm-theme .stm-home-collection .stm-home-products ul.products li.product a img { height: 178px; }
.stm-theme .stm-home-collection ul.products li.product .woocommerce-loop-product__title {
    line-height: 1.45;
    min-height: 2.9em;
    -webkit-line-clamp: 2;
}
.stm-home > .stm-services { margin-top: 24px; }
@media (min-width: 768px) and (max-width: 991px) {
    .stm-theme .stm-home-collection .stm-home-products ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stm-home-collection { padding: 18px; }
    .stm-collection-heading h2 { font-size: 24px; }
}
@media (max-width: 767px) {
    .stm-home-section-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding: 12px 0 4px; gap: 7px; }
    .stm-home-section-nav a { flex: 0 0 auto; padding: 9px 11px; font-size: 11px; }
    .stm-home-section-nav .stm-icon:last-child { margin-left: 1px; }
    .stm-home-collections { gap: 18px; margin-top: 12px; }
    .stm-home-collection { padding: 14px 10px; border-radius: 10px; }
    .stm-collection-heading { display: block; margin-bottom: 12px; }
    .stm-collection-eyebrow { font-size: 9px; margin-bottom: 5px; }
    .stm-collection-heading h2 { font-size: 23px; margin-bottom: 5px; }
    .stm-collection-description { font-size: 11px; }
    .stm-collection-more { min-height: 44px; font-size: 11px; margin-top: 2px; }
    .stm-theme .stm-home-collection .stm-home-products ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .stm-theme .stm-home-collection ul.products > li.product { padding: 8px; }
    .stm-theme .stm-home-collection .stm-home-products ul.products li.product a img { height: 140px; }
    .stm-theme .stm-home-collection ul.products li.product .woocommerce-loop-product__title { font-size: 12px; }
    /* An odd final product fills the last row as a compact horizontal card. */
    .stm-theme .stm-home-collection ul.products > li.product:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 10px;
    }
    .stm-theme .stm-home-collection ul.products > li.product:last-child:nth-child(odd) > .woocommerce-loop-product__link {
        grid-column: 1 / -1;
        grid-row: 1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto auto 1fr;
        column-gap: 10px;
        align-content: start;
    }
    .stm-theme .stm-home-collection .stm-home-products ul.products > li.product:last-child:nth-child(odd) > .woocommerce-loop-product__link > img {
        grid-column: 1;
        grid-row: 1 / 4;
        height: 170px;
        margin: 0;
    }
    .stm-theme .stm-home-collection ul.products > li.product:last-child:nth-child(odd) .woocommerce-loop-product__title {
        grid-column: 2;
        grid-row: 1;
        align-self: start;
        margin-bottom: 7px;
    }
    .stm-theme .stm-home-collection ul.products > li.product:last-child:nth-child(odd) .stm-card-rating {
        grid-column: 2;
        grid-row: 2;
        align-self: start;
        margin-bottom: 0;
    }
    .stm-theme .stm-home-collection ul.products > li.product:last-child:nth-child(odd) > .stm-product-bottom {
        grid-column: 2;
        grid-row: 1;
        align-self: end;
        position: relative;
        z-index: 1;
    }
    .stm-theme .stm-home-collection ul.products > li.product:last-child:nth-child(odd) .onsale {
        left: 10px;
        right: auto;
    }
}
@media (max-width: 359px) {
    .stm-home-collection { padding-inline: 8px; }
    .stm-collection-heading h2 { font-size: 21px; }
    .stm-theme .stm-home-collection ul.products > li.product { padding: 6px; }
    .stm-theme .stm-home-collection .stm-home-products ul.products li.product a img { height: 119px; }
    .stm-theme .stm-home-collection ul.products li.product .woocommerce-loop-product__title { font-size: 11px; }
    .stm-theme .stm-home-collection ul.products li.product .stm-product-bottom > .price { font-size: 13px; }
}
