/* Saltfah Mobile Gallery Unified: ทำงานเฉพาะมือถือ + หน้าสินค้าเดี่ยวเท่านั้น */
@media (max-width: 768px) {
  body.single-product .woocommerce-product-gallery.sfmgu-ready > .woocommerce-product-gallery__wrapper,
  body.single-product .woocommerce-product-gallery.sfmgu-ready > .flex-viewport,
  body.single-product .woocommerce-product-gallery.sfmgu-ready > .flex-control-nav,
  body.single-product .woocommerce-product-gallery.sfmgu-ready > ol.flex-control-thumbs,
  body.single-product .woocommerce-product-gallery.sfmgu-ready > ul.flex-control-thumbs,
  body.single-product .woocommerce-product-gallery.sfmgu-ready > .sfcb-thumbs-slider,
  body.single-product .woocommerce-product-gallery.sfmgu-ready > .woocommerce-product-gallery__trigger,
  body.single-product .woocommerce-product-gallery.sfmgu-ready .sfmg-mobile-gallery {
    display: none !important;
  }

  body.single-product .woocommerce-product-gallery .sfmgu-mobile-gallery {
    display: block !important;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 18px;
  }

  body.single-product .sfmgu-stage {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 18px;
    background: #11131a;
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 16px 42px rgba(0,0,0,.32);
  }

  body.single-product .sfmgu-main-img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 220px;
    max-height: 430px;
    object-fit: contain !important;
    background: #fff;
    border-radius: 18px;
    opacity: 1;
    transition: opacity .12s ease;
  }

  body.single-product .sfmgu-zoom {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.94);
    color: #111;
    font-size: 19px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0,0,0,.22);
    z-index: 2;
  }

  body.single-product .sfmgu-thumbs-row {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
  }

  body.single-product .sfmgu-thumb-viewport {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  body.single-product .sfmgu-thumb-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    transition: transform .25s ease;
    will-change: transform;
  }

  body.single-product .sfmgu-thumb {
    flex: 0 0 calc((100% - 10px) / 2);
    width: calc((100% - 10px) / 2);
    padding: 0;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 12px;
    overflow: hidden;
    background: #151720;
    cursor: pointer;
    opacity: .72;
  }

  body.single-product .sfmgu-thumb.is-active {
    opacity: 1;
    border-color: #ff5847;
    box-shadow: 0 0 0 2px rgba(255,88,71,.32);
  }

  body.single-product .sfmgu-thumb img {
    display: block !important;
    width: 100% !important;
    height: 74px !important;
    object-fit: cover !important;
    border-radius: 11px !important;
    background: #fff;
  }

  body.single-product .sfmgu-arrow {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg,#ff5a4f,#e72e34);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 22px rgba(231,46,52,.32);
    cursor: pointer;
  }

  body.single-product .sfmgu-arrow:disabled {
    opacity: .35;
    cursor: not-allowed;
    box-shadow: none;
  }

  body.single-product .sfmgu-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
  }

  body.single-product .sfmgu-lightbox.is-open { display: flex; }
  body.single-product .sfmgu-lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
  }

  body.single-product .sfmgu-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 24px;
    font-weight: 900;
  }
}

@media (min-width: 769px) {
  body.single-product .sfmgu-mobile-gallery,
  body.single-product .sfmgu-lightbox {
    display: none !important;
  }
}
