/* Shared page geometry. Inner reading limits do not change the outer alignment. */
:root { --ff-page-width:1600px; --ff-reading-width:1080px; --ff-text-width:var(--ff-reading-width); }
.wrap { max-width:var(--ff-page-width); }
.editorial-page:not(.collection-directory) .editorial-layout > .editorial,
.ff-blog-article .ff-blog-body,
.ff-blog-article .ff-blog-hero,
.ff-blog-article .ff-blog-heading,
.ff-blog-article .ff-blog-next,
.ff-mailpoet-page > :not(.crumb),
.woocommerce-order-tracking { width:100%; max-width:var(--ff-reading-width); margin-inline:auto; }
.editorial-page:not(.collection-directory) .editorial-heading,
.editorial-page:not(.collection-directory) > .crumb,
.ff-blog-article > .crumb { max-width:var(--ff-reading-width); margin-inline:auto; }
.editorial-page:not(.collection-directory) .editorial p,
.editorial-page:not(.collection-directory) .editorial ul,
.editorial-page:not(.collection-directory) .editorial ol,
.editorial-page .editorial-heading > p,
.ff-blog-article .ff-blog-heading > p,
.ff-blog-body p,.ff-blog-body ul,.ff-blog-body ol,
.ff-blog-body h2,.ff-blog-body h3,
.ff-blog-hero figcaption,.catalogue-editorial { max-width:var(--ff-text-width); }
.ff-blog-body figure,.ff-blog-body .wp-block-table { max-width:100%; }

/* Spacious desktop shopping; tablet/mobile grids retain their breakpoints. */
@media (min-width:1100px) {
  .home .featured-section, .home .room-section,
  .home .collection-discovery, .home .guide-preview {
    padding-top:56px; padding-bottom:56px;
  }
  .home .section-heading { margin-bottom:32px; }
  .home .ff-rewards-banner { margin-top:32px; margin-bottom:32px; padding:36px; }
  .ff-product-rail { gap:32px; }
  .ff-product-rail > * { flex-basis:calc((100% - 96px)/4); }
  .product-grid.home-products, .catalogue .product-grid,
  .collection-body .product-grid, .similar-section .product-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:48px 32px; }
  .product-grid > .product-card,
  .collection-body .product-grid > .product-card {
    padding:0!important; border-left:0!important;
  }
  .product-card h3 { margin-top:16px; }
  .catalogue-results > .product-grid > .product-card:nth-child(n)::after { content:none; }
  .catalogue-results > .product-grid > .product-card:nth-child(4n+5)::after {
    content:""; left:0; top:-24px; width:calc(400% + 96px);
  }
  .site-footer .footer-grid { padding-top:40px; padding-bottom:40px; }
  .ff-brand-hero { padding-inline:max(var(--gutter),calc((100% - 1600px)/2)); }
  .ff-brand-copy h1 { font-size:clamp(44px,4.35vw,84px); }
  .ff-home-benefits { padding-inline:max(var(--gutter),calc((100% - 1600px)/2)); }
  .ff-home-benefits a { padding-inline:20px; }
  .ff-home-benefits a:first-child { padding-left:0; }
}

