/* Product photographs remain unaltered; browsing media never selects a variant. */
body#product #main.vvp-accessory-product .vvp-accessory-gallery { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
body#product #main.vvp-accessory-product .vvp-accessory-gallery--single { grid-template-columns: minmax(0, 1fr); }
body#product #main.vvp-accessory-product .vvp-accessory-gallery [hidden] { display: none !important; }
body#product #main.vvp-accessory-product .vvp-gallery-image-link { position: relative; display: block; width: 100%; height: 100%; min-height: 0; color: var(--vvp-ds-action, var(--vvp-color-action)); border-radius: 12px; cursor: zoom-in; touch-action: pan-y pinch-zoom; }
body#product #main.vvp-accessory-product .vvp-gallery-image-link :is(picture, img) { cursor: inherit; }
body#product #main.vvp-accessory-product .vvp-gallery-rail { grid-column: 1; grid-row: 2; display: flex; flex-direction: row; align-items: center; justify-content: center; align-self: center; gap: 8px; min-width: 0; width: 100%; max-height: none; }
body#product #main.vvp-accessory-product .vvp-gallery-thumbnails { display: flex; flex-direction: row; gap: 12px; width: max-content; max-width: 100%; flex: 0 1 auto; justify-content: safe center; min-height: 0; max-height: none; margin: 0; padding: 4px; overflow-y: hidden; overflow-x: auto; overscroll-behavior: contain; scrollbar-width: thin; scroll-padding: 4px; }
body#product #main.vvp-accessory-product .vvp-gallery-thumbnail { display: block; flex: 0 0 72px; width: 72px; height: 72px; padding: 4px; border: 1px solid var(--vvp-ds-line, var(--vvp-color-line)); border-radius: 11px; background: #fff; }
body#product #main.vvp-accessory-product .vvp-gallery-thumbnail[aria-current="true"] { border-color: var(--vvp-ds-action, var(--vvp-color-action)); box-shadow: inset 0 0 0 1px var(--vvp-ds-action, var(--vvp-color-action)); }
body#product #main.vvp-accessory-product .vvp-gallery-thumbnail img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 7px; mix-blend-mode: normal; filter: none; }
body#product #main.vvp-accessory-product .vvp-gallery-thumbnail:hover { border-color: var(--vvp-ds-action, var(--vvp-color-action)); }
body#product #main.vvp-accessory-product .vvp-accessory-gallery--single :is(.vvp-gallery-status, .vvp-gallery-variant-notice:empty) { display: none; }
body#product #main.vvp-accessory-product .vvp-gallery-arrow { position: absolute; top: calc(var(--vvp-gallery-height) / 2 - 20px); z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--vvp-ds-line, var(--vvp-color-line)); border-radius: 50%; background: #fff; color: var(--vvp-ds-action, var(--vvp-color-action)); }
body#product #main.vvp-accessory-product .vvp-gallery-arrow--previous { left: 0; }
body#product #main.vvp-accessory-product .vvp-gallery-arrow--next { right: 0; }
body#product #main.vvp-accessory-product .vvp-thumbnails-arrow { flex: 0 0 32px; display: grid; place-items: center; width: 44px; height: 32px; padding: 0; border: 0; border-radius: 10px; background: var(--vvp-color-subtle); color: var(--vvp-color-action); }
body#product #main.vvp-accessory-product .vvp-thumbnails-arrow svg { transform: rotate(-90deg); }
body#product #main.vvp-accessory-product .vvp-thumbnails-arrow:disabled { opacity: .35; cursor: default; }

