/* Product collection spacing. Keep product detail and checkout layouts independent. */
body .product-grid, body .ns-directory-product-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(min(100%, 215px),1fr));
  gap:clamp(16px,1.7vw,24px) clamp(12px,1.1vw,18px);
  align-items:stretch;
}
@media (max-width: 700px) {
body .product-grid, body .ns-directory-product-grid {
  grid-template-columns:repeat(auto-fill,minmax(min(100%, 152px),1fr));
  gap:18px 12px;
}
}
body .product-grid .product-card .product-photo {
  min-height:0;
  width:100%;
  height:auto;
  aspect-ratio:4 / 3;
  border-radius:clamp(9px,1vw,15px);
}
body .product-grid .product-card h3 {
  margin-block:0;
  font-size:clamp(1rem,1.15vw,1.15rem);
  line-height:1.24;
  overflow-wrap:break-word;
}
.product-grid .product-card {
  min-width:0;
  gap:6px;
}
.product-grid .product-card .commerce-badge, .product-grid .product-card .commerce-help {
  margin-block:3px;
  font-size:.8125rem;
  line-height:1.35;
}
.product-grid .product-card .price {
  margin-block:3px;
  line-height:1.2;
}
.product-grid .product-card .product-discover {
  min-height:44px;
  max-width:100%;
  white-space:normal;
  line-height:1.2;
  box-sizing:border-box;
}
body .ns-directory-product-grid .ns-directory-product {
  min-width:0;
  gap:5px;
}

/* Product collection spacing. Keep product detail and checkout layouts independent. */
.lm-catalog .lm-cards {
  gap:clamp(12px,1.4vw,20px);
}
.lm-catalog .lm-card {
  min-width:0;
  gap:6px;
}
.lm-catalog .lm-card h3 {
  margin-block:0;
  font-size:clamp(1rem,1.15vw,1.15rem);
  line-height:1.24;
  overflow-wrap:break-word;
}
.lm-catalog .lm-card-top {
  margin-block:3px;
  font-size:.8125rem;
  line-height:1.35;
}
.lm-catalog .lm-card-foot {
  gap:6px 8px;
  flex-wrap:wrap;
  align-items:center;
}
@media (min-width:950px){.lm-catalog .lm-cards.lm-four{grid-template-columns:repeat(4,minmax(0,1fr))}}

@media (max-width: 700px) {
  .standard-product-page .standard-product {
    grid-template-columns: minmax(0, 1fr) clamp(84px, 28vw, 150px);
    gap: 10px 14px;
    align-items: center;
  }
  .standard-product-copy { display: contents; }
  .standard-product-photo { grid-area: 1 / 2 / 3 / 3; aspect-ratio: 1; }
  .standard-product-copy > * { grid-column: 1 / -1; min-width: 0; }
  .standard-product-copy > .commerce-badge { grid-area: 1 / 1; justify-self: start; }
  .standard-product-copy > h1 { grid-area: 2 / 1; margin: 0; overflow-wrap: anywhere; }
  .standard-product-copy > .standard-quantity { grid-row: 3; }
  .standard-product-copy > .config-purchase-bar { grid-row: 4; }
  html[data-ns-ui]:root .standard-product .config-purchase-bar { margin: 0; padding: 12px; }
  .standard-product-copy > :is(.error,.config-added):empty { display: none; }
  .standard-product-copy > p, .standard-product-copy > ul { margin-block: 0; }
  .standard-quantity input, .purchase-fields input, .purchase-fields select,
  .purchase-fields textarea, .ns-advisor-question input, .ns-advisor-question textarea { font-size: 16px; }
  .product-page .line-extras, .collection-config .line-extras { margin-block: 6px 10px; }
  .line-extras summary { min-height: 44px; align-content: center; cursor: pointer; }
  .line-extras input[type=file] { width: 100%; max-width: 100%; min-height: 44px; }
  .line-extras input::file-selector-button { min-height: 44px; }
  .standard-quantity input { min-height: 44px; }
}

/* Keep the catalogue surface visible up to the shared footer on every listing. */
body[data-ns-site="global"] #content:has(> .ns-unified-catalogue) {
  background: transparent;
}
body[data-ns-site="global"] #content:has(> .ns-unified-catalogue:last-child, > :last-child .product-grid) {
  padding-block-end: clamp(24px, 3vw, 48px);
}
body[data-ns-site="global"] #content > .ns-unified-catalogue:last-child {
  padding-bottom: 0;
}
body[data-ns-site="global"] #content > .product-page > .ns-product-shelves:last-child {
  margin-bottom: 0;
}
body[data-ns-site="global"] #content > .product-page > .ns-product-shelves:last-child::after {
  content: none;
}

