/* Full-screen viewer is isolated from theme gallery styles and loaded only on enabled product pages. */
@media(max-width:767px){
 body.kpe-gallery-studio-enabled .woocommerce-product-gallery__image>a{cursor:zoom-in}
 body.kpe-gallery-studio-enabled .woocommerce-product-gallery__image:not(.woocommerce-product-gallery__image--placeholder)>a{display:grid;place-items:center;width:100%;aspect-ratio:4/5;max-height:620px;overflow:hidden;border:1px solid #e8e1d6;border-radius:10px;background:#fff;touch-action:pan-y}
 body.kpe-gallery-studio-enabled .woocommerce-product-gallery__image>a>img:not(.zoomImg){display:block;width:100%!important;height:100%!important;max-width:100%!important;object-fit:contain!important;object-position:center!important}
 body.kpe-gallery-studio-enabled .woocommerce-product-gallery .zoomImg{display:none!important}
 body.kpe-gallery-studio-enabled .woocommerce-product-gallery .flex-direction-nav,body.kpe-gallery-studio-enabled .woocommerce-product-gallery .flickity-prev-next-button{display:none!important}
}
@media(min-width:768px){
 body.kpe-gallery-studio-enabled .woocommerce-product-gallery__image>a.kpe-gallery-hover-zoom{display:block;position:relative;width:100%;height:auto;line-height:0;overflow:hidden;cursor:zoom-in}
 body.kpe-gallery-studio-enabled .woocommerce-product-gallery__image>a.kpe-gallery-hover-zoom>img:not(.zoomImg):not(.kpe-gallery-hover-image){display:block;width:100%;height:auto}
 body.kpe-gallery-studio-enabled .woocommerce-product-gallery__image>a.kpe-gallery-hover-zoom>.kpe-gallery-hover-image{position:absolute!important;z-index:3;inset:0;display:block!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:contain;pointer-events:none;opacity:0;transform:scale(1.65);transition:opacity .15s ease}
 body.kpe-gallery-studio-enabled .woocommerce-product-gallery__image>a .kpe-gallery-hover-image.is-ready{opacity:1}
}
.kpe-gallery-studio{--kpe-gs-accent:var(--kpe-accent,#876028);position:fixed;z-index:2147483000;box-sizing:border-box;width:100%;height:100%;height:100dvh;max-width:none;max-height:none;inset:0;margin:0;padding:0;border:0;border-radius:0;background:#fff;color:#24211d;overflow:hidden;overscroll-behavior:contain}
.kpe-gallery-studio[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto;animation:kpe-gallery-enter .32s cubic-bezier(.2,0,0,1) both}
.kpe-gallery-studio::backdrop{background:rgba(17,16,14,.74);animation:kpe-gallery-backdrop .32s ease-out both}
.kpe-gallery-studio *{box-sizing:border-box}
.kpe-gallery-studio__header{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:16px;min-height:64px;padding:10px max(20px,env(safe-area-inset-right)) 10px max(20px,env(safe-area-inset-left));border-bottom:1px solid #ece9e4;background:#fff;direction:rtl}
.kpe-gallery-studio__back{justify-self:start;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 15px;appearance:none;border:1px solid var(--kpe-gs-accent);border-radius:999px;background:var(--kpe-gs-accent);color:#fff;box-shadow:0 2px 8px #0000000a;cursor:pointer;font:600 14px/1.3 sans-serif;font-family:inherit;white-space:nowrap;transition:filter .16s ease,transform .16s ease}
.kpe-gallery-studio__back:hover{filter:brightness(.93)}
.kpe-gallery-studio__back:active{transform:scale(.97)}
.kpe-gallery-studio__count{margin:0;color:#5b554d;font:600 15px/1.4 sans-serif;direction:rtl;font-family:inherit}
.kpe-gallery-studio__stage{position:relative;display:grid;place-items:center;min-height:0;padding:8px 12px;overflow:hidden;touch-action:pan-y;direction:ltr}
.kpe-gallery-studio__image{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;opacity:1;transform:scale(1);transition:opacity .18s ease,transform .32s cubic-bezier(.2,0,0,1)}
.kpe-gallery-studio__image.is-changing{opacity:.72;transform:scale(.99)}
.kpe-gallery-studio__status{position:absolute;z-index:1;inset:auto 12px 18px;display:flex;align-items:center;justify-content:center;gap:9px;margin:auto;padding:10px 14px;width:max-content;max-width:calc(100% - 24px);border-radius:999px;background:rgba(37,34,29,.84);color:#fff;font:600 13px/1.5 sans-serif;font-family:inherit;text-align:center;pointer-events:none}
.kpe-gallery-studio__status[hidden]{display:none!important}.kpe-gallery-studio__stage.is-loading .kpe-gallery-studio__status::before{content:'';width:15px;height:15px;flex:none;border:2px solid #ffffff70;border-top-color:#fff;border-radius:50%;animation:kpe-gallery-spin .8s linear infinite}
.kpe-gallery-studio__thumbs{display:flex;align-items:center;justify-content:flex-start;gap:10px;min-height:102px;padding:12px max(20px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#b7a58b transparent;border-top:1px solid #ece9e4;background:#fff;direction:ltr}
.kpe-gallery-studio__thumb:first-child{margin-left:auto}.kpe-gallery-studio__thumb:last-child{margin-right:auto}
.kpe-gallery-studio__thumb{display:grid;place-items:center;flex:0 0 auto;width:72px;height:72px;padding:3px;overflow:hidden;border:1px solid #e4e0da;border-radius:8px;background:#fff;cursor:pointer;touch-action:manipulation;transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease}
.kpe-gallery-studio__thumb img{display:block;width:100%;height:100%;border-radius:5px;object-fit:cover}
.kpe-gallery-studio__thumb[aria-pressed=true]{border:2px solid var(--kpe-gs-accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--kpe-gs-accent) 17%,transparent)}
.kpe-gallery-studio__thumb:active{transform:scale(.96)}
.kpe-gallery-studio :is(button):focus-visible{outline:3px solid #1769aa;outline-offset:3px}
html.kpe-gallery-studio-open,html.kpe-gallery-studio-open body{overflow:hidden!important;overscroll-behavior:none}
@keyframes kpe-gallery-enter{from{opacity:0;transform:scale(.985)}to{opacity:1;transform:scale(1)}}
@keyframes kpe-gallery-backdrop{from{opacity:0}to{opacity:1}}
@keyframes kpe-gallery-spin{to{transform:rotate(360deg)}}
@media(max-width:640px){
 .kpe-gallery-studio__header{min-height:56px;padding-block:8px;padding-inline:14px}
 .kpe-gallery-studio__stage{padding:4px 6px}
 .kpe-gallery-studio__back{min-height:42px;padding:7px 12px;font-size:13px}
 .kpe-gallery-studio__thumbs{min-height:88px;justify-content:flex-start;gap:8px;padding-inline:12px}
 .kpe-gallery-studio__thumb{width:62px;height:62px}
}
@media(prefers-reduced-motion:reduce){
 .kpe-gallery-studio[open],.kpe-gallery-studio::backdrop{animation:none}
 .kpe-gallery-studio__status::before{animation:none!important}
 .kpe-gallery-studio *{scroll-behavior:auto!important;transition:none!important}
}
