/* Product cards: support both one-image links and layered gallery previews. */
body.wp-theme-shoptimizer ul.products li.product .woocommerce-image__wrapper>a>img{position:absolute!important;inset:0!important;display:block;width:100%!important;height:100%!important;max-width:100%!important;max-height:none!important;object-fit:contain!important;object-position:center!important;margin:0!important;padding:12px!important;box-sizing:border-box;transform:none!important}
body.wp-theme-shoptimizer ul.products li.product .woocommerce-image__wrapper .shoptimizer-plp-image-wrapper img{object-fit:contain!important;object-position:center!important}
/* Fixed stage; explicit anchor dimensions prevent intrinsic image overflow. */
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery{--jnjui-stage:clamp(280px,34vw,480px);--jnjui-gallery-pad:18px;position:relative}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .flex-viewport,body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .woocommerce-product-gallery__wrapper,body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery :is(.woocommerce-product-gallery__image,.woocommerce-product-gallery__image--placeholder){height:var(--jnjui-stage)!important;min-height:0}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .flex-viewport{overflow:hidden;border-radius:10px;background:#fff}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image>a{display:flex!important;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%!important;padding:12px}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img:not(.zoomImg){display:block!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;margin:0!important;object-fit:contain!important;object-position:center!important;transform:none!important}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .zoomImg{display:none!important}
/* Single-row square thumbnails, centered when they fit and scrollable when they overflow. */
body.wp-theme-shoptimizer .jnjui-thumb-rail{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:6px;min-width:0;margin-top:14px;position:relative}
body.wp-theme-shoptimizer .jnjui-thumb-rail[data-overflow="false"]{grid-template-columns:minmax(0,1fr)}
body.wp-theme-shoptimizer .jnjui-thumb-rail[data-overflow="false"]>.jnjui-thumb-arrow{display:none}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .jnjui-thumb-rail .flex-control-thumbs{position:relative;display:flex!important;flex-wrap:nowrap!important;gap:8px;width:100%!important;min-width:0;margin:0!important;padding:2px 0!important;overflow-x:auto;overflow-y:hidden;overscroll-behavior-inline:contain;scroll-snap-type:x proximity;scrollbar-width:none;list-style:none;box-sizing:border-box;-webkit-overflow-scrolling:touch}
body.wp-theme-shoptimizer .jnjui-thumb-rail .flex-control-thumbs::-webkit-scrollbar{display:none}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .jnjui-thumb-rail .flex-control-thumbs li{display:block;float:none!important;flex:0 0 64px;width:64px!important;height:64px!important;min-width:0;aspect-ratio:1;box-sizing:border-box;margin:0!important;padding:4px!important;border:1px solid var(--jnj3-line);border-radius:10px;background:#fff;overflow:hidden;scroll-snap-align:start}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .jnjui-thumb-rail .flex-control-thumbs li:first-child{margin-left:auto!important}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .jnjui-thumb-rail .flex-control-thumbs li:last-child{margin-right:auto!important}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .jnjui-thumb-rail .flex-control-thumbs li:has(img.flex-active){border-color:var(--jnj3-brand);box-shadow:inset 0 0 0 1px var(--jnj3-brand)}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .jnjui-thumb-rail .flex-control-thumbs img{display:block;position:static;width:100%!important;height:100%!important;max-height:none!important;object-fit:contain!important;object-position:center;opacity:1!important;margin:0!important;cursor:pointer;border-radius:5px}
body.wp-theme-shoptimizer .jnjui-thumb-arrow{display:flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;margin:0;background:var(--jnj3-surface);color:var(--jnj3-ink);border:1px solid var(--jnj3-line);border-radius:11px;box-shadow:none;cursor:pointer}
body.wp-theme-shoptimizer .jnjui-thumb-arrow svg{width:18px;height:18px;pointer-events:none}
body.wp-theme-shoptimizer .jnjui-thumb-arrow:disabled{opacity:.3;cursor:default}
body.wp-theme-shoptimizer .jnjui-thumb-arrow:not(:disabled):hover{border-color:var(--jnj3-brand)}
body.wp-theme-shoptimizer .jnjui-thumb-rail img[role=button]:focus-visible{outline:2px solid #235cbe;outline-offset:-2px}
/* Keep native main-image navigation visible and preserve its FlexSlider handlers. */
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .flex-direction-nav{position:absolute;left:var(--jnjui-gallery-pad);right:var(--jnjui-gallery-pad);top:calc(var(--jnjui-stage) / 2 + var(--jnjui-gallery-pad));width:auto;height:44px;padding:0;margin:0;transform:translateY(-50%);list-style:none;z-index:3;pointer-events:none}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .flex-direction-nav a{position:absolute;top:0;display:flex;align-items:center;justify-content:center;width:40px;height:44px;padding:0;margin:0;opacity:1!important;background:#fffffff0;color:var(--jnj3-ink);border:1px solid var(--jnj3-line);border-radius:12px;box-shadow:0 2px 8px #292d3212;pointer-events:auto;font-size:0;text-indent:0;transform:none!important}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .flex-direction-nav a::before,body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .flex-direction-nav a::after{display:none!important}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .flex-direction-nav .flex-prev{left:0!important}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .flex-direction-nav .flex-next{right:0!important}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .flex-direction-nav a svg{display:block;width:18px;height:18px;pointer-events:none}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .flex-direction-nav a.flex-disabled{opacity:.3!important;pointer-events:none}
@media(max-width:767px){
 body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery{--jnjui-stage:clamp(220px,78vw,340px);--jnjui-gallery-pad:12px}
 body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .jnjui-thumb-rail .flex-control-thumbs li{width:56px!important;height:56px!important;flex-basis:56px}
}
@media(max-width:359px){body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .jnjui-thumb-rail .flex-control-thumbs li{width:52px!important;height:52px!important;flex-basis:52px}}
@media(prefers-reduced-motion:reduce){body.wp-theme-shoptimizer .jnjui-thumb-rail .flex-control-thumbs{scroll-behavior:auto!important}}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .flex-direction-nav a{visibility:visible!important;width:44px}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .jnjui-gallery-expand{position:absolute;top:10px;right:10px;z-index:4;display:flex;align-items:center;justify-content:center;width:44px;height:44px;min-height:44px;padding:0;margin:0;border:1px solid var(--jnj3-line);border-radius:12px;background:#fffffff0;color:var(--jnj3-ink);box-shadow:0 2px 8px #292d3212;text-indent:0;font-size:0;cursor:pointer}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .jnjui-gallery-expand::before,body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .jnjui-gallery-expand::after{display:none!important}
body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery .jnjui-gallery-expand svg{display:block;width:18px;height:18px;pointer-events:none}
/* Let the grid establish a shared card height instead of the theme's sticky summary. */
@media(min-width:768px){
 body.wp-theme-shoptimizer.single-product .product-details-wrapper{align-items:stretch}
 body.wp-theme-shoptimizer.single-product .product-details-wrapper>.woocommerce-product-gallery,
 body.wp-theme-shoptimizer.single-product .product-details-wrapper>.summary{align-self:stretch!important;position:relative!important;top:auto!important;height:auto!important;box-sizing:border-box}
 body.wp-theme-shoptimizer.single-product .product-details-wrapper>.woocommerce-product-gallery{display:flex;flex-direction:column}
 body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery>.flex-viewport{flex:0 0 var(--jnjui-stage)}
 body.wp-theme-shoptimizer.single-product .woocommerce-product-gallery>.jnjui-thumb-rail{margin-top:auto;padding-top:14px}
}

/* Product discovery first: the thumbnail rail follows the image, never the summary height. */
body.wp-theme-shoptimizer.single-product #page .summary .product-widget:not(:has(.widget)){display:none!important}
body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery>.jnjui-thumb-rail{margin-top:12px!important;padding-top:0!important;flex:0 0 auto}
body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery>.flex-viewport{margin-bottom:0!important}
body.wp-theme-shoptimizer.single-product .jnjui-gallery-counter{position:absolute;z-index:4;left:12px;top:12px;display:inline-flex;align-items:center;gap:6px;min-height:30px;padding:5px 9px;border:1px solid var(--jnj3-line);border-radius:9px;background:#fffffff2;color:var(--jnj3-muted);font:500 12px/1.4 Arial,Helvetica,sans-serif;pointer-events:none}
.jnjui-gallery-counter[hidden]{display:none!important}.jnjui-gallery-counter svg{width:15px;height:15px;flex:0 0 15px}
@media(min-width:768px){
 body.wp-theme-shoptimizer.single-product #page .product-details-wrapper{gap:24px;padding-top:20px;padding-bottom:0!important;margin-bottom:16px!important}
 body.wp-theme-shoptimizer.single-product #page .product-details-wrapper>.woocommerce-product-gallery{--jnjui-gallery-pad:14px;--jnjui-stage:clamp(180px,calc(100svh - var(--jnjui-pdp-top,282px) - 138px),460px);padding:14px!important}
 body.wp-theme-shoptimizer.single-product #page .product-details-wrapper>.summary{padding:22px!important}
 body.wp-theme-shoptimizer.single-product #page .summary h1.product_title{font-size:26px!important;line-height:1.25!important;margin-bottom:10px!important}
 body.wp-theme-shoptimizer.single-product #page .summary>.price{display:block!important;font-size:28px!important;line-height:1.25!important;margin:16px 0 18px!important}
 body.wp-theme-shoptimizer.single-product #page .summary form.cart{margin-top:0!important;margin-bottom:0!important}
}
@media(max-width:767px){
 body.wp-theme-shoptimizer.single-product #page .product-details-wrapper{padding-bottom:0!important;margin-bottom:16px!important}
 body.wp-theme-shoptimizer.single-product #page .product-details-wrapper>.woocommerce-product-gallery{--jnjui-stage:clamp(210px,66vw,280px)}
}
/* Secondary reassurance is one calm horizontal block, using the existing editable content. */
body.wp-theme-shoptimizer.single-product .jnjui-product-assurance{box-sizing:border-box;width:calc(100% - 48px);max-width:1184px;margin:0 auto 24px;padding:0;clear:both}
body.wp-theme-shoptimizer.single-product .product-details-wrapper>.jnjui-product-assurance{grid-column:1/-1;width:100%;max-width:none;margin:0}
body.wp-theme-shoptimizer.single-product .jnjui-product-assurance .textwidget>div{display:grid!important;grid-template-columns:1.25fr repeat(4,minmax(0,1fr));align-items:start;gap:18px;padding:20px!important;border:1px solid var(--jnj3-line)!important;border-radius:14px!important;background:var(--jnj3-surface)!important}
body.wp-theme-shoptimizer.single-product .jnjui-product-assurance .textwidget>div>div{padding:0!important;border:0!important;gap:9px!important;min-width:0}
body.wp-theme-shoptimizer.single-product .jnjui-product-assurance .textwidget>div>div+div{border-left:1px solid var(--jnj3-line)!important;padding-left:16px!important}
body.wp-theme-shoptimizer.single-product .jnjui-product-assurance p:empty{display:none!important}
body.wp-theme-shoptimizer.single-product .jnjui-product-assurance p{font:400 12px/1.55 Arial,Helvetica,sans-serif!important;color:var(--jnj3-muted)!important;margin:4px 0 0!important}
body.wp-theme-shoptimizer.single-product .jnjui-product-assurance p:first-child{font-size:13px!important;font-weight:600!important;line-height:1.45!important;color:var(--jnj3-ink)!important;margin-top:0!important}
body.wp-theme-shoptimizer.single-product .jnjui-product-assurance svg{width:19px!important;height:19px!important;min-width:19px;flex:0 0 19px;margin-top:1px!important;color:var(--jnj3-muted)}
@media(min-width:768px) and (max-width:1199px){
 body.wp-theme-shoptimizer.single-product .jnjui-product-assurance .textwidget>div{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
 body.wp-theme-shoptimizer.single-product .jnjui-product-assurance .textwidget>div>div:first-child{grid-column:1/-1;padding-bottom:12px!important;border-bottom:1px solid var(--jnj3-line)!important}
 body.wp-theme-shoptimizer.single-product .jnjui-product-assurance .textwidget>div>div:nth-child(2){padding-left:0!important;border-left:0!important}
}
@media(max-width:767px){
 body.wp-theme-shoptimizer.single-product .jnjui-product-assurance{width:calc(100% - 24px);margin-bottom:24px}
 body.wp-theme-shoptimizer.single-product .jnjui-product-assurance .textwidget>div{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:16px!important}
 body.wp-theme-shoptimizer.single-product .jnjui-product-assurance .textwidget>div>div+div{border-left:0!important;padding-left:0!important}
 body.wp-theme-shoptimizer.single-product .jnjui-product-assurance .textwidget>div>div:first-child{grid-column:1/-1;padding-bottom:12px!important;border-bottom:1px solid var(--jnj3-line)!important}
}

body.wp-theme-shoptimizer.single-product .jnjui-product-assurance+.woocommerce-tabs{margin-top:0!important}

/* Desktop: a left thumbnail column saves vertical space; touch layouts keep the horizontal rail. */
@media(min-width:1024px){
 body.wp-theme-shoptimizer.single-product #page .product-details-wrapper>.woocommerce-product-gallery:has(>.jnjui-thumb-rail){display:grid;grid-template-columns:64px minmax(0,1fr);grid-template-rows:var(--jnjui-stage);gap:14px;align-content:start}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery:has(>.jnjui-thumb-rail)>.flex-viewport{grid-column:2;grid-row:1;min-width:0;width:100%;align-self:start}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery>.jnjui-thumb-rail{grid-column:1;grid-row:1;grid-template-columns:minmax(0,1fr);grid-template-rows:44px minmax(0,1fr) 44px;gap:6px;width:64px;height:var(--jnjui-stage);min-height:0;margin:0!important;padding:0!important;align-self:start;justify-items:center}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery>.jnjui-thumb-rail[data-overflow="false"]{grid-template-rows:minmax(0,1fr)}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery .jnjui-thumb-rail .flex-control-thumbs{flex-direction:column;align-items:center;height:100%;min-height:0;overflow-x:hidden;overflow-y:auto;padding:2px!important;overscroll-behavior-y:contain;scroll-snap-type:y proximity}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery .jnjui-thumb-rail .flex-control-thumbs li{flex:0 0 56px;width:56px!important;height:56px!important}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery .jnjui-thumb-rail .flex-control-thumbs li:first-child{margin-left:0!important;margin-top:auto!important}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery .jnjui-thumb-rail .flex-control-thumbs li:last-child{margin-right:0!important;margin-bottom:auto!important}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery .jnjui-thumb-arrow svg{transform:rotate(90deg)}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery:has(>.jnjui-thumb-rail) .flex-direction-nav{left:92px}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery:has(>.jnjui-thumb-rail) .jnjui-gallery-counter{left:94px}
}

/* Balance the thumbnail column with an equal right gutter, so the hero is centered in its card. */
@media(min-width:1024px){
 body.wp-theme-shoptimizer.single-product #page .product-details-wrapper>.woocommerce-product-gallery:has(>.jnjui-thumb-rail){grid-template-columns:64px minmax(0,1fr) 64px}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery>.jnjui-thumb-rail{height:calc(var(--jnjui-stage) - 44px);align-self:end}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery:has(>.jnjui-thumb-rail) .jnjui-gallery-counter{left:12px;top:12px}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery:has(>.jnjui-thumb-rail) .flex-direction-nav{left:92px;right:92px}
}

/* A full-width stage keeps native slider measurements independent of the thumbnail column. */
@media(min-width:1024px){
 body.wp-theme-shoptimizer.single-product #page .product-details-wrapper>.woocommerce-product-gallery:has(>.jnjui-thumb-rail){display:flex;flex-direction:column;gap:0;align-items:stretch}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery:has(>.jnjui-thumb-rail)>.flex-viewport{flex:0 0 var(--jnjui-stage);width:100%;min-width:0}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery:has(>.jnjui-thumb-rail) .woocommerce-product-gallery__image>a{padding:12px 90px!important}
 body.wp-theme-shoptimizer.single-product #page .woocommerce-product-gallery>.jnjui-thumb-rail{position:absolute;left:14px;top:58px;width:64px;height:calc(var(--jnjui-stage) - 44px);z-index:4;align-self:auto}
}
