/* Shared product-gallery geometry. The same grid exists before and after FlexSlider starts. */
@property --qtp-gallery-arrow-outset{syntax:'<length>';inherits:true;initial-value:25px}
body.single-product #main .avada-single-product-gallery-wrapper{width:100%!important;max-width:100%!important;min-width:0;flex:1 1 100%;margin-inline:auto!important}
body.single-product #main .woocommerce-product-gallery{position:relative;container-type:inline-size;display:grid!important;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;width:100%!important;max-width:100%!important;min-width:0;min-height:0!important;height:auto!important;margin:0!important;opacity:1!important;overflow:visible!important}
body.single-product #main .woocommerce-product-gallery::before{display:none!important}
body.single-product #main .woocommerce-product-gallery::after{content:''!important;display:var(--qtp-thumbs-display,none)!important;grid-area:2/1;align-self:start;padding-top:var(--qtp-thumbs-space,0px)!important;height:0!important;min-height:0;margin:0!important;pointer-events:none}
body.single-product #main .woocommerce-product-gallery>.woocommerce-product-gallery__wrapper,
body.single-product #main .woocommerce-product-gallery>.flex-viewport{grid-area:1/1;width:100%!important;height:100cqw!important;min-width:0;min-height:0!important;aspect-ratio:1!important;overflow:hidden!important;border-radius:8px!important;margin:0!important;transition:none!important}
body.single-product #main .woocommerce-product-gallery__wrapper{display:flex!important;flex-wrap:nowrap!important}
body.single-product #main .woocommerce-product-gallery>.woocommerce-product-gallery__wrapper>.woocommerce-product-gallery__image:not(:first-child){display:none!important}
body.single-product #main .woocommerce-product-gallery__image{flex:0 0 100cqw!important;width:100cqw!important;height:100cqw!important;min-width:0;aspect-ratio:1!important;float:none!important;border-radius:8px;overflow:hidden}
body.single-product #main .woocommerce-product-gallery__image>a:first-child{display:block!important;width:100%!important;height:100%!important;margin:0!important;padding:0!important;border-radius:8px;overflow:hidden}
body.single-product #main .woocommerce-product-gallery__image img{display:block!important;width:100%!important;height:100%!important;max-width:none!important;object-fit:cover!important;object-position:center;border-radius:8px!important;background:#fff}
body.single-product #main .avada-product-gallery-thumbs-wrapper{grid-area:2/1;align-self:start;position:relative!important;width:100%!important;max-height:none!important;height:auto!important;overflow:visible!important;margin:24px 0 0!important;padding:0!important;left:0!important;top:0!important;transform:none!important}
body.single-product #main .woocommerce-product-gallery .flex-control-thumbs{display:grid!important;grid-template-columns:repeat(7,minmax(0,1fr))!important;gap:8px;position:relative!important;width:100%!important;left:0!important;top:0!important;padding:0!important;margin:0!important;transform:none!important;transition:none!important}
body.single-product #main .woocommerce-product-gallery>.flex-control-thumbs{grid-area:2/1;align-self:start;margin-top:24px!important}
body.single-product #main .woocommerce-product-gallery .flex-control-thumbs li{box-sizing:border-box;width:auto!important;aspect-ratio:1;margin:0!important;padding:4px;float:none!important;border:1px solid #d8e1e8;border-radius:4px;transform:none!important}
body.single-product #main .woocommerce-product-gallery .flex-control-thumbs li:has(.flex-active){border:2px solid #244bed;padding:3px}
body.single-product #main .woocommerce-product-gallery .flex-control-thumbs img{display:block;width:100%!important;height:100%!important;object-fit:cover;border-radius:2px;opacity:1!important}

