.shop-home {
    margin: 65px auto 0;
    color: var(--black);
}

.shop-home,
.shop-home button,
.shop-home input,
.shop-home select,
.shop-home textarea {
    font-family: var(--font-family-mono);
}

.shop-home__filters,
.shop-home__description,
.shop-home__toolbar,
.shop-home__empty {
    padding: 0 var(--page-gutter);
}

.shop-home a {
    text-decoration: none;
}

.shop-home__filters,
.shop-home__description,
.shop-home__toolbar,
.shop-home__grid,
.shop-home__empty {
    margin: 0;
}

.shop-home__filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}

.shop-home__filter-row {
    display: block;
}

.shop-home__filter-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    color: var(--gray);
}

.shop-home__filter-link,
.shop-home__filter-link:visited {
    color: inherit;
    font-size: 12px;
    font-weight: var(--type-body-weight-bold);
    line-height: 1.44;
    letter-spacing: var(--type-link-letter-spacing);
    text-transform: uppercase;
    text-decoration: none;
    text-underline-offset: var(--type-link-underline-offset);
    text-decoration-thickness: 0.08em;
    text-decoration-skip-ink: auto;
}

.shop-home__filter-link:hover,
.shop-home__filter-link.is-active,
.shop-home__filter-link.is-active:visited {
    color: var(--black);
    text-decoration: underline;
}

.shop-home__description {
    max-width: 360px;
    margin-bottom: 32px;
    font-size: var(--font-size);
    font-weight: var(--type-body-weight-medium);
    line-height: 1.44;
    letter-spacing: 0;
}

.shop-home__description p {
    margin: 0;
    font: inherit;
    letter-spacing: inherit;
}

.shop-home__toolbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
    padding-bottom: 0;
    border-bottom: 0;
}

.shop-home__selection {
    color: var(--black);
    font-family: var(--font-family-mono);
    font-size: 12px;
    font-weight: var(--type-body-weight-bold);
    line-height: 1.44;
    letter-spacing: var(--type-link-letter-spacing);
    text-decoration: underline;
    text-decoration-style: solid;
    text-decoration-color: currentColor;
    text-decoration-thickness: 0.08em;
    text-underline-offset: var(--type-link-underline-offset);
    text-decoration-skip-ink: auto;
    text-transform: uppercase;
}

.shop-home__sort {
    position: relative;
}

.shop-home__sort-toggle,
.shop-home__sort-toggle:visited,
.shop-home__sort-toggle:hover,
.shop-home__sort-toggle:focus {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--black);
    font-size: 12px;
    font-weight: var(--type-body-weight-bold);
    line-height: 1.44;
    letter-spacing: var(--type-link-letter-spacing);
    text-transform: uppercase;
    text-decoration: underline;
    text-decoration-style: solid;
    text-decoration-color: currentColor;
    text-decoration-thickness: 0.08em;
    text-underline-offset: var(--type-link-underline-offset);
    text-decoration-skip-ink: auto;
    overflow: visible;
}

.shop-home__sort-toggle::after,
.shop-home__sort-toggle:hover::after,
.shop-home__plus::after,
.shop-home__plus:hover::after {
    content: none;
}

.shop-home__sort-menu {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    z-index: 5;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    border: 1px solid var(--gray4);
    background: var(--white);
}

.shop-home__sort-menu[hidden] {
    display: none;
}

.shop-home__sort-link,
.shop-home__sort-link:visited {
    padding: 8px 14px;
    color: var(--black);
    font-size: var(--type-body-size-s);
    font-weight: var(--type-body-weight-bold);
    line-height: 1.44;
    letter-spacing: var(--type-link-letter-spacing);
    text-transform: uppercase;
    text-decoration: none;
}

.shop-home__sort-link:hover,
.shop-home__sort-link.is-active,
.shop-home__sort-link.is-active:visited {
    color: var(--black);
    background: var(--gray6);
    text-decoration: underline;
    text-decoration-style: solid;
    text-decoration-color: currentColor;
    text-decoration-thickness: 0.08em;
    text-underline-offset: var(--type-link-underline-offset);
    text-decoration-skip-ink: auto;
}

.shop-home__sort-link .sort-desc {
    display: inline-block;
    height: 8px;
    width: 8px;
    border: 1px solid currentColor;
    border-width: 1px 1px 0 0;
    transform: rotate(135deg);
    margin: 0 0 3px 3px;
}

.shop-home__sort-link .sort-asc {
    display: inline-block;
    height: 8px;
    width: 8px;
    border: 1px solid currentColor;
    border-width: 1px 1px 0 0;
    transform: rotate(-45deg);
    margin: 0 0 -1px 3px;
}

.shop-home__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 0;
    padding: 0;
    list-style: none;
}

.shop-home__card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 455px;
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--black);
    border-bottom: 1px solid var(--black);
    background: var(--white);
    box-shadow: none;
    border-radius: 0;
}

/* Cards own the outer edges so borders stop when the products stop. */
.shop-home__card:nth-child(-n + 4) {
    border-top: 1px solid var(--black);
}

.shop-home__card:nth-child(4n),
.shop-home__card:last-child {
    border-right: 1px solid var(--black);
}

.shop-home__plus,
.shop-home__plus:hover,
.shop-home__plus:focus {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--black);
    overflow: visible;
}

.shop-home__plus svg {
    display: block;
    width: 13px;
    height: 13px;
}

.shop-home__card-link,
.shop-home__card-link:visited {
    display: block;
    height: 100%;
    padding-bottom: 32px;
    color: var(--black);
}

