/* Public storefront geometry. Hero, banners and footer share the content frame.
   Keep this separate from site-spacing.css (vertical rhythm) and card styling. */
:root {
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Segoe UI', Arial, sans-serif;
  --store-content-max: 1440px;
  --store-gutter: 96px;
  --store-content-width: min(calc(100% - var(--store-gutter) * 2), var(--store-content-max));
  --store-edge: max(var(--store-gutter), calc((100% - var(--store-content-max)) / 2));
  --store-section-heading: 43.2px;
  --store-page-heading: 48px;
}
@media (max-width: 760px) {
  :root { --store-gutter: 12px; --store-section-heading: 29px; --store-page-heading: 34px; }
}
html:has(body:not(.admin-page)) { scrollbar-gutter: stable; }

body:not(.admin-page) > main { width: 100%; max-width: none; }
/* A shell is itself the frame: its children must not acquire another gutter. */
body > main:is(.commerce-shell, .checkout-shell, .customer-shell, .track-shell,
  .wholesale-shell, .confirmation-shell, .category-directory, .search-shell, .not-found-main),
body > .site-back-bar,
body > .site-footer,
#main > .hero,
#main > :is(.campaign-showcase, .category-shortcuts, .wholesale-cta),
#main .commerce-home-section,
#main > .inspired-commerce-sections > .section-banner,
.product-page #product-main > :is(.breadcrumbs, .product-hero-layout, #mv-bundle, .pdp-content),
.product-page #product-main > .inspired-commerce-sections > .commerce-home-section,
.catalog-page main > :is(.catalog-hero, .catalog-layout, .sale-collection-tabs),
.wishlist-page main > :is(.wishlist-hero, .wishlist-results),
.about-page main > :is(.about-hero, .about-intro, .about-pillars, .about-stats, .about-promise, .about-showroom),
.info-page main > :is(.info-hero, .faq-layout, .contact-grid, .contact-connect, .contact-form-section, .contact-note, .blog-feature, .blog-list),
.career-page main > :is(.career-hero, .career-values, .career-openings, .career-note),
.store-page main > :is(.store-hero, .store-location, .store-details, .store-visit),
.policy-page main > :is(.policy-hero, .policy-highlights, .policy-layout),
.article-page main > :is(.article-breadcrumb, .article-hero, .article-cover, .article-layout, .article-more) {
  box-sizing: border-box;
  width: var(--store-content-width) !important;
  max-width: var(--store-content-max) !important;
  margin-inline: auto !important;
}
/* Unboxed sections align to the frame, rather than nesting their old page padding. */
body > main:is(.commerce-shell, .checkout-shell, .customer-shell, .track-shell,
  .wholesale-shell, .confirmation-shell, .category-directory, .search-shell),
#main > :is(.campaign-showcase, .category-shortcuts), #main .commerce-home-section,
.product-page #product-main > :is(.breadcrumbs, .product-hero-layout, #mv-bundle, .pdp-content),
.product-page #product-main > .inspired-commerce-sections > .commerce-home-section,
.catalog-page main > :is(.catalog-hero, .catalog-layout, .sale-collection-tabs),
.wishlist-page main > :is(.wishlist-hero, .wishlist-results),
.about-page main > :is(.about-hero, .about-intro, .about-pillars, .about-promise),
.info-page main > :is(.info-hero, .faq-layout, .contact-grid, .blog-list),
.career-page main > :is(.career-hero, .career-values, .career-openings),
.store-page main > .store-hero,
.policy-page main > :is(.policy-hero, .policy-highlights, .policy-layout),
.article-page main > :is(.article-breadcrumb, .article-hero, .article-layout, .article-more) {
  padding-inline: 0 !important;
}
/* Only shared headers retain their existing full-bleed background. */
body > :is(.site-header, .policy-header, .category-page-header, .not-found-header) {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  padding-inline: var(--store-edge) !important;
}
.header-category-rail .header-category-inner {
  width: var(--store-content-width); max-width: var(--store-content-max); margin-inline: auto;
}
/* These hosts group sections; only their children apply the shared content frame.
   A capped/padded Home host would subtract the gutters a second time. */
