/* ============================================================
   HESHAM V11.2.8 - STABLE PRODUCT DETAIL GALLERY
   Keeps every source image inside one fixed professional stage.
   Portrait, square and landscape images never change page alignment.
   Thumbnail rail supports large galleries without growing the page.
   ============================================================ */

.pd-image-card{
  overflow:hidden;
}

.pd-gallery,
.pd-gallery.single{
  display:flex !important;
  flex-direction:column !important;
  gap:12px !important;
  min-height:0 !important;
}

.pd-gallery-main{
  order:1 !important;
  width:100% !important;
  min-width:0 !important;
}

.pd-gallery-stage{
  position:relative !important;
  width:100% !important;
  height:560px !important;
  min-height:560px !important;
  max-height:560px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:hidden !important;
  padding:18px !important;
  box-sizing:border-box !important;
  border:1px solid #e2eaf2 !important;
  border-radius:16px !important;
  background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%) !important;
}

.pd-gallery-stage #pdMainProductImage,
.pd-gallery-stage > img{
  width:100% !important;
  height:100% !important;
  max-width:100% !important;
  max-height:100% !important;
  min-width:0 !important;
  min-height:0 !important;
  object-fit:contain !important;
  object-position:center !important;
  margin:0 auto !important;
  padding:0 !important;
  display:block !important;
}

.pd-gallery-thumbs{
  order:2 !important;
  width:100% !important;
  max-width:100% !important;
  max-height:none !important;
  min-height:78px !important;
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  gap:9px !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  padding:3px 3px 8px !important;
  box-sizing:border-box !important;
  scrollbar-width:thin !important;
  scrollbar-color:#b8cee1 transparent !important;
  overscroll-behavior-x:contain !important;
  scroll-snap-type:x proximity !important;
  -webkit-overflow-scrolling:touch !important;
}

.pd-gallery-thumbs::-webkit-scrollbar{height:6px}
.pd-gallery-thumbs::-webkit-scrollbar-track{background:transparent}
.pd-gallery-thumbs::-webkit-scrollbar-thumb{background:#c4d6e6;border-radius:99px}

.pd-gallery-thumb{
  width:72px !important;
  height:72px !important;
  min-width:72px !important;
  min-height:72px !important;
  max-width:72px !important;
  max-height:72px !important;
  flex:0 0 72px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:hidden !important;
  padding:5px !important;
  box-sizing:border-box !important;
  border:1px solid #d7e3ee !important;
  border-radius:10px !important;
  background:#fff !important;
  scroll-snap-align:start !important;
}

.pd-gallery-thumb.active{
  border:2px solid #087df1 !important;
  box-shadow:0 0 0 2px rgba(8,125,241,.10) !important;
}

.pd-gallery-thumb img{
  width:100% !important;
  height:100% !important;
  max-width:100% !important;
  max-height:100% !important;
  object-fit:contain !important;
  object-position:center !important;
  display:block !important;
  margin:auto !important;
  padding:0 !important;
}

.pd-gallery-dots{
  min-height:18px !important;
  margin-top:10px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  flex-wrap:wrap !important;
  gap:6px !important;
}

.pd-gallery-dots:empty{display:none !important}

.pd-gallery-hint{
  display:block !important;
  min-height:18px !important;
  margin-top:5px !important;
  text-align:center !important;
}

@media(max-width:1180px){
  .pd-gallery-stage{
    height:500px !important;
    min-height:500px !important;
    max-height:500px !important;
  }
}

@media(max-width:900px){
  .pd-gallery-stage{
    height:460px !important;
    min-height:460px !important;
    max-height:460px !important;
    padding:14px !important;
  }
}

@media(max-width:560px){
  .pd-image-card{padding:12px 12px 16px !important}
  .pd-gallery-stage{
    height:340px !important;
    min-height:340px !important;
    max-height:340px !important;
    padding:10px !important;
    border-radius:12px !important;
  }
  .pd-gallery-thumbs{
    min-height:66px !important;
    gap:7px !important;
    padding-bottom:6px !important;
  }
  .pd-gallery-thumb{
    width:60px !important;
    height:60px !important;
    min-width:60px !important;
    min-height:60px !important;
    max-width:60px !important;
    max-height:60px !important;
    flex-basis:60px !important;
  }
  .pd-gallery-hint{
    display:block !important;
    font-size:9px !important;
  }
}

@media(max-width:390px){
  .pd-gallery-stage{
    height:300px !important;
    min-height:300px !important;
    max-height:300px !important;
  }
}