/* Keep browsing history compact: one row, with scrolling on smaller screens. */
.recently-viewed .product-grid.home-products {
  display:flex; flex-wrap:nowrap; gap:20px; overflow-x:auto;
  padding-bottom:12px; scroll-snap-type:x proximity;
  scrollbar-width:thin; scrollbar-color:#858b86 #eceeec;
}
.recently-viewed .product-grid::-webkit-scrollbar { height:8px; }
.recently-viewed .product-grid::-webkit-scrollbar-track { background:#eceeec; border-radius:4px; }
.recently-viewed .product-grid::-webkit-scrollbar-thumb { background:#858b86; border-radius:4px; }
.recently-viewed .product-grid > .product-card {
  flex:0 0 clamp(150px,calc((100% - 100px)/6),220px);
  min-width:0; padding:0!important; border-left:0!important;
  scroll-snap-align:start;
}
.recently-viewed .product-card::before,
.recently-viewed .product-card::after { content:none!important; }

/* Centre commerce headings and content within the shared outer container. */
.commerce-page > .woocommerce,.commerce-page > h1,.commerce-page > .crumb,.commerce-page > .commerce-help{width:100%;max-width:1000px;margin-left:auto;margin-right:auto;box-sizing:border-box}

/* Catalogue dividers: keep row starts and offsets in step with column count. */
.catalogue-results > .product-grid { --ff-grid-x:26px; --ff-grid-y:32px; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--ff-grid-y) var(--ff-grid-x); }
.catalogue-results > .product-grid > .product-card:nth-child(n)::before { display:block!important; left:calc(var(--ff-grid-x) / -2); }
.catalogue-results > .product-grid > .product-card:nth-child(3n+1)::before { display:none!important; }
.catalogue-results > .product-grid > .product-card:nth-child(n)::after { content:none; }
.catalogue-results > .product-grid > .product-card:nth-child(3n+4)::after { content:""; position:absolute; left:0; top:calc(var(--ff-grid-y) / -2); width:calc(300% + var(--ff-grid-x) * 2); height:1px; background:var(--line); pointer-events:none; }
@media(min-width:1100px){
 .catalogue-results > .product-grid { --ff-grid-x:32px; --ff-grid-y:48px; grid-template-columns:repeat(4,minmax(0,1fr)); }
 .catalogue-results > .product-grid > .product-card:nth-child(n)::before { display:block!important; }
 .catalogue-results > .product-grid > .product-card:nth-child(4n+1)::before { display:none!important; }
 .catalogue-results > .product-grid > .product-card:nth-child(n)::after { content:none; }
 .catalogue-results > .product-grid > .product-card:nth-child(4n+5)::after { content:""; position:absolute; left:0; top:-24px; width:calc(400% + 96px); height:1px; background:var(--line); pointer-events:none; }
}
@media(max-width:760px){
 .catalogue-results > .product-grid { --ff-grid-x:24px; --ff-grid-y:28px; grid-template-columns:repeat(2,minmax(0,1fr)); }
 .catalogue-results > .product-grid > .product-card:nth-child(n)::before { display:block!important; }
 .catalogue-results > .product-grid > .product-card:nth-child(2n+1)::before { display:none!important; }
 .catalogue-results > .product-grid > .product-card:nth-child(n)::after { content:none; }
 .catalogue-results > .product-grid > .product-card:nth-child(2n+3)::after { content:""; position:absolute; left:0; top:-14px; width:calc(200% + 24px); height:1px; background:var(--line); pointer-events:none; }
}
/* All four-column product rows share a 32px desktop gap. */
@media(min-width:1100px){
 .product-grid.home-products > .product-card:nth-child(n)::before,
 .similar-section .product-grid.home-products > .product-card:nth-child(n)::before { left:-16px; }
}
/* Mobile product grids use equal room on either side of each divider. */
@media(max-width:760px){
 .product-grid.home-products { column-gap:16px; }
 .product-grid.home-products > .product-card:nth-child(n)::before { left:-8px; }
}

/* Scrolling homepage cards need the same centred dividers as product grids. */
.ff-product-rail { --ff-rail-gap:24px; gap:var(--ff-rail-gap); }
.ff-product-rail > .product-card { position:relative; padding:0; border-left:0; display:flex; flex-direction:column; }
.ff-product-rail > .product-card + .product-card::before { content:""; position:absolute; left:calc(var(--ff-rail-gap) / -2); top:0; bottom:0; border-left:1px solid var(--line); pointer-events:none; }
.ff-product-rail > .product-card > .card-details { margin-top:auto; padding-top:10px; }
@media(min-width:1100px){ .ff-product-rail { --ff-rail-gap:32px; } }