#main > .inspired-commerce-sections,
.product-page #product-main > .inspired-commerce-sections { width: 100%; max-width: none; padding-inline: 0; }
.product-page .product-hero-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; }
.product-page :is(.pdp-gallery, .purchase-panel) { width: 100%; max-width: none; min-width: 0; }
.product-page .purchase-panel { padding-inline: 0; }
.catalog-page main > .catalog-hero { background: #fff; color: var(--plum); }
.catalog-page .catalog-hero::before, .catalog-page .catalog-hero::after { display: none; }
.catalog-page .catalog-hero h1 { color: var(--plum); }
.catalog-page .catalog-hero > p { color: #75636d; }
.catalog-page .catalog-hero > .eyebrow { color: var(--magenta); }
.product-page .pdp-thumbs[hidden], [data-section-id="customer-stories"][hidden] { display: none !important; }

/* One section-heading scale; page titles have a separate, modest hierarchy. */
#main .commerce-section-head h2,
.product-page :is(.section-head h2, .section-heading h2, .mv-merch-heading h2, .pdp-info-heading > h2),
:is(.about-page, .career-page, .store-page, .info-page) main > section h2,
.all-categories-page .category-directory-heading h2 {
  font-family: var(--serif) !important;
  font-size: var(--store-section-heading) !important;
  line-height: 1.12 !important;
  font-weight: 600 !important;
  letter-spacing: -.02em;
}
:is(.about-page, .career-page, .store-page, .info-page, .policy-page, .article-page,
  .catalog-page, .all-categories-page, .wishlist-page, .cart-page, .checkout-page, .customer-page, .track-page, .wholesale-registration-page, .order-confirmation-page) main h1 {
  font-size: var(--store-page-heading) !important;
  line-height: 1.12 !important;
  overflow-wrap: anywhere;
}
.article-page .article-content { max-width: 850px; }
.article-page .article-layout { display: block; }
.article-page .article-content > section h2 { font-size: 28px; line-height: 1.2; }
.blog-cards a.blog-editorial-cover {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  gap: 14px; padding: 28px; color: var(--plum); background: #fcf0f7;
  aspect-ratio: 1.25; width: 100%; box-sizing: border-box;
}
.blog-editorial-cover span { font: 600 12px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.blog-editorial-cover strong { font: 600 32px/1.12 var(--serif); }
.blog-page .blog-feature { min-height: 0; }
.blog-page .blog-feature > img { min-height: 0; max-height: 480px; aspect-ratio: 4/3; object-fit: cover; }
#main > .hero .hero-content { margin-inline: var(--store-edge); padding: 26px 0; }
#main > .hero .hero-content h1 { font-size: clamp(42px, 4vw, 64px); line-height: 1.03; }

@media (max-width: 980px) {
  .product-page .product-hero-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .product-page .pdp-gallery { max-width: 520px; margin-inline: auto; }
  .product-page #purchase-panel { position: static; padding-block: 0 !important; }
  .track-page .track-intro { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .product-page .pdp-gallery { max-width: 360px; gap: 10px; }
  .product-page .pdp-gallery:has(.pdp-thumbs[hidden]) { grid-template-areas: "media"; }
  .product-page .pdp-main-media, .product-page .pdp-image-primary { min-height: 0 !important; height: auto !important; aspect-ratio: 1; }
  .product-page .pdp-image-primary img { min-height: 0; height: 100%; }
  .product-page .pdp-thumbs { margin-top: 0; gap: 8px; }
  .product-page .pdp-thumb { width: 54px; height: 54px; flex-basis: 54px; }
  .product-page .product-hero-layout { padding-top: 12px; gap: 18px; }
  .product-page .purchase-panel h1 { font-size: 28px; }
  .product-page #purchase-panel .pdp-fulfilment-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .product-page #purchase-panel .pdp-fulfilment-grid > div { display:flex !important;flex-direction:column;justify-content:center;gap:5px;min-height:88px !important;padding:9px 5px !important;text-align:center; }
  .product-page #purchase-panel .pdp-fulfilment-grid > div > b { display:none !important; }
  .product-page #purchase-panel .pdp-fulfilment-grid > div > span { min-width:0;font-size:11px !important; }
  .product-page #purchase-panel .pdp-fulfilment-grid small { font-size:10px !important; }
  .product-page #purchase-panel .pdp-fulfilment-grid .barcode-column > span { position:static !important; width:100% !important; grid-template-rows:auto 30px !important; }
  .product-page #purchase-panel .pdp-fulfilment-grid .barcode-column .auto-barcode,
  .product-page #purchase-panel .pdp-fulfilment-grid .barcode-column .auto-barcode svg { width:100% !important;min-width:0 !important;max-width:100% !important;height:30px !important;min-height:30px !important; }
  .blog-page .blog-feature > img { height:240px;max-height:none; }
  .article-page .article-content > section h2 { font-size: 24px; }
}
/* Runtime measurement accommodates long product names and mobile safe areas. */
/* Shared product density. Keep item counts/data intact; only presentation changes. */
:root { --store-product-columns: 4; --store-product-gap: 12px; }
@media (width < 1200px) { :root { --store-product-columns: 3; } }
@media (max-width: 980px) { :root { --store-product-columns: 2; --store-product-gap: 10px; } }
body:not(.admin-page) :is(.product-grid, #catalog-grid, #search-grid, #wishlist-grid) {
  display: grid !important;
  grid-template-columns: repeat(var(--store-product-columns), minmax(0, 1fr)) !important;
  grid-auto-flow: row; grid-auto-columns: auto;
  gap: var(--store-product-gap) !important; align-items: stretch;
  width: 100%; max-width: none; min-width: 0; padding-inline: 0; overflow: visible;
}
body:not(.admin-page) :is(.product-grid, #catalog-grid, #search-grid, #wishlist-grid) > .product-card {
  width: 100% !important; max-width: none !important; min-width: 0; height: 100%; align-self: stretch;
}
/* Highlight rows stay one row; the rest remains reachable with arrows/swipe. */
body:not(.admin-page) :is(#main .commerce-home-section, .product-page .recommendations, #mv-cross-sell, #mv-cart-suggestions, #mv-post-purchase) .product-grid {
  grid-template-columns: none !important; grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--store-product-columns) - 1) * var(--store-product-gap)) / var(--store-product-columns));
  overflow-x: auto; overflow-y: hidden; padding-block: 3px 12px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
body:not(.admin-page) :is(#main .commerce-home-section, .product-page .recommendations, #mv-cross-sell, #mv-cart-suggestions, #mv-post-purchase) .product-grid > .product-card { scroll-snap-align: start; }
.product-row { position: relative; width: 100%; min-width: 0; }
.product-row-controls { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 6px; }
.product-row-controls[hidden] { display: none !important; }
.product-row-controls button { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border: 1px solid #e5d5df; border-radius: 50%; background: #fff; color: var(--plum); cursor: pointer; pointer-events: auto; box-shadow: 0 3px 12px #4d173b20; }
.product-row-controls button:hover:not(:disabled) { background: #fcf0f7; border-color: var(--magenta); }
.product-row-controls button:disabled { opacity: .35; cursor: default; }
.product-row-controls button:focus-visible { outline: 2px solid var(--magenta); outline-offset: 3px; }
.product-row-controls svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
@media (max-width: 760px) { .product-row-controls button { width: 40px; height: 40px; } }

.back-to-top { bottom: max(24px, var(--store-fixed-clearance, 0px)) !important; }
@media (max-width: 700px) {
  .back-to-top { bottom: max(82px, var(--store-fixed-clearance, 0px)) !important; }
  .product-page .back-to-top { bottom: max(164px, var(--store-fixed-clearance, 0px)) !important; }
}
