/* Home A presentation for the shared homepage and catalog. */
body:is([data-view="home"], [data-view="catalog"]) .header {
    min-height: 54px;
    gap: 10px;
    padding-block: 5px;
}

body:is([data-view="home"], [data-view="catalog"]) .main {
    padding-top: 10px;
}

body:is([data-view="home"], [data-view="catalog"]) .header .store-brand {
    flex: 0 1 auto;
    min-width: 0;
}

body:is([data-view="home"], [data-view="catalog"]) .header .browse-search {
    display: flex;
    flex: 1 1 260px;
    align-items: center;
    gap: 7px;
    min-width: 0;
    margin: 0;
    padding: 2px 7px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: none;
}

.header .browse-search input {
    flex: 1;
    min-width: 0;
    min-height: 40px;
}

.header .browse-search button {
    min-width: 44px;
    min-height: 40px;
    padding: 3px 10px;
    border: 0;
    border-radius: 8px;
    background: var(--soft);
    color: var(--soft-ink);
    box-shadow: none;
}

body[data-view="home"] .hero {
    border-radius: 14px;
}

body[data-view="home"] .hero.has-image {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

body[data-view="home"] .hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
    padding: clamp(14px, 2.6vw, 30px);
}

body[data-view="home"] .hero-kicker {
    margin-block: 0 5px;
}

body[data-view="home"] .hero h1 {
    max-width: 22ch;
    margin-block: 0 8px;
    font-size: clamp(23px, 2.9vw, 42px);
    line-height: 1.32;
    overflow-wrap: anywhere;
}

body[data-view="home"] .hero p {
    margin-block: 0 14px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

body[data-view="home"] .hero-photo {
    position: relative;
    min-height: clamp(174px, 21vw, 270px);
    max-height: none;
}

body[data-view="home"] .hero-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body[data-view="home"] .section {
    margin-top: clamp(15px, 2vw, 28px);
}

body[data-view="home"] :is(.home-products-section, .home-categories-section) .section-heading {
    gap: 8px;
    margin-bottom: 8px;
}

body[data-view="home"] .section-heading h2 {
    font-size: clamp(17px, 2vw, 24px);
    line-height: 1.4;
}

body[data-view="home"] .category-grid > a {
    grid-template: minmax(0, 1fr) / 44px minmax(0, 1fr) 14px;
    align-items: center;
    column-gap: 8px;
    flex-basis: clamp(156px, 20vw, 240px);
    height: 58px;
    padding: 6px 8px;
    border-radius: 10px;
}

body[data-view="home"] .category-grid .home-category-photo {
    grid-area: 1 / 1;
    width: 44px;
    height: 44px;
    border-radius: 7px;
}

body[data-view="home"] .category-grid > a strong {
    grid-area: 1 / 2;
    align-self: center;
    font-size: 12px;
}

body[data-view="home"] .category-grid > a > span:last-child {
    grid-area: 1 / 3;
    align-self: center;
    display: grid;
    place-items: center;
}

body[data-view="home"] .category-grid > a > span:last-child .icon {
    position: static;
    width: 14px;
    height: 14px;
    color: var(--muted);
}

body:is([data-view="home"], [data-view="catalog"]) .product-card {
    border-radius: 11px;
    background: var(--surface);
    box-shadow: none;
}

body[data-view="home"] .product-photo {
    margin: 4px 4px 0;
    border-radius: 8px;
}

body[data-view="catalog"] .product-photo {
    aspect-ratio: 1;
    border-radius: 8px;
    background: #fff;
}

body:is([data-view="home"], [data-view="catalog"]) .product-photo img {
    object-fit: cover;
    background: #fff;
}

body:is([data-view="home"], [data-view="catalog"]) .product-info h3 {
    min-height: 0;
    line-height: 1.45;
}

body:is([data-view="home"], [data-view="catalog"]) .card-bottom {
    min-height: 0;
    margin-block: 5px;
}

body[data-view="home"] .home-card-action {
    margin-block-start: auto;
    padding-block-start: 3px;
}

body[data-view="home"] .home-product-button,
.catalog-results .catalog-quick-add {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
    color: var(--soft-ink);
    box-shadow: none;
}

body[data-view="home"] .home-product-button:not(:disabled):is(:hover, :focus-visible),
.catalog-results .catalog-quick-add:not(:disabled):is(:hover, :focus-visible) {
    background: var(--surface);
    color: var(--ink);
}

body[data-view="home"] .home-product-button[data-added],
.catalog-results .catalog-quick-add[data-added] {
    background: var(--brand);
    color: var(--brand-ink);
}

.catalog-heading {
    margin-bottom: 8px;
}

.catalog-heading h1 {
    margin: 0;
    font-size: clamp(23px, 3vw, 34px);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

body[data-view="catalog"] .catalog-layout {
    display: block;
}

.catalog-results-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    margin-bottom: 6px;
}

.catalog-results-heading .catalog-results-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.catalog-results-heading p {
    margin: 0;
    color: var(--ink);
    font-size: 12px;
}

.catalog-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.catalog-filter-shell {
    position: relative;
    inset-block-start: auto;
    margin: 0;
}

body[data-view="catalog"] .filter-toggle {
    display: flex;
    width: auto;
    min-height: 44px;
    padding-inline: 9px;
}

.has-market-js .catalog-filter-shell:not(.is-open) .catalog-filter-fields {
    display: none;
}

.has-market-js .catalog-filter-shell .catalog-filter-fields {
    position: absolute;
    z-index: 5;
    inset-block-start: calc(100% + 6px);
    inset-inline-end: 0;
    width: min(290px, calc(100vw - 32px));
    margin: 0;
    background: var(--surface);
    box-shadow: 0 6px 20px #15191c24;
}

.catalog-results-heading .catalog-sort {
    width: auto;
    gap: 6px;
    font-size: 12px;
}

.catalog-category-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-block: 2px 12px;
}