/* The visible circle stays compact; its transparent pointer target is twice as wide/high. */
body.single-product #main .woocommerce-product-gallery>.qtp-gallery-arrow{top:50cqw!important;width:46px;height:46px;padding:0;border:1px solid #244bed;border-radius:50%;background:#244bed!important;color:#fff!important;overflow:visible;z-index:8;transform:translateY(-50%);box-shadow:0 3px 14px #162c3a18;touch-action:manipulation}
body.single-product #main .woocommerce-product-gallery>.qtp-gallery-arrow::after{content:'';position:absolute;inset:calc(-50% - 2px);border-radius:50%;background:transparent;pointer-events:auto}
body.single-product #main .woocommerce-product-gallery>.qtp-gallery-arrow svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
body.single-product #main .woocommerce-product-gallery>.qtp-gallery-arrow:hover{background:#193cd0!important}
body.single-product #main .woocommerce-product-gallery>.qtp-gallery-arrow:focus-visible{outline:3px solid #85aaff;outline-offset:4px}
@media(min-width:1051px){
 body.single-product{--qv-gallery-top:133px}
 body.single-product.admin-bar{--qv-gallery-top:165px}
 body.single-product #main .qtp-hero>.fusion-builder-row>.qtp-gallery{position:sticky!important;top:var(--qv-gallery-top)!important;align-self:flex-start!important;z-index:2;container-type:inline-size}
 body.single-product #main .avada-single-product-gallery-wrapper{max-width:768px!important}
 /* Resolve this length against the gallery column before inheriting it into the image container.
    Use up to 20px extra outset, while leaving 10px within the existing 35px column gap. */
 body.single-product #main .qtp-gallery .avada-single-product-gallery-wrapper{--qtp-gallery-arrow-outset:clamp(25px,calc((100cqw - 768px)/2 + 25px),44px)}
 body.single-product #main .woocommerce-product-gallery>.qtp-gallery-arrow.prev{left:calc(-1 * var(--qtp-gallery-arrow-outset))!important}
 body.single-product #main .woocommerce-product-gallery>.qtp-gallery-arrow.next{right:calc(-1 * var(--qtp-gallery-arrow-outset))!important}
}
@media(min-width:1051px) and (max-width:1280px){body.single-product{--qv-gallery-top:123px}body.single-product.admin-bar{--qv-gallery-top:155px}}
@media(min-width:641px) and (max-width:1050px){
 body.single-product #main .woocommerce-product-gallery>.qtp-gallery-arrow.prev{left:-19px!important}
 body.single-product #main .woocommerce-product-gallery>.qtp-gallery-arrow.next{right:-19px!important}
}

/* Match the existing popup controls to the gallery controls without changing popup geometry. */
body.single-product .qtp-gallery-dialog :is(.qtp-gallery-arrow,.qtp-gallery-close){background:#244bed!important;border-color:#244bed!important;color:#fff!important}
body.single-product .qtp-gallery-dialog .qtp-gallery-arrow svg{fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
body.single-product .qtp-gallery-dialog .qtp-gallery-arrow{overflow:visible;touch-action:manipulation}
body.single-product .qtp-gallery-dialog .qtp-gallery-arrow::after{content:'';position:absolute;inset:calc(-50% - 2px);border-radius:50%;background:transparent;pointer-events:auto}
body.single-product .qtp-gallery-dialog :is(.qtp-gallery-arrow,.qtp-gallery-close):hover{background:#193cd0!important}
@media(max-width:640px){
 body.single-product .qtp-gallery-dialog .qtp-gallery-arrow{position:fixed!important;top:calc(50% + 23px)!important}
 body.single-product .qtp-gallery-dialog .qtp-gallery-arrow.prev{left:5px!important;right:auto!important}
 body.single-product .qtp-gallery-dialog .qtp-gallery-arrow.next{right:5px!important;left:auto!important}
 body.single-product #main .woocommerce-product-gallery{--qtp-thumbs-space:var(--qtp-thumbs-space-mobile,0px)}
 body.single-product #main .woocommerce-product-gallery .flex-control-thumbs{grid-template-columns:repeat(5,minmax(0,1fr))!important}
 body.single-product #main .woocommerce-product-gallery>.qtp-gallery-arrow{width:40px;height:40px}
 body.single-product #main .woocommerce-product-gallery>.qtp-gallery-arrow.prev{left:-15px!important}
 body.single-product #main .woocommerce-product-gallery>.qtp-gallery-arrow.next{right:-15px!important}
}
