/* MOON RC30 — screenshot-led storefront alignment and compact conversion UI. */

/* Header/anchor safety: section headings never open underneath the sticky header. */
html{scroll-padding-top:112px}
.moon-section,[id^="moon-"]{scroll-margin-top:112px}
.moon-v6-section-head{min-width:0}
.moon-v6-section-head h2{max-width:100%;overflow-wrap:anywhere;text-wrap:balance}

/* New Arrivals deliberately shares the exact Woo product-card contract used by Best Sellers. */
#moon-new-arrivals.woocommerce ul.products{align-items:stretch!important}
#moon-new-arrivals.woocommerce ul.products li.product{height:100%!important}

/* Editorial Lookbook: one proportion, one baseline, no staggered or mismatched cards. */
.moon-v6-lookbook-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-template-rows:none!important;
  align-items:stretch!important;
  gap:clamp(10px,1.35vw,20px)!important;
}
.moon-v6-lookbook-item,
.moon-v6-lookbook-item-1,
.moon-v6-lookbook-item-2,
.moon-v6-lookbook-item-3{
  grid-row:auto!important;
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  margin:0!important;
  aspect-ratio:4/5!important;
}
.moon-v6-lookbook-item img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  object-position:center top!important;
}
.moon-v6-lookbook-item>div{left:0!important;right:0!important;bottom:0!important;padding:clamp(16px,2vw,24px)!important}
.moon-v6-lookbook-item strong{max-width:100%;overflow-wrap:anywhere;text-wrap:pretty}

/* Single-product safe area and long-title protection. */
.single-product .moon-shop-main>.moon-container{width:min(1380px,calc(100% - 48px))!important}
.single-product .woocommerce div.product{min-width:0!important}
.single-product .woocommerce div.product .summary{
  min-width:0!important;
  max-width:100%!important;
  padding:clamp(20px,2.25vw,34px)!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
  border:1px solid rgba(108,184,248,.2)!important;
  border-radius:22px!important;
  background:linear-gradient(145deg,rgba(7,24,40,.9),rgba(3,12,22,.88))!important;
}
.single-product .woocommerce div.product .product_title{
  width:100%!important;
  max-width:15ch!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  text-wrap:balance!important;
}

/* Compact sticky product card. Its nested image is explicitly constrained. */
.moon-sticky-product{
  left:auto!important;
  right:max(16px,env(safe-area-inset-right))!important;
  bottom:max(16px,env(safe-area-inset-bottom))!important;
  width:min(350px,calc(100vw - 32px))!important;
  border:1px solid rgba(111,192,255,.28)!important;
  border-radius:16px!important;
  overflow:hidden!important;
  box-shadow:0 18px 55px rgba(0,0,0,.42)!important;
}
.moon-sticky-product-inner.moon-container{
  width:100%!important;
  min-height:54px!important;
  margin:0!important;
  padding:6px 7px!important;
  gap:8px!important;
}
.moon-sticky-product-meta{min-width:0!important;gap:8px!important}
.moon-sticky-product-image{
  display:block!important;
  flex:0 0 34px!important;
  width:34px!important;
  height:42px!important;
  overflow:hidden!important;
  border-radius:9px!important;
  background:#09131e!important;
}
.moon-sticky-product-image img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  margin:0!important;
  object-fit:cover!important;
  object-position:center top!important;
}
.moon-sticky-product-meta>div{min-width:0!important}
.moon-sticky-product-meta strong{display:block;max-width:175px!important;font-size:.67rem!important;line-height:1.25!important}
.moon-sticky-product-meta [data-moon-sticky-price]{display:block;font-size:.64rem!important;line-height:1.2!important}
.moon-sticky-product .moon-button{flex:0 0 auto!important;min-height:38px!important;padding:0 11px!important;border-radius:11px!important;font-size:.65rem!important;white-space:nowrap!important}

@media(max-width:1023px){
  html{scroll-padding-top:96px}
  .moon-section,[id^="moon-"]{scroll-margin-top:96px}
  .moon-v6-lookbook-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .single-product .moon-shop-main>.moon-container{width:calc(100% - 32px)!important}
  .single-product .woocommerce div.product{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:22px!important}
  .single-product .woocommerce div.product .summary{position:relative!important;top:auto!important;width:100%!important}
  .single-product .woocommerce div.product .product_title{font-size:clamp(2rem,7.2vw,3.35rem)!important;line-height:1!important}
}

@media(max-width:767px){
  html{scroll-padding-top:82px}
  .moon-section,[id^="moon-"]{scroll-margin-top:82px}
  .moon-v6-lookbook-grid{grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
  .moon-v6-lookbook-item,.moon-v6-lookbook-item-1,.moon-v6-lookbook-item-2,.moon-v6-lookbook-item-3{aspect-ratio:4/5!important}
  .single-product .moon-shop-main>.moon-container{width:calc(100% - 24px)!important}
  .single-product .woocommerce div.product .summary{padding:20px 16px!important;border-radius:18px!important}
  .single-product .woocommerce div.product .product_title{font-size:clamp(1.85rem,9vw,2.55rem)!important;max-width:16ch!important}
  .moon-sticky-product{
    right:max(10px,env(safe-area-inset-right))!important;
    bottom:calc(var(--moon-mobile-nav-h,64px) + 10px + env(safe-area-inset-bottom))!important;
    width:min(330px,calc(100vw - 20px))!important;
  }
  .moon-sticky-product-meta strong{max-width:34vw!important}
}

@media(max-width:359px){
  .moon-sticky-product-image{display:none!important}
  .moon-sticky-product{width:calc(100vw - 16px)!important;right:8px!important}
  .moon-sticky-product-meta strong{max-width:42vw!important}
}

@media(prefers-reduced-motion:reduce){
  .moon-sticky-product,.moon-v6-lookbook-item,.moon-v6-lookbook-item img{transition:none!important;animation:none!important}
}
