/* Clasico Next HOTFIX13 — isolated PRODUCT DETAIL photo lightbox layout.
   Desktop: maximum-height centered picture + vertical auto-scroll thumbnails.
   Portrait tablet and mobile: preserve lower horizontal thumbnail strip.
   No changes to catalog quick-view, product miniatures or store header. */
@media (min-width:1024px) and (min-height:520px) {
  body #product-modal.cn12-gallery-modal .modal-dialog {
    width:min(1360px,calc(100vw - 32px))!important;
    max-width:min(1360px,calc(100vw - 32px))!important;
    height:calc(100vh - 28px)!important;
    height:calc(100dvh - 28px)!important;
    max-height:calc(100dvh - 28px)!important;
    margin:14px auto!important;
    display:flex!important;
  }
  body #product-modal.cn12-gallery-modal .modal-content {
    display:flex!important;
    flex-direction:column!important;
    flex:1 1 auto!important;
    width:100%!important;
    height:100%!important;
    max-height:100%!important;
  }
  body #product-modal.cn12-gallery-modal .modal-body {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 108px!important;
    grid-template-rows:minmax(0,1fr)!important;
    align-items:stretch!important;
    gap:14px!important;
    flex:1 1 auto!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    padding:53px 18px 18px!important;
    overflow:hidden!important;
  }
  body #product-modal.cn12-gallery-modal .modal-body figure {
    grid-column:1!important;
    grid-row:1!important;
    flex:none!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-width:0!important;
    min-height:0!important;
    height:100%!important;
    max-height:100%!important;
    width:100%!important;
    overflow:hidden!important;
  }
  body #product-modal.cn12-gallery-modal .js-modal-product-cover {
    display:block!important;
    width:100%!important;
    height:100%!important;
    max-width:100%!important;
    max-height:100%!important;
    margin:auto!important;
    object-fit:contain!important;
  }
  body #product-modal.cn12-gallery-modal #thumbnails {
    grid-column:2!important;
    grid-row:1!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    flex:none!important;
    width:108px!important;
    max-width:108px!important;
    min-height:0!important;
    height:100%!important;
    max-height:100%!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  body #product-modal.cn12-gallery-modal .js-modal-mask {
    flex:1 1 auto!important;
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-height:0!important;
    max-height:none!important;
    height:100%!important;
    padding:1px!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-width:thin!important;
    scrollbar-color:#bbcfec transparent!important;
  }
  body #product-modal.cn12-gallery-modal .js-modal-product-images {
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:flex-start!important;
    flex-wrap:nowrap!important;
    gap:9px!important;
    width:100%!important;
    min-width:0!important;
    min-height:100%!important;
    height:auto!important;
    max-height:none!important;
    padding:3px 2px!important;
    margin:0!important;
    box-sizing:border-box!important;
    white-space:normal!important;
    list-style:none!important;
  }
  body #product-modal.cn12-gallery-modal .thumb-container {
    display:block!important;
    flex:0 0 88px!important;
    width:88px!important;
    height:88px!important;
    max-width:88px!important;
    max-height:88px!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  body #product-modal.cn12-gallery-modal .thumb-container .thumb {
    width:100%!important;
    height:100%!important;
    max-height:100%!important;
    object-fit:contain!important;
  }
}
/* Portrait tablets and phones: thumbnails below the main photo, horizontally scrollable.
   The earlier HOTFIX12 layout remains the baseline and needs no duplicated rules. */
@media (max-width:1023px), (max-height:519px) {
  body #product-modal.cn12-gallery-modal .modal-body {
    display:flex!important;
    flex-direction:column!important;
  }
  body #product-modal.cn12-gallery-modal .js-modal-product-images {
    flex-direction:row!important;
    flex-wrap:nowrap!important;
  }
}
