/* Scoped product and quick-view galleries; Bootstrap owns modal visibility. */
.dfc-product-gallery .product-cover {
  overflow: hidden;
  border-radius: 14px;
  touch-action: pan-y pinch-zoom;
}

.dfc-product-gallery .dfc-gallery-arrow,
#product-modal.dfc-gallery-modal .dfc-gallery-arrow,
.dfc-product-gallery .dfc-gallery-open,
#product-modal.dfc-gallery-modal .dfc-gallery-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #dce3ea;
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  color: #25384a;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(25, 42, 58, .08);
}

.dfc-product-gallery .dfc-gallery-arrow,
#product-modal.dfc-gallery-modal .dfc-gallery-arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  transform: translateY(-50%);
}

.dfc-product-gallery .dfc-gallery-previous,
#product-modal.dfc-gallery-modal .dfc-gallery-previous { left: 12px; }
.dfc-product-gallery .dfc-gallery-next,
#product-modal.dfc-gallery-modal .dfc-gallery-next { right: 12px; }

.dfc-product-gallery .dfc-gallery-open {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 12px;
}

.dfc-product-gallery .dfc-gallery-arrow:hover,
.dfc-product-gallery .dfc-gallery-open:hover,
#product-modal.dfc-gallery-modal button:hover {
  background: #edf4fa;
  border-color: #7694b2;
}

.dfc-product-gallery button:focus-visible,
.dfc-product-gallery .thumb:focus-visible,
#product-modal.dfc-gallery-modal button:focus-visible,
#product-modal.dfc-gallery-modal .thumb:focus-visible {
  outline: 3px solid #246caa;
  outline-offset: 3px;
}

body#product #main .dfc-product-gallery .dfc-gallery-thumbnails,
body .quickview .dfc-product-gallery .dfc-gallery-thumbnails,
#product-modal.dfc-gallery-modal .modal-content .dfc-gallery-thumbnails {
  position: relative;
  display: block;
  width: 100% !important;
  height: auto !important;
  max-height: none;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  max-width: 100% !important;
  overscroll-behavior-x: contain;
  margin: 0;
  padding: 5px 3px 10px;
  scrollbar-width: thin;
  scrollbar-color: #aebfce transparent;
}

body#product #main .dfc-product-gallery .dfc-gallery-thumbnails.hide_thumbnails,
body .quickview .dfc-product-gallery .dfc-gallery-thumbnails.hide_thumbnails { display: none; }

body#product #main .dfc-product-gallery ul.product-images,
body .quickview .dfc-product-gallery ul.product-images,
#product-modal.dfc-gallery-modal .modal-content ul.product-images {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content !important;
  min-width: 100%;
  margin: 0;
  padding: 0;
  top: 0 !important;
  left: 0 !important;
  transform: none !important;
  list-style: none;
}

body#product #main .dfc-product-gallery ul.product-images > li.thumb-container,
body .quickview .dfc-product-gallery ul.product-images > li.thumb-container,
#product-modal.dfc-gallery-modal .modal-content ul.product-images > li.thumb-container {
  display: block;
  flex: 0 0 76px;
  float: none;
  width: 76px;
  margin: 0;
  padding: 0;
}

body#product #main .dfc-product-gallery ul.product-images > li.thumb-container > picture > .thumb,
body .quickview .dfc-product-gallery ul.product-images > li.thumb-container > picture > .thumb,
#product-modal.dfc-gallery-modal .modal-content ul.product-images > li.thumb-container > picture > .thumb {
  display: block;
  width: 76px;
  height: 76px;
  max-width: 100%;
  object-fit: contain;
  margin: 0;
  padding: 3px;
  border: 2px solid #dce3ea;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

body#product #main .dfc-product-gallery ul.product-images > li.thumb-container > picture > .thumb.selected,
body .quickview .dfc-product-gallery ul.product-images > li.thumb-container > picture > .thumb.selected,
#product-modal.dfc-gallery-modal .modal-content ul.product-images > li.thumb-container > picture > .thumb.selected { border-color: #246caa; }

/* Native vertical strips are replaced with a directly scrollable thumbnail row. */
#product .product_left .scroll-box-arrows,
.quickview .quickview_left > .arrows,
.quickview .dfc-gallery-open { display: none; }

.quickview .dfc-product-gallery {
  display: block;
  min-width: 0;
  min-height: 0;
}

.quickview .dfc-product-gallery .product-cover,
.quickview .dfc-product-gallery .product-cover > picture {
  display: block;
  width: 100%;
}