.catalog-category-shortcuts a {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-size: 12px;
}

.catalog-category-shortcuts a[aria-current] {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--brand-ink);
}

@media (min-width: 960px) {
    body:is([data-view="home"], [data-view="catalog"]) .header {
        min-height: 60px;
    }

    body:is([data-view="home"], [data-view="catalog"]) .header .browse-search {
        max-width: 360px;
        margin-inline-start: auto;
    }

    body[data-view="catalog"] .product-grid,
    body[data-view="home"] .home-products-section .product-grid,
    body[data-view="home"] .home-products-section:has(.product-card:nth-child(6)) .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 959px) {
    body:is([data-view="home"], [data-view="catalog"]) .header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 4px 8px;
    }

    body:is([data-view="home"], [data-view="catalog"]) .header .store-brand {
        max-width: 100%;
    }

    body:is([data-view="home"], [data-view="catalog"]) .header .browse-search {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (max-width: 639px) {
    body[data-view="home"] .hero.has-image {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    }

    body[data-view="home"] .hero-copy {
        padding: 10px;
    }

    body[data-view="home"] .hero h1 {
        font-size: clamp(17px, 5vw, 25px);
        margin-bottom: 5px;
    }

    body[data-view="home"] .hero p {
        font-size: 11px;
        margin-bottom: 8px;
    }

    body[data-view="home"] .hero .button {
        min-height: 42px;
        padding: 5px 8px;
        gap: 4px;
    }

    body[data-view="home"] .home-products-section:not(.browse-first-collection) .product-grid,
    body[data-view="home"] .home-products-section:not(.browse-first-collection):has(.product-card:nth-child(6)) .product-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        overflow: visible;
        padding: 1px;
    }

    body[data-view="home"] .home-products-section:not(.browse-first-collection) .product-card:nth-child(n+5) {
        display: none;
    }

    body[data-view="home"] .home-products-section:not(.browse-first-collection) .product-info {
        grid-template-columns: minmax(0, 1fr) 44px;
    }

    body[data-view="home"] .browse-first-collection .product-grid,
    body[data-view="home"] .browse-first-collection:has(.product-card:nth-child(6)) .product-grid {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        padding: 2px 1px 5px;
    }

    body[data-view="home"] .browse-first-collection .product-card {
        display: flex;
        flex: 0 0 calc((100% - 8px) / 2.12);
        scroll-snap-align: start;
    }

    body[data-view="home"] .browse-first-collection .product-info {
        display: flex;
        flex-direction: column;
        padding: 7px 7px 8px;
    }

    body[data-view="home"] .browse-first-collection .home-card-action {
        margin: auto 0 0;
    }

    body[data-view="home"] .browse-first-collection .home-product-button {
        width: 100%;
    }

    body[data-view="home"] .browse-first-collection .home-product-button span {
        display: inline;
    }

    body[data-view="catalog"] .product-grid {
        gap: 9px;
    }

    .catalog-category-shortcuts {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .catalog-category-shortcuts a {
        flex: none;
    }

    .catalog-results-heading .catalog-sort {
        font-size: 11px;
    }

    .catalog-results-heading .catalog-sort > span {
        display: none;
    }

    .catalog-results-heading .catalog-sort select {
        max-width: 108px;
        margin-inline-start: 0;
    }
}

@media (max-width: 639px) {
    .catalog-results-heading {
        position: relative;
    }

    .catalog-filter-shell {
        position: static;
    }

    .has-market-js .catalog-filter-shell .catalog-filter-fields {
        inset-inline: 0;
        width: auto;
    }
}
