/* Customer marketplace layouts. The approved homepage header and hero are untouched. */
.home-reference-page .home-marketplace-content .marketplace-categories .discovery-card,
.home-reference-page .home-marketplace-content .home-store-rail > .marketplace-store-card { overflow: hidden; }
.home-reference-page .home-marketplace-content .marketplace-categories .category-visual img { object-fit: cover; padding: 0; }
.home-reference-page .home-marketplace-content .student-callout { background: linear-gradient(110deg, #ddf4e8, #f3fbf6); }
.home-reference-page .home-marketplace-content .store-benefits > div { min-width: 0; }

.marketplace-mobile-header { display: none; }

.marketplace-directory { --listing-gap: 12px; }
.marketplace-directory .directory-hero { position: relative; min-height: 174px; overflow: hidden; padding: 20px 24px; border-radius: 22px; background: linear-gradient(110deg, #e0f4e9, #f2fbf5 72%); }
.marketplace-directory .directory-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 22% 70%, #bcebd1 0, transparent 32%); pointer-events: none; }
.marketplace-directory .directory-hero-art { position: absolute; inset-inline-end: 2%; inset-block-end: -8%; display: grid; place-items: center; width: min(32%, 220px); height: 110%; opacity: .85; color: #09805a; font-size: clamp(68px, 14vw, 160px); }
.marketplace-directory .directory-hero-art .category-visual { width: 100%; height: 100%; border-radius: 0; background: transparent !important; font-size: inherit; }
.marketplace-directory .directory-hero-art .category-visual img { width: 100%; height: 100%; object-fit: contain; }
.marketplace-directory .directory-hero-art .category-visual:has(img) i { display: none; }
.marketplace-directory .directory-hero > :not(.directory-hero-art) { position: relative; z-index: 1; }
.marketplace-directory .breadcrumb { margin-bottom: 10px; font-size: 12px; }
.marketplace-directory .directory-hero .catalog-heading { max-width: 72%; margin: 0; }
.marketplace-directory .directory-hero .catalog-heading h1 { color: #064934; font-size: clamp(27px, 5.5vw, 42px); line-height: 1.35; }
.marketplace-directory .directory-hero .catalog-heading p:not(.marketplace-kicker) { color: #607069; font-size: 14px; }
.marketplace-directory .directory-store-count { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: #064934; font-size: 13px; }
.marketplace-directory .catalog-filter { position: relative; z-index: 2; max-width: none; margin: -12px 0 12px; padding: 10px 14px; border: 1px solid #e9efeb; border-radius: 22px; background: #fff; box-shadow: 0 8px 20px rgb(13 68 45 / 5%); }
.marketplace-directory .catalog-search-field input,
.customer-storefront .catalog-search-field input { min-width: 0; border: 1px solid #e1e9e4; border-radius: 18px; background: #f8faf9; }
.marketplace-directory .catalog-search-field button,
.customer-storefront .catalog-search-field button { flex: 0 0 auto; border-radius: 14px; }
.marketplace-directory .directory-filters { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 3px; scrollbar-width: none; }
.marketplace-directory .directory-filters::-webkit-scrollbar { display: none; }
.marketplace-directory .directory-filter { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 18px; border: 1px solid #e2ebe5; border-radius: 16px; background: #f4f9f6; color: #174c3b; font-size: 13px; font-weight: 700; text-decoration: none; }
.marketplace-directory .directory-filter[aria-current="page"] { border-color: #07513a; background: #07513a; color: #fff; }
.marketplace-directory .directory-filter:focus-visible { outline: 3px solid #128660; outline-offset: 2px; }
.marketplace-directory .catalog-result-count { margin: 0 2px 10px; font-size: 12px; }
.marketplace-directory .marketplace-stores { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--listing-gap); }
.marketplace-directory .marketplace-store-card { display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: 8px; gap: 0; border: 1px solid #e6eee9; border-radius: 18px; background: #fff; box-shadow: 0 4px 15px rgb(15 53 35 / 6%); }
.marketplace-directory .marketplace-store-photo { flex: 0 0 auto; width: 100%; height: auto; min-height: 0; aspect-ratio: 1.9; border-radius: 12px; }
.marketplace-directory .marketplace-store-card > .marketplace-store-copy,
.marketplace-directory .marketplace-store-card:has(> .marketplace-store-avatar) > .marketplace-store-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; padding: 8px 2px 0; text-align: start; }
.marketplace-directory .marketplace-store-card > .marketplace-store-avatar { inset-inline-start: auto; inset-inline-end: 16px; inset-block-start: 16px; width: 46px; height: 46px; border-radius: 11px; }
.marketplace-directory .marketplace-store-name { min-height: 2.7em; margin: 0; font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.marketplace-directory .marketplace-store-name a { min-height: 0; }
.marketplace-directory .marketplace-store-meta { margin: 0; }
.marketplace-directory .marketplace-store-category { font-size: 12px; }
.marketplace-directory .marketplace-store-actions { margin: auto 0 8px; padding-top: 6px; }
.marketplace-directory .marketplace-store-state { padding: 4px 8px; font-size: 11px; white-space: nowrap; }
.marketplace-directory .home-store-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; width: 100%; border-radius: 10px; font-size: 13px; font-weight: 700; }
.marketplace-directory .home-store-action .bi { font-size: 16px; }
.marketplace-directory .marketplace-stores:has(> :first-child:last-child) { grid-template-columns: minmax(0, 1fr); max-width: 340px; }
.marketplace-directory .marketplace-stores:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 690px; }
.marketplace-directory .marketplace-stores:has(> :nth-child(-n+2):last-child) { margin-inline: auto; }

.customer-storefront { padding-bottom: 24px; }
.customer-storefront .breadcrumb { margin-bottom: 10px; font-size: 12px; }
.customer-storefront .marketplace-store-identity { position: relative; display: flex; align-items: center; min-height: 166px; overflow: hidden; gap: 16px; padding: 22px; margin-bottom: 14px; border: 1px solid #e1eee7; border-radius: 22px; background: linear-gradient(110deg, #e5f5eb, #f9fcfa); }
.customer-storefront .marketplace-store-identity::before { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, rgb(245 251 247 / 0%) 0%, #f4faf6 57%, #e8f6ed 100%); pointer-events: none; }
.customer-storefront .store-identity-cover { position: absolute; inset-block: 0; inset-inline-end: 0; width: 54%; overflow: hidden; }
.customer-storefront .store-identity-cover img { width: 100%; height: 100%; object-fit: cover; }
.customer-storefront .marketplace-store-identity > :not(.store-identity-cover) { position: relative; z-index: 2; }
.customer-storefront .marketplace-store-identity .marketplace-store-avatar { width: 82px; height: 82px; flex-basis: 82px; border-radius: 16px; background: #fff; box-shadow: 0 4px 15px rgb(9 65 40 / 10%); }
.customer-storefront .marketplace-identity-copy { flex: 1; }
.customer-storefront .marketplace-identity-name { margin: 0; color: #064934; font-size: clamp(20px, 3vw, 30px); line-height: 1.4; }
.customer-storefront .marketplace-identity-copy .marketplace-store-category { font-size: 14px; }
.customer-storefront .marketplace-store-identity .marketplace-store-state { align-self: flex-end; padding: 6px 11px; border-radius: 20px; background: #dff7e9 !important; color: #07653e; white-space: nowrap; }
.customer-storefront .marketplace-store-identity .marketplace-store-state.is-closed { background: #f5ead8 !important; color: #715b34; }
.customer-storefront .storefront-description { margin-bottom: 12px; font-size: 13px; line-height: 1.7; }
.customer-storefront .storefront-browse { padding: 0; }
.customer-storefront .storefront-browse .storefront-product-search { max-width: none; margin-bottom: 12px; }
.customer-storefront .catalog-search-field input { border-radius: 18px; }
.customer-storefront .storefront-categories { display: flex; gap: 8px; padding: 4px 0 12px; }
.customer-storefront .storefront-categories .category-chip { display: inline-flex; flex: 0 0 auto; flex-direction: row; align-items: center; gap: 6px; width: auto; max-width: 220px; min-height: 44px; padding: 6px 12px; border: 1px solid #e4ebe6; border-radius: 22px; background: #fff; box-shadow: 0 3px 9px rgb(15 53 35 / 4%); color: #203a2e; font-size: 13px; }
.customer-storefront .storefront-categories .category-chip[aria-current="page"] { border-color: #07513a; background: #07513a; color: #fff; box-shadow: none; }
.customer-storefront .storefront-categories .category-chip .category-visual { flex: 0 0 23px; width: 23px; height: 23px; border-radius: 7px; background: transparent !important; font-size: 18px; }
.customer-storefront .storefront-categories .category-chip .category-visual img { width: 100%; height: 100%; }
.customer-storefront .storefront-categories .category-chip[aria-current="page"] .category-visual i { color: #fff !important; }
.customer-storefront .storefront-categories .category-chip .category-chip-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer-storefront .storefront-categories .category-chip .category-chip-count { margin: 0; font-size: 10px; }
.customer-storefront #product-results > .catalog-heading { margin: 8px 0 12px !important; }
.customer-storefront #product-results > .catalog-heading h2 { font-size: 21px; }
.customer-storefront .catalog-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.customer-storefront .catalog-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid #e7eee9; border-radius: 18px; box-shadow: 0 4px 12px rgb(15 53 35 / 6%); }
.customer-storefront .catalog-image { flex: 0 0 auto; aspect-ratio: 1.45; border-radius: 0; background: #f6f8f5; }
.customer-storefront .catalog-image img { width: 100%; height: 100%; padding: 3px; object-fit: cover; mix-blend-mode: normal; }
.customer-storefront .catalog-favorite { position: absolute; z-index: 3; inset-block-start: 7px; inset-inline-end: 7px; border-radius: 50%; box-shadow: 0 2px 8px rgb(18 51 35 / 12%); }
.customer-storefront .catalog-card-body { display: grid; flex: 1; grid-template-columns: minmax(0, 1fr) auto; align-content: start; gap: 2px 5px; padding: 9px; }
.customer-storefront .catalog-card-body > a.small { display: none !important; }
.customer-storefront .catalog-product-name { grid-column: 1 / -1; grid-row: 1; min-height: 2.7em; margin: 0; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.customer-storefront .catalog-category { grid-column: 1 / -1; grid-row: 2; font-size: 11px; color: #68756c; }
.customer-storefront .catalog-unit { grid-column: 1 / -1; grid-row: 3; margin: 0 0 5px; font-size: 11px; color: #68756c; }
.customer-storefront .catalog-price { grid-column: 1; grid-row: 4; align-self: center; margin: 0; padding: 0; color: #064934; font-size: 17px; white-space: nowrap; }
.customer-storefront .catalog-price span { font-size: 11px; }
.customer-storefront .catalog-add { grid-column: 2; grid-row: 4; min-height: 44px; min-width: 82px; padding: 5px 7px; border-radius: 10px; font-size: 11px; white-space: nowrap; }
.customer-storefront .catalog-add .bi { font-size: 15px; }
.customer-storefront .catalog-grid:has(> :first-child:last-child) { grid-template-columns: minmax(0, 1fr); max-width: 250px; margin-inline: auto; }
.customer-storefront .catalog-grid:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; margin-inline: auto; }

.mobile-cart-summary[hidden] { display: none !important; }
.mobile-cart-summary { display: none; }
@media (max-width: 1199.98px) {
    .marketplace-directory .marketplace-stores { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .customer-storefront .catalog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
    .home-reference-page .home-page .home-store-rail:has(> :nth-child(3):last-child) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 960px; margin-inline: auto; overflow-x: visible; scroll-snap-type: none; }
}
@media (max-width: 991.98px) {
    .marketplace-directory .marketplace-stores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .customer-storefront .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .customer-marketplace-page > .top-bar,
    .customer-marketplace-page > .navbar { display: none !important; }
    .customer-marketplace-page .marketplace-mobile-header { position: sticky; z-index: 1030; inset-block-start: 0; display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: 94px; padding: 7px 10px 5px; border-bottom: 1px solid #edf2ee; background: #fff; }
    .marketplace-mobile-brand { display: inline-flex; align-items: center; gap: 3px; min-height: 44px; color: #064934; font-size: 17px; font-weight: 800; text-decoration: none; white-space: nowrap; }
    .marketplace-mobile-brand img { flex: 0 0 auto; }
    .marketplace-mobile-search { position: relative; min-width: 0; }
    .marketplace-mobile-search input { width: 100%; min-width: 0; height: 44px; padding: 5px 10px 5px 38px; border: 0; border-radius: 15px; outline-offset: 2px; background: #f2f5f3; color: #193b2d; font-size: 11px; }
    .marketplace-mobile-search button { position: absolute; inset-inline-end: 0; inset-block: 0; display: grid; place-items: center; width: 38px; border: 0; background: transparent; color: #53655c; font-size: 17px; }
    .marketplace-mobile-actions { display: flex; align-items: center; }
    .marketplace-mobile-actions a { position: relative; display: grid; place-items: center; width: 35px; height: 44px; color: #064934; font-size: 20px; text-decoration: none; }
    .marketplace-mobile-actions a span { position: absolute; inset-inline-start: 0; inset-block-start: 0; display: grid; place-items: center; min-width: 16px; height: 16px; padding-inline: 2px; border-radius: 9px; background: #ed4444; color: #fff; font-size: 9px; font-weight: 700; }
    .marketplace-mobile-location { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 10px; border-radius: 20px; background: #f2f8f4; color: #174c3b; font-size: 11px; text-decoration: none; }
    .marketplace-mobile-brand:focus-visible,
    .marketplace-mobile-actions a:focus-visible,
    .marketplace-mobile-location:focus-visible,
    .marketplace-mobile-search button:focus-visible { outline: 3px solid #128660; outline-offset: 2px; }
    .home-reference-page .home-marketplace-content .marketplace-categories:has(> :first-child:last-child) .discovery-card { flex-basis: min(62%, 230px); }
    .home-reference-page .home-marketplace-content .marketplace-categories:has(> :nth-child(2):last-child) .discovery-card { flex-basis: calc((100% - 8px) / 2); }
    .home-reference-page .home-marketplace-content .home-store-rail:has(> :first-child:last-child) > .marketplace-store-card { flex-basis: min(80%, 290px); }
    .home-reference-page .home-marketplace-content .home-store-rail:has(> :nth-child(2):last-child) > .marketplace-store-card { flex-basis: calc((100% - 10px) / 2); }
    .marketplace-directory .directory-hero { min-height: 156px; padding: 14px 18px; border-radius: 18px; }
    .marketplace-directory .directory-hero .catalog-heading { max-width: 78%; }
    .marketplace-directory .directory-hero .catalog-heading h1 { font-size: 27px; }
    .marketplace-directory .directory-hero .catalog-heading p:not(.marketplace-kicker) { font-size: 12px; }
    .marketplace-directory .directory-hero-art { width: 34%; }
    .marketplace-directory .catalog-filter { margin-top: -8px; padding: 8px; }
    .marketplace-directory .catalog-search-field input { min-height: 46px; }
    .marketplace-directory .marketplace-stores { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .marketplace-directory .marketplace-store-card { padding: 6px; border-radius: 15px; }
    .marketplace-directory .marketplace-store-photo { aspect-ratio: 1.75; border-radius: 10px; }
    .marketplace-directory .marketplace-store-card > .marketplace-store-avatar { width: 38px; height: 38px; inset-inline-end: 11px; inset-block-start: 11px; }
    .marketplace-directory .marketplace-store-name { font-size: 13px; }
    .marketplace-directory .marketplace-store-category { font-size: 11px; }
    .marketplace-directory .marketplace-store-state { font-size: 10px; }
    .marketplace-directory .home-store-action { font-size: 12px; }
    .marketplace-directory .marketplace-stores:has(> :first-child:last-child) { max-width: 240px; }
    .marketplace-directory .marketplace-stores:has(> :nth-child(2):last-child) { max-width: none; }
    .customer-storefront { padding-bottom: 84px; }
    .customer-storefront .marketplace-store-identity { display: flex; min-height: 148px; gap: 10px; padding: 16px; border-radius: 18px; }
    .customer-storefront .marketplace-store-identity .marketplace-store-avatar { width: 62px; height: 62px; flex-basis: 62px; border-radius: 12px; }
    .customer-storefront .marketplace-store-identity .marketplace-store-state { position: absolute; inset-inline-start: 16px; inset-block-end: 12px; font-size: 11px; }
    .customer-storefront .marketplace-identity-name { font-size: 19px; }
    .customer-storefront .marketplace-identity-copy .marketplace-store-category { font-size: 12px; }
    .customer-storefront .storefront-categories .category-chip { max-width: 165px; font-size: 12px; }
    .customer-storefront .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .customer-storefront .catalog-grid:has(> :first-child:last-child) { max-width: 220px; }
    .customer-storefront .catalog-grid:has(> :nth-child(2):last-child) { max-width: none; }
    .customer-storefront .catalog-product-name { font-size: 12px; }
    .customer-storefront .catalog-price { font-size: 15px; }
    .customer-storefront .catalog-add { min-width: 76px; font-size: 10px; }
    .customer-storefront .catalog-add .add-to-cart-text { white-space: nowrap; }
    .mobile-cart-summary { position: fixed; z-index: 1020; inset-inline: 10px; inset-block-end: max(8px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 8px 10px; border: 1px solid #dbeee3; border-radius: 18px; background: #e8f7ee; box-shadow: 0 7px 24px rgb(16 60 37 / 16%); color: #07513a; font-size: 13px; }
    .mobile-cart-summary > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
    .mobile-cart-summary > span .bi { font-size: 20px; }
    .mobile-cart-summary .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 128px; border-radius: 12px; font-size: 12px; }
}
@media (max-width: 374.98px) {
    .marketplace-directory .directory-filter { padding-inline: 12px; font-size: 12px; }
    .marketplace-directory .catalog-search-field button,
    .customer-storefront .catalog-search-field button { padding-inline: 10px; }
    .customer-storefront .catalog-card-body { padding: 7px; gap: 2px; }
    .customer-storefront .catalog-price { font-size: 13px; }
    .customer-storefront .catalog-add { min-width: 70px; padding-inline: 4px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
    .marketplace-directory .marketplace-store-card,
    .customer-storefront .catalog-card { transition: none; }
}
