/* Retail refinement: store colors and existing product/cart contracts remain authoritative. */
body.storefront-editorial-v2.storefront-refined { --storefront-control-radius: 12px; background: var(--rs-surface); }
body.storefront-editorial-v2.storefront-refined .header { height: auto; min-height: 76px; background: var(--rs-surface); }
body.storefront-editorial-v2.storefront-refined .header-content { display: grid; height: auto; min-height: 76px; grid-template-columns: minmax(150px, 1fr) auto minmax(180px, 240px) auto; grid-template-areas: "logo nav search actions"; gap: 20px; }
body.storefront-editorial-v2.storefront-refined .logo { grid-area: logo; min-width: 0; max-width: 280px; }
body.storefront-editorial-v2.storefront-refined .logo-main { overflow: visible; white-space: normal; text-overflow: clip; font-size: 1.25rem; line-height: 1.3; overflow-wrap: anywhere; }
body.storefront-editorial-v2.storefront-refined .nav { grid-area: nav; }
body.storefront-editorial-v2.storefront-refined .storefront-header-actions { grid-area: actions; width: auto; }
body.storefront-editorial-v2.storefront-refined .storefront-search { grid-area: search; display: flex; justify-self: stretch; max-width: none; width: 100%; min-width: 0; height: 44px; background: var(--rs-surface-soft); border-radius: 12px; }
body.storefront-editorial-v2.storefront-refined .storefront-search input { display: block; position: static; clip: auto; clip-path: none; overflow: visible; width: 100%; height: 42px; padding: 8px 12px; opacity: 1; font-size: 1rem; }
body.storefront-editorial-v2.storefront-refined #hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 320px; height: auto; max-width: 1280px; margin: 24px auto; border: 0; border-radius: 16px; background: var(--rs-surface-soft); }
body.storefront-editorial-v2.storefront-refined #hero .storefront-hero-visual { position: relative; inset: auto; grid-column: 1; min-height: 320px; height: auto; }
body.storefront-editorial-v2.storefront-refined #hero .hero-background { position: absolute; inset: 0; width: 100%; height: 100%; }
body.storefront-editorial-v2.storefront-refined #hero .hero-content { position: relative; inset: auto; grid-column: 2; grid-template-areas: none; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 16px; min-height: 0; width: auto; max-width: none; padding: 32px; background: transparent; }
body.storefront-editorial-v2.storefront-refined #hero .hero-title { font-size: clamp(1.8rem, 3vw, 2.8rem); line-height: 1.25; max-width: 24ch; margin: 0; }
body.storefront-editorial-v2.storefront-refined #hero .hero-subtitle { display: block; margin: 0; font-size: 1rem; line-height: 1.65; max-width: 58ch; color: var(--rs-ink-soft); }
body.storefront-editorial-v2.storefront-refined #hero .storefront-hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin: 4px 0 0; }
body.storefront-editorial-v2.storefront-refined #hero .hero-product-accent { display: none; }
body.storefront-editorial-v2.storefront-refined #hero .storefront-eyebrow { display: none; }
body.storefront-editorial-v2.storefront-refined #hero.hero-without-image { display: block; min-height: 0; }
body.storefront-editorial-v2.storefront-refined #hero.hero-without-image .storefront-hero-visual { display: none; }
body.storefront-editorial-v2.storefront-refined #hero.hero-without-image .hero-content { padding: 32px; }
body.storefront-editorial-v2.storefront-refined #categories { padding: 24px 0; }
body.storefront-editorial-v2.storefront-refined #categories .section-header,
body.storefront-editorial-v2.storefront-refined #products .section-header { text-align: start; margin-bottom: 20px; }
body.storefront-editorial-v2.storefront-refined #categories .section-title,
body.storefront-editorial-v2.storefront-refined #products .section-title { font-size: 1.5rem; }
body.storefront-editorial-v2.storefront-refined #categories .categories-grid { display: flex; flex-wrap: wrap; gap: 10px; max-width: none; border: 0; overflow: visible; }
body.storefront-editorial-v2.storefront-refined #categories .category-card { flex: 1 1 160px; min-height: 56px; border: 1px solid var(--rs-line); border-radius: 12px; padding: 12px 16px; background: var(--rs-surface); box-shadow: none; }
body.storefront-editorial-v2.storefront-refined #categories .category-media { display: none; }
body.storefront-editorial-v2.storefront-refined #categories .category-card-content { padding: 0; }
body.storefront-editorial-v2.storefront-refined #categories .category-description { display: none; }
body.storefront-editorial-v2.storefront-refined #products { padding-block: 24px 40px; }
body.storefront-editorial-v2.storefront-refined .carousel-item,
body.storefront-editorial-v2.storefront-refined .product-card { border-radius: 12px; box-shadow: none; justify-content: flex-start; }
body.storefront-editorial-v2.storefront-refined .carousel-content,
body.storefront-editorial-v2.storefront-refined .product-info { padding: 16px; min-height: 0; }
body.storefront-editorial-v2.storefront-refined .carousel-price,
body.storefront-editorial-v2.storefront-refined .product-price { font-variant-numeric: tabular-nums; font-size: 1.2rem; }
body.storefront-editorial-v2.storefront-refined .product-image-fallback,
body.storefront-editorial-v2.storefront-refined .carousel-image-fallback { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 100%; min-height: 0; color: var(--rs-ink-soft); background: var(--rs-surface-soft); font-size: .85rem; }
body.storefront-editorial-v2.storefront-refined .product-image-fallback[hidden],
body.storefront-editorial-v2.storefront-refined .carousel-image-fallback[hidden] { display: none; }
body.storefront-editorial-v2.storefront-refined .product-image-fallback i,
body.storefront-editorial-v2.storefront-refined .carousel-image-fallback i { font-size: 28px; }
body.storefront-editorial-v2.storefront-refined .product-cta { min-height: 44px; white-space: nowrap; }
body.storefront-editorial-v2.storefront-refined .products-page-hero { padding: 0; height: auto; min-height: 0; }
body.storefront-editorial-v2.storefront-refined .products-page-hero .container { display: block; }
body.storefront-editorial-v2.storefront-refined .products-page-hero .hero-title { font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.35; }
body.storefront-editorial-v2.storefront-refined .products-page-hero .hero-subtitle { max-width: 65ch; font-size: 1rem; margin-top: 8px; }
body.storefront-editorial-v2.storefront-refined .filters-sidebar { border-radius: 12px; box-shadow: none; }
body.storefront-editorial-v2.storefront-refined .cart-sidebar { background: var(--rs-surface); }
body.storefront-editorial-v2.storefront-refined .cart-item { border: 0; border-bottom: 1px solid var(--rs-line); border-radius: 0; padding-block: 16px; }
body.storefront-editorial-v2.storefront-refined .cart-summary { border-radius: 12px; background: var(--rs-surface-soft); padding: 16px; }
body.storefront-editorial-v2.storefront-refined .cart-checkout-btn { min-height: 48px; border-radius: 12px; box-shadow: none; }
body.storefront-editorial-v2.storefront-refined #productModal .modal-content { border-radius: 16px; box-shadow: 0 16px 48px rgba(15, 23, 42, .18); }
body.storefront-editorial-v2.storefront-refined #productModal .modal-title { line-height: 1.4; }
body.storefront-editorial-v2.storefront-refined #productModal .modal-description { max-width: 65ch; line-height: 1.7; }
body.storefront-editorial-v2.storefront-refined #productModal .modal-purchase { border-radius: 12px; background: var(--rs-surface-soft); }
body.storefront-editorial-v2.storefront-refined .footer { border-top: 1px solid var(--rs-line); }
@media (max-width: 1100px) {
  body.storefront-editorial-v2.storefront-refined .header-content { grid-template-columns: minmax(150px, 1fr) minmax(180px, 1fr) auto; grid-template-areas: "logo search actions"; }
  body.storefront-editorial-v2.storefront-refined .header .nav { position: absolute; }
  body.storefront-editorial-v2.storefront-refined .menu-toggle { display: flex; }
  body.storefront-editorial-v2.storefront-refined .nav-menu:not(.active) { display: none; }
  body.storefront-editorial-v2.storefront-refined .nav-menu.active { position: fixed; inset: 76px 16px auto; width: auto; display: flex; flex-direction: column; background: var(--rs-surface); border: 1px solid var(--rs-line); border-radius: 12px; padding: 16px; }
}
@media (max-width: 768px) {
  body.storefront-editorial-v2.storefront-refined .header-content { min-height: 104px; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "logo actions" "search search"; gap: 8px 12px; padding-block: 8px; }
  body.storefront-editorial-v2.storefront-refined .logo-main { font-size: 1rem; }
  body.storefront-editorial-v2.storefront-refined .logo-text { max-width: none; }
  body.storefront-editorial-v2.storefront-refined .nav-menu.active { inset-block-start: calc(var(--sf-header-height, 104px) + 8px); }
  body.storefront-editorial-v2.storefront-refined #hero { grid-template-columns: minmax(0, 1fr); margin: 16px; min-height: 0; }
  body.storefront-editorial-v2.storefront-refined #hero .storefront-hero-visual { grid-column: 1; height: 190px; min-height: 190px; }
  body.storefront-editorial-v2.storefront-refined #hero .hero-content { grid-column: 1; padding: 24px; }
  body.storefront-editorial-v2.storefront-refined #hero.hero-without-image .hero-content { padding: 24px; }
  body.storefront-editorial-v2.storefront-refined #hero .hero-title { font-size: 1.6rem; }
  body.storefront-editorial-v2.storefront-refined #hero .hero-subtitle { font-size: .95rem; }
  body.storefront-editorial-v2.storefront-refined #categories .category-card { flex-basis: calc(50% - 10px); }
  body.storefront-editorial-v2.storefront-refined .carousel-content,
  body.storefront-editorial-v2.storefront-refined .product-info { padding: 12px; min-height: 0; gap: 8px; }
  body.storefront-editorial-v2.storefront-refined .carousel-title,
  body.storefront-editorial-v2.storefront-refined .product-name { font-size: .9375rem; line-height: 1.4; }
  body.storefront-editorial-v2.storefront-refined .product-cta { padding-inline: 10px; font-size: .8rem; }
  body.storefront-editorial-v2.storefront-refined .cookie-consent { right: 8px; left: 8px; bottom: 8px; width: auto; }
  body.storefront-editorial-v2.storefront-refined .cookie-consent__body { padding: 12px; gap: 8px; }
  body.storefront-editorial-v2.storefront-refined .cookie-consent__actions { gap: 6px; }
  body.storefront-editorial-v2.storefront-refined .cookie-consent__button { min-height: 44px; padding-inline: 10px; }
  body.storefront-editorial-v2.storefront-refined #productModal .modal-content { border-radius: 12px; }
}