/* Keep image context for screen readers without a visible caption or reserved row. */
body#product #main.vvp-accessory-product .vvp-gallery-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* The dialog isolates image gestures from page scrolling and purchasing controls. */
body#product #main.vvp-accessory-product .vvp-accessory-lightbox { width: min(1200px, 96vw); height: min(900px, 92dvh); max-width: 96vw; max-height: 92dvh; margin: auto; padding: 20px; border: 0; border-radius: 24px; overflow: hidden; background: #fff; color: var(--vvp-color-action); }
body#product #main.vvp-accessory-product .vvp-accessory-lightbox[open] { display: flex; flex-direction: column; gap: 12px; }
body#product #main.vvp-accessory-product .vvp-accessory-lightbox::backdrop { background: rgba(20, 28, 42, .65); }
body#product #main.vvp-accessory-product .vvp-accessory-lightbox-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
body#product #main.vvp-accessory-product .vvp-accessory-lightbox-toolbar button { min-width: 44px; min-height: 44px; margin: 0; padding: 10px 14px; border: 0; border-radius: 12px; background: var(--vvp-color-subtle); color: inherit; font-size: 13px; line-height: 20px; }
body#product #main.vvp-accessory-product .vvp-accessory-lightbox-close { order: 5; margin-left: 12px !important; }
body#product #main.vvp-accessory-product .vvp-accessory-lightbox-stage { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; flex: 1; min-height: 0; gap: 8px; }
body#product #main.vvp-accessory-product :is(.vvp-accessory-lightbox-previous, .vvp-accessory-lightbox-next) { align-self: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--vvp-color-line); border-radius: 50%; background: #fff; color: inherit; font-size: 24px; }
body#product #main.vvp-accessory-product .vvp-accessory-lightbox-viewer { position: relative; min-width: 0; min-height: 0; overflow: hidden; touch-action: none; user-select: none; cursor: zoom-in; background: #fff; border-radius: 8px; }
body#product #main.vvp-accessory-product .vvp-accessory-lightbox-viewer.is-zoomed { cursor: grab; }
body#product #main.vvp-accessory-product .vvp-accessory-lightbox-viewer.is-zoomed:active { cursor: grabbing; }
body#product #main.vvp-accessory-product .vvp-accessory-lightbox-image { position: absolute; left: 50%; top: 50%; max-width: none; max-height: none; object-fit: contain; pointer-events: none; transform-origin: center; mix-blend-mode: normal; filter: none; }
body#product #main.vvp-accessory-product .vvp-accessory-lightbox-status { min-height: 20px; flex-shrink: 0; margin: 0; text-align: center; color: var(--vvp-color-text-secondary); font-size: 13px; line-height: 20px; }
body#product #main.vvp-accessory-product .vvp-accessory-lightbox button:disabled { opacity: .35; cursor: default; }
body#product #main.vvp-accessory-product .vvp-accessory-lightbox [hidden] { visibility: hidden; display: block !important; }
body#product #main.vvp-accessory-product :is(.vvp-gallery-arrow, .vvp-thumbnails-arrow, .vvp-accessory-lightbox button):hover:not(:disabled) { background: var(--vvp-color-subtle); }