.mobile-shop-home { display:none }
@media(max-width:760px){
  html[data-ns-ui]:root .header-actions .payment-entry {display:none}
  .global-header .header-actions {gap:2px}
  .global-header #menu-toggle {order:-1;width:auto;min-height:44px;border-radius:24px;padding:0 13px;background:#1429a4;color:white;font:700 14px/1 Manrope,sans-serif}
  .global-header #search-toggle,.global-header .selection-link {min-width:44px;min-height:44px}
  .mobile-shop-home {display:block;padding:20px clamp(12px,4vw,24px) 28px}
  .mobile-shop-home h2 {margin:0 0 16px;font-size:clamp(25px,6vw,34px);line-height:1.12;letter-spacing:-.045em}
  .mobile-shop-home nav,.mobile-category-links {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .mobile-shop-home nav a {display:flex;align-items:center;gap:8px;min-width:0;min-height:60px;padding:4px 6px 4px 4px;background:#fffdfa;border:1px solid #ded8cf;border-radius:10px;color:#292722;line-height:1.2;text-decoration:none}
  .mobile-shop-home nav img {flex:none;width:clamp(40px,13vw,62px);height:52px;border-radius:6px;object-fit:cover}
  .mobile-shop-home nav span {font-size:14px;font-weight:650;overflow-wrap:anywhere}
  .mobile-shop-home nav .mobile-full-catalog {justify-content:center;text-align:center;padding:8px;background:#1429a4;color:white;font-weight:700}
  html[data-ns-ui]:root #collection-menu {padding:0;overflow-y:auto;overscroll-behavior:contain}
  .mobile-directory {padding:12px 14px max(16px,env(safe-area-inset-bottom))}
  .mobile-directory-heading {display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
  .mobile-directory-heading h2 {margin:0;font-size:23px}
  .mobile-directory-heading button {width:44px;height:44px;border-radius:50%;background:#f2ede5;color:#292722;font-size:24px}
  .mobile-category-links a {display:flex;align-items:center;padding:10px;min-height:48px;background:#f3efe7;color:#292722;border-radius:9px;font-size:14px;font-weight:650;line-height:1.25}
  .mobile-all-products {display:flex;align-items:center;justify-content:center;margin-top:12px;min-height:44px;background:#1429a4;border-radius:24px;color:white;font-size:15px;font-weight:700}
  .mobile-directory-services {margin-top:12px;border-top:1px solid #ddd6cc;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 10px}
  .mobile-directory-services a {display:flex;align-items:center;min-height:44px;color:#463f35;text-decoration:underline;font-size:14px}
}


/* Double width in category results. Keep the image aligned with its neighbours. */
html[data-ns-ui]:root #catalog-grid .product-card[data-catalogue-featured] {
  grid-column: span 2;
}
html[data-ns-ui]:root #catalog-grid .product-card[data-catalogue-featured] .product-photo {
  aspect-ratio: 2.2;
}
html[data-ns-ui]:root #catalog-grid .product-card[data-catalogue-featured] h3 {
  font-size: clamp(18px, 1.6vw, 25px);
}


html[data-ns-ui]:root .ns-unified-catalogue .ns-catalog-filter-bar {
 display:grid;
 grid-template-columns:minmax(0,1.3fr) repeat(2,minmax(0,1fr)) 8.75rem;
 align-items:center;gap:10px;max-width:calc(870px + 8.75rem);margin:14px 0 0;
}
html[data-ns-ui]:root .ns-catalog-filter-bar .ns-catalog-cart {
 justify-self:start;white-space:nowrap;
}
html[data-ns-ui]:root .ns-unified-catalogue .ns-catalog-filter-bar :is(input,select) {
 grid-column:auto;min-width:0;width:100%;max-width:100%;height:46px;
}
.ns-catalog-purchase-filter {margin:8px 0 0;width:fit-content;max-width:100%}
.ns-catalog-purchase-filter summary {display:list-item;width:fit-content;min-height:44px;padding:12px 2px;cursor:pointer;font:650 14px/1.4 Manrope,Arial,sans-serif;color:#4b463f}
.ns-catalog-purchase-filter select {width:100%;min-width:190px;min-height:44px;padding:8px 12px;border:1px solid #cdc8bf;border-radius:8px;background:white;color:#292722;font:inherit}
@media(max-width:760px) {
 html[data-ns-ui]:root .ns-unified-catalogue .ns-catalog-filter-bar {
  grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;
 }
 html[data-ns-ui]:root .ns-unified-catalogue .ns-catalog-filter-bar #catalog-search {grid-column:1;grid-row:1}
 html[data-ns-ui]:root .ns-unified-catalogue .ns-catalog-filter-bar .ns-catalog-cart {grid-row:1;grid-column:2;justify-self:end}
 html[data-ns-ui]:root .ns-unified-catalogue .ns-catalog-filter-bar #catalog-category {grid-row:2;grid-column:1}
 html[data-ns-ui]:root .ns-unified-catalogue .ns-catalog-filter-bar #catalog-sort {grid-row:2;grid-column:2}
}

/* Keep the compact shop header, category list and search in document order. */
@media (max-width: 1100px) {
  html[data-ns-ui]:root { scroll-padding-top: 0; }
  html[data-ns-ui]:root body[data-ns-site="global"] .global-header {
    position: relative;
    top: auto;
  }
  html[data-ns-ui]:root body[data-ns-site="global"] #collection-menu,
  html[data-ns-ui]:root body[data-ns-site="global"] #global-search {
    position: relative;
    inset: auto;
    transform: none;
    max-height: none;
    margin: 0 auto 12px;
  }
  html[data-ns-ui]:root body[data-ns-site="global"] #content [id] {
    scroll-margin-top: 12px;
  }
}

/* Keep the buyer's choices visible until they reach the purchase summary. */
@media (max-width: 1100px), (max-height: 430px) {
  body[data-ns-site="global"] #content .config-host > .config-purchase-bar,
  body[data-ns-site="global"] #content .lm-work > .lm-purchase,
  body[data-ns-site="global"] #content .cart-summary,
  body[data-ns-site="global"] #content .purchase-payment {
    position: static;
    inset: auto;
  }
}