.shop-home__card-link:hover {
    color: var(--black);
}

.shop-home__image {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: 360px;
    margin-top: 25px;
    margin-bottom: 5px;
    padding: 0;
}

.shop-home__image img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    margin-top: auto;
    object-fit: contain;
    border-radius: 0;
}

.shop-home__card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    text-align: center;
}

.shop-home__name {
    display: block;
    min-height: 0;
    font-size: var(--type-body-size-s);
    font-weight: var(--type-body-weight-medium);
    line-height: 1.44;
    letter-spacing: var(--type-link-letter-spacing);
    text-transform: uppercase;
}

.shop-home__price {
    display: block;
    font-size: var(--type-body-size-s);
    font-weight: var(--type-body-weight-medium);
    line-height: 1.44;
    letter-spacing: var(--type-link-letter-spacing);
    text-align: center;
}

.shop-home__empty {
    padding: 24px 0 0;
    font-size: var(--type-body-size-s);
    font-weight: var(--type-body-weight-medium);
    line-height: var(--type-body-line-height);
}

/* Search results reuse the storefront product grid and cards. */
.shop-search__header {
    margin: 0 0 16px;
    padding: 0 var(--page-gutter);
}

.shop-search__title {
    margin: 0;
    color: var(--black);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: var(--type-body-weight-bold);
    line-height: 1.1;
    letter-spacing: var(--type-link-letter-spacing);
    text-transform: uppercase;
}

.shop-search__empty {
    padding-right: var(--page-gutter);
    padding-left: var(--page-gutter);
}

.shop-category__pagination,
.shop-category .lazyloading-load-more {
    margin-top: 32px;
    padding: 0 var(--page-gutter);
}

.shop-category__pagination .menu-h {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.shop-category__pagination .menu-h li {
    margin: 0;
}

/* Product-density adjustment. */
@media (max-width: 1199px) {
    .shop-home__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .shop-home__card:nth-child(n) {
        border-top: 0;
        border-right: 0;
    }

    .shop-home__card:nth-child(-n + 3) {
        border-top: 1px solid var(--black);
    }

    .shop-home__card:nth-child(3n),
    .shop-home__card:last-child {
        border-right: 1px solid var(--black);
    }
}

/* Product-density adjustment for wide displays. */
@media (min-width: 1500px) {
    .shop-home__grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .shop-home__card:nth-child(n) {
        border-top: 0;
        border-right: 0;
    }

    .shop-home__card:nth-child(-n + 5) {
        border-top: 1px solid var(--black);
    }

    .shop-home__card:nth-child(5n),
    .shop-home__card:last-child {
        border-right: 1px solid var(--black);
    }
}

/* Product-density adjustment for extra-wide displays. */
@media (min-width: 1800px) {
    .shop-home__grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .shop-home__card:nth-child(n) {
        border-top: 0;
        border-right: 0;
    }

    .shop-home__card:nth-child(-n + 6) {
        border-top: 1px solid var(--black);
    }

    .shop-home__card:nth-child(6n),
    .shop-home__card:last-child {
        border-right: 1px solid var(--black);
    }
}

/* Product-density adjustment for extra-wide displays. */
@media (min-width: 2100px) {
    .shop-home {
        max-width: 2100px;
    }

    .shop-home__filters,
    .shop-home__description,
    .shop-home__toolbar {
        padding-right: max(0px, calc(var(--page-gutter) + 1050px - 50vw));
        padding-left: max(0px, calc(var(--page-gutter) + 1050px - 50vw));
    }

    .shop-home__grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .shop-home__card:nth-child(n) {
        border-top: 0;
        border-right: 0;
    }

    .shop-home__card:nth-child(-n + 7) {
        border-top: 1px solid var(--black);
    }

    .shop-home__card:nth-child(7n),
    .shop-home__card:last-child {
        border-right: 1px solid var(--black);
    }
}

/* Product-grid fit, independent of navigation/device tiers. */
@media (max-width: 900px) {
    .shop-home__filter-row {
        display: block;
    }

    .shop-home__toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .shop-home__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-home__card:nth-child(n) {
        border-top: 0;
        border-right: 0;
    }

    .shop-home__card:nth-child(-n + 2) {
        border-top: 1px solid var(--black);
    }

    .shop-home__card:nth-child(2n),
    .shop-home__card:last-child {
        border-right: 1px solid var(--black);
    }
}

@media (max-width: 767px) {
    .shop-home {
        margin-top: 48px;
    }

    .shop-home__filters {
        margin-bottom: 24px;
    }

    .shop-home__filter-links {
        gap: 10px 16px;
    }

    .shop-home__description {
        max-width: none;
        margin-bottom: 32px;
    }

    .shop-home__toolbar {
        gap: 16px;
    }

    .shop-home__sort-menu {
        left: 0;
        right: auto;
    }

    .shop-home__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-home__card {
        min-height: 0;
        aspect-ratio: 75 / 128;
    }

    .shop-home__card-link,
    .shop-home__card-link:visited {
        display: flex;
        flex-direction: column;
    }

    .shop-home__image {
        flex: 0 0 62.5%;
        height: auto;
        margin-top: 25px;
        margin-bottom: 4px;
    }

    .shop-home__image img {
        height: 100%;
        width: 100%;
    }

    .shop-home__card-content {
        gap: 4px;
        padding: 0 8px;
    }

    .shop-home__name,
    .shop-home__price {
        font-size: 12px;
        font-weight: var(--type-body-weight-medium);
        line-height: 1.44;
        letter-spacing: var(--type-link-letter-spacing);
        text-align: center;
    }
}