@media (max-width: 767.98px) {
  body#product #main.vvp-accessory-product .vvp-accessory-gallery { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
  body#product #main.vvp-accessory-product .vvp-accessory-gallery--single { grid-template-columns: minmax(0, 1fr); }
  body#product #main.vvp-accessory-product .vvp-accessory-gallery .product-cover { padding: 6px 8px; }
  body#product #main.vvp-accessory-product .vvp-gallery-rail { grid-column: 1; grid-row: 2; flex-direction: row; width: 100%; max-height: none; gap: 6px; margin: 0; }
  body#product #main.vvp-accessory-product .vvp-gallery-thumbnails { flex-direction: row; width: max-content; max-width: 100%; max-height: none; gap: 10px; padding: 3px; overflow-x: auto; overflow-y: hidden; }
  body#product #main.vvp-accessory-product .vvp-gallery-thumbnail { flex: 0 0 50px; width: 50px; height: 50px; border-radius: 10px; }
  body#product #main.vvp-accessory-product .vvp-thumbnails-arrow { flex: 0 0 30px; width: 44px; height: 30px; }
  body#product #main.vvp-accessory-product .vvp-thumbnails-arrow svg { transform: rotate(-90deg); }
  body#product #main.vvp-accessory-product .vvp-gallery-arrow { width: 36px; height: 36px; top: calc(var(--vvp-gallery-height) / 2 - 18px); }
  body#product #main.vvp-accessory-product .vvp-gallery-arrow--next { right: 0; }
  body#product #main.vvp-accessory-product .vvp-accessory-lightbox { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; padding: max(12px, env(safe-area-inset-top)) 8px max(12px, env(safe-area-inset-bottom)); border-radius: 0; }
  body#product #main.vvp-accessory-product .vvp-accessory-lightbox-toolbar { gap: 4px; }
  body#product #main.vvp-accessory-product .vvp-accessory-lightbox-toolbar button { padding: 8px; font-size: 12px; }
  body#product #main.vvp-accessory-product .vvp-accessory-lightbox-close { margin-left: auto !important; }
  body#product #main.vvp-accessory-product .vvp-accessory-lightbox-stage { grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 2px; }
  body#product #main.vvp-accessory-product :is(.vvp-accessory-lightbox-previous, .vvp-accessory-lightbox-next) { width: 36px; height: 44px; border-radius: 12px; }
}

@media (min-width: 992px) {
  body#product #main.vvp-accessory-product .vvp-accessory-gallery .vvp-gallery-arrow { opacity: 0; pointer-events: none; transition: opacity .15s; }
  body#product #main.vvp-accessory-product .vvp-accessory-gallery:is(:hover, :focus-within) .vvp-gallery-arrow { opacity: 1; pointer-events: auto; }
}

/* The photograph owns its frame; the remaining column shows the hero.
   Keep the native thumbnail rail width and its controls unchanged. */
body#product #main.vvp-accessory-product .product-col-media.vvp-page-hero-surface,
body#product #main.vvp-accessory-product .product-col-media > #content.vvp-accessory-figure { background: transparent; }
body#product #main.vvp-accessory-product .vvp-accessory-gallery .product-cover {
  grid-template-columns: minmax(0, 1fr);
  width: min(100%, var(--vvp-gallery-height));
  height: auto;
  margin-inline: auto;
  padding: 0;
  background: transparent;
}
body#product #main.vvp-accessory-product .vvp-gallery-image-link,
body#product #main.vvp-accessory-product .product-cover picture { height: auto; }
body#product #main.vvp-accessory-product .product-cover img { height: auto; max-height: none; aspect-ratio: auto 1; }
body#product #main.vvp-accessory-product .vvp-gallery-arrow--previous { left: max(0px, calc((100% - var(--vvp-gallery-height)) / 2)); }
body#product #main.vvp-accessory-product .vvp-gallery-arrow--next { right: max(0px, calc((100% - var(--vvp-gallery-height)) / 2)); }

/* The bottom-aligned desktop gallery keeps the same breathing room as the
   product panels. The inset is reserved in the grid before images load. */
@media (min-width: 992px) {
  body#product #main.vvp-accessory-product .product-col-media { padding-top: var(--vvp-accessory-panel-padding); }
}

/* Le badge et les flèches suivent le même bord de la photo centrée. */
body#product #main.vvp-accessory-product .vvp-accessory-figure:has(> .vvp-accessory-gallery) > .product-flags {
  left: calc(1rem + max(0px, (100% - var(--vvp-gallery-height)) / 2));
}

/* La photo agrandie garde ses propres gestes de zoom et de déplacement. */
html:has(body#product dialog.vvp-accessory-lightbox[open]) {
  overflow: hidden;
  scrollbar-gutter: stable;
}

body#product .vvp-accessory-lightbox .vvp-accessory-lightbox-close[data-vvp-pointer-focus]:focus {
  outline: none !important;
  box-shadow: none !important;
}
