@import url('polski-ui-tokens.css');

.woocommerce-product-gallery__image {
    overflow: hidden;
    border-radius: 14px;
}

.polski-gallery-zoomable {
    transition: transform .22s ease;
    cursor: zoom-in;
}

.polski-gallery-lightbox-trigger {
    cursor: zoom-in;
}

.woocommerce-product-gallery__image:hover .polski-gallery-zoomable {
    transform: scale(var(--polski-gallery-zoom-scale, 1.45));
}

.polski-gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .82);
    display: grid;
    place-items: center;
    z-index: 9999;
}

/* The `display: grid` above otherwise wins over the UA `[hidden] { display: none }`
   (author origin beats UA), leaving the lightbox permanently visible - a black
   overlay the close button cannot dismiss, because close() only sets `hidden`.
   Force-hide the closed state so it shows only while open and a theme cannot trap it. */
.polski-gallery-lightbox[hidden] {
    display: none !important;
}

.polski-gallery-lightbox img {
    max-width: min(92vw, 1200px);
    max-height: 88vh;
    border-radius: var(--polski-surface-radius-lg);
}

.polski-gallery-lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 34px;
    cursor: pointer;
}

body.polski-gallery-lightbox-open {
    overflow: hidden;
}

/* Accessibility: honour the OS "reduce motion" preference for this plugin UI. */
@media (prefers-reduced-motion: reduce) {
  [class*="polski-"],
  [class*="polski-"] *,
  [class*="polski-"] *::before,
  [class*="polski-"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