/* Content stays visible before the scroll observer runs, including slow connections. */
body.storefront-editorial-v2.storefront-refined #mainContent > section.section-animate,
body.storefront-editorial-v2.storefront-refined > section.section-animate { opacity: 1; transform: none; }
body.storefront-editorial-v2.storefront-refined .product-actions { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 6px; }
body.storefront-editorial-v2.storefront-refined .product-actions .product-cta { width: 100%; min-width: 0; }
@media (max-width: 768px) {
  body.storefront-editorial-v2.storefront-refined .product-cta-primary i { display: none; }
  body.storefront-editorial-v2.storefront-refined .product-cta-primary { padding-inline: 8px; font-size: .875rem; line-height: 1.35; white-space: normal; }
}

@media (max-width: 768px) {
  body.storefront-editorial-v2.storefront-refined .header { padding-top: var(--rs-safe-top, 0px); }
  body.storefront-editorial-v2.storefront-refined .nav-menu.active { inset-block-start: calc(var(--rs-storefront-header-height, 112px) + 8px); max-height: calc(var(--rs-visual-height, 100dvh) - var(--rs-storefront-header-height, 112px) - 24px); overflow-y: auto; }
  body.storefront-editorial-v2.storefront-refined .products-page-hero { padding-block: 0; }
  body.storefront-editorial-v2.storefront-refined .products-page-hero .hero-content { padding-block: 16px; gap: 6px; }
  body.storefront-editorial-v2.storefront-refined .products-page-hero .hero-title { font-size: 1.375rem; line-height: 1.35; }
  body.storefront-editorial-v2.storefront-refined .products-page-hero .hero-subtitle { margin: 0; font-size: .9375rem; line-height: 1.55; }
  body.storefront-editorial-v2.storefront-refined .product-info { display: flex; flex-direction: column; }
  body.storefront-editorial-v2.storefront-refined .product-category { font-size: .8125rem; line-height: 1.4; }
  body.storefront-editorial-v2.storefront-refined .product-name { min-height: 0; margin: 0; }
  body.storefront-editorial-v2.storefront-refined .product-price { margin-block: 4px; font-size: 1.125rem; }
  body.storefront-editorial-v2.storefront-refined .product-actions { margin-top: auto; }
  body.storefront-editorial-v2.storefront-refined .product-cta-primary { font-size: .8125rem; padding-inline: 6px; min-height: 44px; }
  /* The sticky header already occupies normal flow; do not reserve it twice. */
  body.storefront-editorial-v2.storefront-refined .account-main { padding-top: 16px; padding-bottom: max(40px, var(--rs-safe-bottom, 0px)); }
  body.storefront-editorial-v2.storefront-refined .account-shell { gap: 16px; }
  body.storefront-editorial-v2.storefront-refined .account-intro { padding: 16px; border-radius: 14px; }
  body.storefront-editorial-v2.storefront-refined .account-eyebrow { display: none; }
  body.storefront-editorial-v2.storefront-refined .account-intro h1 { font-size: 1.5rem; line-height: 1.35; margin-block: 0 8px; }
  body.storefront-editorial-v2.storefront-refined .account-intro > p { margin-bottom: 8px; font-size: .9375rem; line-height: 1.55; }
  body.storefront-editorial-v2.storefront-refined .account-card { padding: 16px; }
  body.storefront-editorial-v2.storefront-refined .account-card-heading { margin-bottom: 16px; }
  body.storefront-editorial-v2.storefront-refined .account-card-heading h2 { font-size: 1.25rem; }
  body.storefront-editorial-v2.storefront-refined .account-back-link { min-height: 44px; margin-top: 0; }
}
@media (max-width: 360px) {
  body.storefront-editorial-v2.storefront-refined .product-actions { grid-template-columns: minmax(0, 1fr) 44px; }
  body.storefront-editorial-v2.storefront-refined .products-grid { grid-template-columns: minmax(0, 1fr); }
}
