/* The Noël gallery adapted to the full Magento product media collection. */
#gallery.lgb-gallery {
    --lgb-gallery-paper: #fdfbf7;
    --lgb-gallery-line: #e1dbd0;
    --lgb-gallery-wine: #642d3e;
    --lgb-gallery-ink: #302b27;
    --lgb-gallery-muted: #766f66;
    min-width: 0;
    align-self: flex-start;
    color: var(--lgb-gallery-ink);
}
#gallery.lgb-gallery [hidden] { display: none !important; }
#gallery.lgb-gallery:not(.is-ready) .lgb-gallery-arrows,
#gallery.lgb-gallery:not(.is-ready) .lgb-gallery-expand,
#gallery.lgb-gallery:not(.is-ready) .lgb-gallery-thumbnails { display: none; }
#gallery.lgb-gallery button { font-family: Arial, sans-serif; }
#gallery .lgb-gallery-stage {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--lgb-gallery-line);
    border-radius: 9px;
    background: #eee7da;
    isolation: isolate;
}
#gallery .lgb-gallery-track {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1.25;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    direction: ltr;
}
#gallery .lgb-gallery-track::-webkit-scrollbar,
#gallery .lgb-gallery-thumbnails::-webkit-scrollbar { display: none; }
#gallery .lgb-gallery-slide {
    position: relative;
    display: flex;
    flex: 0 0 100%;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}
#gallery .lgb-gallery-open {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: zoom-in;
    touch-action: auto;
}
#gallery .lgb-gallery-open:hover { opacity: 1; }
#gallery .lgb-gallery-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    object-fit: contain;
    object-position: center;
}
#gallery .lgb-gallery-arrows {
    position: absolute;
    inset: calc(50% - 22px) 7px auto;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}
#gallery .lgb-gallery-arrow,
#gallery .lgb-gallery-expand,
#gallery .lgb-gallery-close {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid #d4c7b8;
    border-radius: 50%;
    background: rgba(253, 251, 247, .96);
    box-shadow: none;
    color: var(--lgb-gallery-wine);
    cursor: pointer;
    pointer-events: auto;
}
#gallery .lgb-gallery-arrow svg,
#gallery .lgb-gallery-expand svg,
#gallery .lgb-gallery-close svg { width: 21px; height: 21px; }
#gallery .lgb-gallery-arrow:disabled { visibility: hidden; }
#gallery .lgb-gallery-expand { position: absolute; inset: 10px 10px auto auto; z-index: 2; }
#gallery .lgb-gallery-counter {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 4px 10px;
    border: 1px solid var(--lgb-gallery-line);
    border-radius: 20px;
    background: var(--lgb-gallery-paper);
    color: var(--lgb-gallery-wine);
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}
#gallery .lgb-gallery-label {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    max-width: calc(100% - 80px);
    padding: 6px 10px;
    border-radius: 4px;
    background: var(--lgb-gallery-label-color, var(--lgb-gallery-paper));
    color: var(--lgb-gallery-label-ink, #302b27);
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
    pointer-events: none;
}
#gallery .lgb-gallery-thumbnails {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding: 3px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}
#gallery .lgb-gallery-thumb {
    display: flex;
    flex: 0 0 76px;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 76px;
    padding: 3px;
    border: 1px solid var(--lgb-gallery-line);
    border-radius: 6px;
    background: transparent;
    color: var(--lgb-gallery-muted);
    text-align: center;
    cursor: pointer;
    scroll-snap-align: start;
}
#gallery .lgb-gallery-thumb img {
    flex: 0 0 auto;
    width: 100%;
    height: 100%;
    border-radius: 3px;
    object-fit: cover;
}
#gallery .lgb-gallery-thumb span { display: none; }
#gallery .lgb-gallery-thumb[aria-pressed="true"] {
    border-color: var(--lgb-gallery-wine);
    background: var(--lgb-gallery-paper);
    color: var(--lgb-gallery-wine);
}
#gallery .lgb-gallery-thumb.is-pending { border-color: #a57b84; }
#gallery.lgb-gallery button:focus-visible,
#gallery.lgb-gallery a:focus-visible,
#gallery .lgb-gallery-track:focus-visible {
    outline: 2px solid var(--lgb-gallery-wine);
    outline-offset: 2px;
}
#gallery .lgb-gallery-open:focus-visible { outline-offset: -4px; }
#gallery .lgb-gallery-video-play {
    position: relative;
    cursor: pointer;
}
#gallery .lgb-gallery-play-icon {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    padding: 16px;
    border: 0;
    border-radius: 50%;
    background: var(--lgb-gallery-wine);
    color: #fff;
    pointer-events: none;
}
#gallery .lgb-gallery-video-play svg { width: 20px; height: 20px; flex-shrink: 0; }
#gallery .lgb-gallery-video-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
#gallery .lgb-gallery-dialog {
    width: min(1180px, calc(100% - 32px));
    height: min(1000px, calc(100dvh - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 18px;
    border: 0;
    border-radius: 12px;
    background: var(--lgb-gallery-paper);
    color: var(--lgb-gallery-ink);
    overflow: auto;
}
#gallery .lgb-gallery-dialog[open] { display: flex; flex-direction: column; }
#gallery .lgb-gallery-dialog:modal { overscroll-behavior: contain; }
#gallery .lgb-gallery-dialog::backdrop { background: #302b27d9; overflow: hidden; overscroll-behavior: contain; }
#gallery .lgb-gallery-dialog-header { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
#gallery .lgb-gallery-dialog-title { margin: 0; font-family: inherit; font-size: 19px; line-height: 1.4; font-weight: 400; }
#gallery .lgb-gallery-dialog-stage { position: relative; flex: 1; min-height: 0; background: #eee7da; overflow: hidden; border-radius: 6px; }
#gallery .lgb-gallery-dialog .lgb-gallery-track { height: 100%; aspect-ratio: auto; }
#gallery .lgb-gallery-dialog .lgb-gallery-thumbnails { flex-shrink: 0; }
#gallery .lgb-gallery-dialog .lgb-gallery-open { cursor: default; }

@media (min-width: 768px) {
    #gallery .lgb-gallery-stage { border-radius: 12px; }
    #gallery .lgb-gallery-track { aspect-ratio: 1.1; }
    #gallery .lgb-gallery-arrows { left: 12px; right: 12px; }
    #gallery .lgb-gallery-thumbnails { gap: 8px; margin-top: 10px; }
    #gallery .lgb-gallery-thumb { flex-basis: 96px; height: 96px; }
}
@media (max-width: 767px) {
    #gallery .lgb-gallery-dialog { width: 100%; max-height: 100dvh; height: 100dvh; padding: 12px max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); border-radius: 0; }
    #gallery .lgb-gallery-dialog-header { flex-shrink: 0; }
    #gallery .lgb-gallery-dialog-title { font-size: 16px; }
    #gallery .lgb-gallery-dialog-stage { flex: 1; }
    #gallery .lgb-gallery-dialog .lgb-gallery-track { height: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    #gallery .lgb-gallery-track,
    #gallery .lgb-gallery-thumbnails { scroll-behavior: auto; }
}