.quickview .modal-header { height: 56px; }
.quickview .modal-header .close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  opacity: 1;
  color: #25384a;
}
.quickview .modal-header .close:focus-visible {
  outline: 3px solid #246caa;
  outline-offset: 2px;
}

#product-modal.dfc-gallery-modal {
  padding: 16px !important;
  overflow-x: hidden;
  overflow-y: auto;
}

#product-modal.dfc-gallery-modal .modal-dialog {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

#product-modal.dfc-gallery-modal .modal-content {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border: 1px solid #dce3ea;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 70px rgba(14, 31, 47, .24);
}

#product-modal.dfc-gallery-modal .dfc-gallery-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding: 12px 16px;
  border-bottom: 1px solid #e6edf3;
}

#product-modal.dfc-gallery-modal .dfc-gallery-header h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: #25384a;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 650;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

#product-modal.dfc-gallery-modal .dfc-gallery-counter {
  flex: 0 0 auto;
  color: #64768a;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#product-modal.dfc-gallery-modal .dfc-gallery-close { font-size: 30px; line-height: 1; }

#product-modal.dfc-gallery-modal .modal-content .modal-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-height: 0;
  margin: 0;
  padding: 12px 16px 6px;
  overflow-y: auto;
}

#product-modal.dfc-gallery-modal .modal-content .modal-body figure {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  touch-action: pan-y pinch-zoom;
}

#product-modal.dfc-gallery-modal .modal-content .modal-body figure > picture {
  display: block;
  width: 100%;
  min-width: 0;
}

#product-modal.dfc-gallery-modal .modal-content .modal-body img.product-cover-modal {
  display: block;
  width: 100%;
  height: min(650px, calc(100vh - 240px));
  height: min(650px, calc(100dvh - 240px));
  min-height: 120px;
  max-width: 100%;
  object-fit: contain;
  margin: 0;
  border: 0;
  background: #fff;
}

#product-modal.dfc-gallery-modal .modal-content .dfc-gallery-thumbnails { flex: 0 0 auto; }

@media (max-width: 575px) {
  .dfc-product-gallery .dfc-gallery-previous,
  #product-modal.dfc-gallery-modal .dfc-gallery-previous { left: 6px; }
  .dfc-product-gallery .dfc-gallery-next,
  #product-modal.dfc-gallery-modal .dfc-gallery-next { right: 6px; }
  .dfc-product-gallery .dfc-gallery-open { right: 8px; bottom: 8px; }
  #product-modal.dfc-gallery-modal { padding: 8px !important; }
  #product-modal.dfc-gallery-modal .modal-content {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
  }
  #product-modal.dfc-gallery-modal .dfc-gallery-header { gap: 8px; padding: 10px; }
  #product-modal.dfc-gallery-modal .dfc-gallery-header h2 { font-size: 14px; }
  #product-modal.dfc-gallery-modal .modal-content .modal-body { padding: 8px 10px 4px; }
}

@media (prefers-reduced-motion: reduce) {
  #product-modal.dfc-gallery-modal,
  #product-modal.dfc-gallery-modal .modal-dialog { transition: none; }
}


/* Product photographs share a neutral stage without cropping the actual part. */
body#product #main .dfc-product-gallery .product-cover > picture > img,
body .quickview .dfc-product-gallery .product-cover > picture > img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  object-fit: contain;
  object-position: center;
  padding: 8px;
  background: #fff;
}
.dfc-product-gallery .dfc-gallery-image-note {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  color: #475467;
  background: #f8fafc;
  font-size: .75rem;
  line-height: 1.5;
}
body .quickview .dfc-product-meta {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 8px;
  clear: both;
  margin: 0 0 12px;
}
:is(body, #product) .quickview .dfc-product-meta .product-reference,
:is(body, #product) .quickview .dfc-product-meta #product_manufacturer {
  float: none;
  width: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
body .quickview .dfc-product-summary .dfc-product-summary__more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #17578d;
  font-weight: 600;
  text-decoration: underline;
}
@media (max-width: 767px) {
  body#product #main .dfc-product-gallery .product-cover > picture > img {
    height: clamp(200px, 66vw, 260px);
    aspect-ratio: auto;
    padding: 6px;
  }
  body#product #main .dfc-product-gallery ul.product-images > li.thumb-container,
  body#product #main .dfc-product-gallery ul.product-images > li.thumb-container > picture > .thumb {
    flex-basis: 58px;
    width: 58px;
    height: 58px;
  }
}
