<turbo-stream action="update" target="mall-map-wrapper"><template><div data-controller="photo" id="mall-photos" itemscope="" itemtype="https://schema.org/ImageGallery"><div class="carousel slide carousel-fade" data-bs-interval="false" data-bs-ride="false" data-bs-touch="true" data-bs-wrap="true" id="main-slide"><div class="carousel-inner"><div class="carousel-item active"><img class="d-block w-100 photo-enlargeable cursor-pointer" alt="Sm City Marilao - Gallery Photo 1" title="Sm City Marilao - Gallery Photo 1" itemprop="image" width="1200" height="800" srcset="https://getoccupi.com/cdn-cgi/image/width=600,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13815/sm-city-marilao-is-a-major-shopping-mall-located-in-the-ibayo-district-J6NM54.jpg 600w, https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13815/sm-city-marilao-is-a-major-shopping-mall-located-in-the-ibayo-district-J6NM54.jpg 900w, https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13815/sm-city-marilao-is-a-major-shopping-mall-located-in-the-ibayo-district-J6NM54.jpg 1200w" sizes="(max-width: 768px) 100vw, 66vw" fetchpriority="high" loading="eager" decoding="auto" data-action="click-&gt;photo#enlargePhoto" data-photo-url="https://static.getoccupi.com/uploads/mall_photo/photo/13815/sm-city-marilao-is-a-major-shopping-mall-located-in-the-ibayo-district-J6NM54.jpg" src="https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13815/sm-city-marilao-is-a-major-shopping-mall-located-in-the-ibayo-district-J6NM54.jpg" /></div><div class="carousel-item"><img class="d-block w-100 photo-enlargeable cursor-pointer" alt="Sm City Marilao - Gallery Photo 2" title="Sm City Marilao - Gallery Photo 2" itemprop="image" width="1200" height="800" srcset="https://getoccupi.com/cdn-cgi/image/width=600,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13816/maxresdefault.jpg 600w, https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13816/maxresdefault.jpg 900w, https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13816/maxresdefault.jpg 1200w" sizes="(max-width: 768px) 100vw, 66vw" fetchpriority="auto" loading="lazy" decoding="async" data-action="click-&gt;photo#enlargePhoto" data-photo-url="https://static.getoccupi.com/uploads/mall_photo/photo/13816/maxresdefault.jpg" src="https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13816/maxresdefault.jpg" /></div><div class="carousel-item"><img class="d-block w-100 photo-enlargeable cursor-pointer" alt="Sm City Marilao - Gallery Photo 3" title="Sm City Marilao - Gallery Photo 3" itemprop="image" width="1200" height="800" srcset="https://getoccupi.com/cdn-cgi/image/width=600,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13817/an-image-titled-09659-sm-city-marilao-ibayo-marilao-bulacan-18-depicts-J6NM5R.jpg 600w, https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13817/an-image-titled-09659-sm-city-marilao-ibayo-marilao-bulacan-18-depicts-J6NM5R.jpg 900w, https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13817/an-image-titled-09659-sm-city-marilao-ibayo-marilao-bulacan-18-depicts-J6NM5R.jpg 1200w" sizes="(max-width: 768px) 100vw, 66vw" fetchpriority="auto" loading="lazy" decoding="async" data-action="click-&gt;photo#enlargePhoto" data-photo-url="https://static.getoccupi.com/uploads/mall_photo/photo/13817/an-image-titled-09659-sm-city-marilao-ibayo-marilao-bulacan-18-depicts-J6NM5R.jpg" src="https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13817/an-image-titled-09659-sm-city-marilao-ibayo-marilao-bulacan-18-depicts-J6NM5R.jpg" /></div><div class="carousel-item"><img class="d-block w-100 photo-enlargeable cursor-pointer" alt="Sm City Marilao - Gallery Photo 4" title="Sm City Marilao - Gallery Photo 4" itemprop="image" width="1200" height="800" srcset="https://getoccupi.com/cdn-cgi/image/width=600,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13818/09659-sm-city-marilao-ibayo-marilao-bulacan-07-J6NM56.jpg 600w, https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13818/09659-sm-city-marilao-ibayo-marilao-bulacan-07-J6NM56.jpg 900w, https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13818/09659-sm-city-marilao-ibayo-marilao-bulacan-07-J6NM56.jpg 1200w" sizes="(max-width: 768px) 100vw, 66vw" fetchpriority="auto" loading="lazy" decoding="async" data-action="click-&gt;photo#enlargePhoto" data-photo-url="https://static.getoccupi.com/uploads/mall_photo/photo/13818/09659-sm-city-marilao-ibayo-marilao-bulacan-07-J6NM56.jpg" src="https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13818/09659-sm-city-marilao-ibayo-marilao-bulacan-07-J6NM56.jpg" /></div><div class="carousel-item"><img class="d-block w-100 photo-enlargeable cursor-pointer" alt="Sm City Marilao - Gallery Photo 5" title="Sm City Marilao - Gallery Photo 5" itemprop="image" width="1200" height="800" srcset="https://getoccupi.com/cdn-cgi/image/width=600,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13819/sm-city-marilao-located-in-ibayo-marilao-bulacan-is-a-major-shopping-J6NM66.jpg 600w, https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13819/sm-city-marilao-located-in-ibayo-marilao-bulacan-is-a-major-shopping-J6NM66.jpg 900w, https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13819/sm-city-marilao-located-in-ibayo-marilao-bulacan-is-a-major-shopping-J6NM66.jpg 1200w" sizes="(max-width: 768px) 100vw, 66vw" fetchpriority="auto" loading="lazy" decoding="async" data-action="click-&gt;photo#enlargePhoto" data-photo-url="https://static.getoccupi.com/uploads/mall_photo/photo/13819/sm-city-marilao-located-in-ibayo-marilao-bulacan-is-a-major-shopping-J6NM66.jpg" src="https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13819/sm-city-marilao-located-in-ibayo-marilao-bulacan-is-a-major-shopping-J6NM66.jpg" /></div><div class="carousel-item"><img class="d-block w-100 photo-enlargeable cursor-pointer" alt="Sm City Marilao - Gallery Photo 6" title="Sm City Marilao - Gallery Photo 6" itemprop="image" width="1200" height="800" srcset="https://getoccupi.com/cdn-cgi/image/width=600,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13820/09659-sm-city-marilao-ibayo-marilao-bulacan-05-J6NM52.jpg 600w, https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13820/09659-sm-city-marilao-ibayo-marilao-bulacan-05-J6NM52.jpg 900w, https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13820/09659-sm-city-marilao-ibayo-marilao-bulacan-05-J6NM52.jpg 1200w" sizes="(max-width: 768px) 100vw, 66vw" fetchpriority="auto" loading="lazy" decoding="async" data-action="click-&gt;photo#enlargePhoto" data-photo-url="https://static.getoccupi.com/uploads/mall_photo/photo/13820/09659-sm-city-marilao-ibayo-marilao-bulacan-05-J6NM52.jpg" src="https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13820/09659-sm-city-marilao-ibayo-marilao-bulacan-05-J6NM52.jpg" /></div><div class="carousel-item"><img class="d-block w-100 photo-enlargeable cursor-pointer" alt="Sm City Marilao - Gallery Photo 7" title="Sm City Marilao - Gallery Photo 7" itemprop="image" width="1200" height="800" srcset="https://getoccupi.com/cdn-cgi/image/width=600,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13821/20221006-15.png 600w, https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13821/20221006-15.png 900w, https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13821/20221006-15.png 1200w" sizes="(max-width: 768px) 100vw, 66vw" fetchpriority="auto" loading="lazy" decoding="async" data-action="click-&gt;photo#enlargePhoto" data-photo-url="https://static.getoccupi.com/uploads/mall_photo/photo/13821/20221006-15.png" src="https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13821/20221006-15.png" /></div></div><button aria-label="Previous photo" class="carousel-control-prev" data-action="click-&gt;photo#prevSlide" type="button"><span aria-hidden="true" class="carousel-control-prev-icon"></span></button><button aria-label="Next photo" class="carousel-control-next" data-action="click-&gt;photo#nextSlide" type="button"><span aria-hidden="true" class="carousel-control-next-icon"></span></button></div><div aria-label="Photo thumbnails" class="d-flex overflow-auto gap-1 py-1" id="thumbnail-strip" role="tablist"><div aria-label="View photo 1" aria-selected="true" class="thumbnail-item border-0 p-0 flex-shrink-0 active" data-action="click-&gt;photo#goToSlide" data-slide-index="0" role="tab"><img id="mall_photo_13815" alt="Sm City Marilao - Thumbnail 1" title="Sm City Marilao - Thumbnail 1" loading="lazy" itemprop="image" class="object-fit-cover rounded" width="104" height="58" src="https://getoccupi.com/cdn-cgi/image/width=150,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13815/sm-city-marilao-is-a-major-shopping-mall-located-in-the-ibayo-district-J6NM54.jpg" /><div class="manage-controls"><a aria-label="Delete photo 1" data-turbo-method="delete" href="/malls/sm-city-marilao/mall_photos/13815"><i aria-hidden="true" class="ri-close-line"></i></a></div></div><div aria-label="View photo 2" aria-selected="false" class="thumbnail-item border-0 p-0 flex-shrink-0" data-action="click-&gt;photo#goToSlide" data-slide-index="1" role="tab"><img id="mall_photo_13816" alt="Sm City Marilao - Thumbnail 2" title="Sm City Marilao - Thumbnail 2" loading="lazy" itemprop="image" class="object-fit-cover rounded" width="104" height="58" src="https://getoccupi.com/cdn-cgi/image/width=150,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13816/maxresdefault.jpg" /><div class="manage-controls"><a aria-label="Delete photo 2" data-turbo-method="delete" href="/malls/sm-city-marilao/mall_photos/13816"><i aria-hidden="true" class="ri-close-line"></i></a></div></div><div aria-label="View photo 3" aria-selected="false" class="thumbnail-item border-0 p-0 flex-shrink-0" data-action="click-&gt;photo#goToSlide" data-slide-index="2" role="tab"><img id="mall_photo_13817" alt="Sm City Marilao - Thumbnail 3" title="Sm City Marilao - Thumbnail 3" loading="lazy" itemprop="image" class="object-fit-cover rounded" width="104" height="58" src="https://getoccupi.com/cdn-cgi/image/width=150,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13817/an-image-titled-09659-sm-city-marilao-ibayo-marilao-bulacan-18-depicts-J6NM5R.jpg" /><div class="manage-controls"><a aria-label="Delete photo 3" data-turbo-method="delete" href="/malls/sm-city-marilao/mall_photos/13817"><i aria-hidden="true" class="ri-close-line"></i></a></div></div><div aria-label="View photo 4" aria-selected="false" class="thumbnail-item border-0 p-0 flex-shrink-0" data-action="click-&gt;photo#goToSlide" data-slide-index="3" role="tab"><img id="mall_photo_13818" alt="Sm City Marilao - Thumbnail 4" title="Sm City Marilao - Thumbnail 4" loading="lazy" itemprop="image" class="object-fit-cover rounded" width="104" height="58" src="https://getoccupi.com/cdn-cgi/image/width=150,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13818/09659-sm-city-marilao-ibayo-marilao-bulacan-07-J6NM56.jpg" /><div class="manage-controls"><a aria-label="Delete photo 4" data-turbo-method="delete" href="/malls/sm-city-marilao/mall_photos/13818"><i aria-hidden="true" class="ri-close-line"></i></a></div></div><div aria-label="View photo 5" aria-selected="false" class="thumbnail-item border-0 p-0 flex-shrink-0" data-action="click-&gt;photo#goToSlide" data-slide-index="4" role="tab"><img id="mall_photo_13819" alt="Sm City Marilao - Thumbnail 5" title="Sm City Marilao - Thumbnail 5" loading="lazy" itemprop="image" class="object-fit-cover rounded" width="104" height="58" src="https://getoccupi.com/cdn-cgi/image/width=150,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13819/sm-city-marilao-located-in-ibayo-marilao-bulacan-is-a-major-shopping-J6NM66.jpg" /><div class="manage-controls"><a aria-label="Delete photo 5" data-turbo-method="delete" href="/malls/sm-city-marilao/mall_photos/13819"><i aria-hidden="true" class="ri-close-line"></i></a></div></div><div aria-label="View photo 6" aria-selected="false" class="thumbnail-item border-0 p-0 flex-shrink-0" data-action="click-&gt;photo#goToSlide" data-slide-index="5" role="tab"><img id="mall_photo_13820" alt="Sm City Marilao - Thumbnail 6" title="Sm City Marilao - Thumbnail 6" loading="lazy" itemprop="image" class="object-fit-cover rounded" width="104" height="58" src="https://getoccupi.com/cdn-cgi/image/width=150,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13820/09659-sm-city-marilao-ibayo-marilao-bulacan-05-J6NM52.jpg" /><div class="manage-controls"><a aria-label="Delete photo 6" data-turbo-method="delete" href="/malls/sm-city-marilao/mall_photos/13820"><i aria-hidden="true" class="ri-close-line"></i></a></div></div><div aria-label="View photo 7" aria-selected="false" class="thumbnail-item border-0 p-0 flex-shrink-0" data-action="click-&gt;photo#goToSlide" data-slide-index="6" role="tab"><img id="mall_photo_13821" alt="Sm City Marilao - Thumbnail 7" title="Sm City Marilao - Thumbnail 7" loading="lazy" itemprop="image" class="object-fit-cover rounded" width="104" height="58" src="https://getoccupi.com/cdn-cgi/image/width=150,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13821/20221006-15.png" /><div class="manage-controls"><a aria-label="Delete photo 7" data-turbo-method="delete" href="/malls/sm-city-marilao/mall_photos/13821"><i aria-hidden="true" class="ri-close-line"></i></a></div></div></div></div><div aria-hidden="true" aria-labelledby="mallPhotoEnlargeModalLabel" class="modal fade" id="mallPhotoEnlargeModal" tabindex="-1"><div class="modal-dialog modal-fullscreen"><div class="modal-content bg-transparent border-0 vh-100"><h1 class="visually-hidden" id="mallPhotoEnlargeModalLabel">Sm City Marilao Photo Gallery</h1><button aria-label="Close" class="btn btn-dark btn-lg position-absolute rounded-circle d-flex align-items-center justify-content-center mall-photo-modal-close" data-bs-dismiss="modal" type="button"><i class="ri-close-line fs-4"></i></button><div class="modal-body p-0 h-100 d-flex align-items-center justify-content-center"><div class="carousel slide carousel-fade" data-bs-interval="false" data-bs-ride="false" data-bs-touch="true" data-bs-wrap="true" id="mallPhotoCarousel"><div class="carousel-indicators"><button aria-current="true" aria-label="Slide 1" class="active" data-bs-slide-to="0" data-bs-target="#mallPhotoCarousel" type="button"></button><button aria-current="" aria-label="Slide 2" data-bs-slide-to="1" data-bs-target="#mallPhotoCarousel" type="button"></button><button aria-current="" aria-label="Slide 3" data-bs-slide-to="2" data-bs-target="#mallPhotoCarousel" type="button"></button><button aria-current="" aria-label="Slide 4" data-bs-slide-to="3" data-bs-target="#mallPhotoCarousel" type="button"></button><button aria-current="" aria-label="Slide 5" data-bs-slide-to="4" data-bs-target="#mallPhotoCarousel" type="button"></button><button aria-current="" aria-label="Slide 6" data-bs-slide-to="5" data-bs-target="#mallPhotoCarousel" type="button"></button><button aria-current="" aria-label="Slide 7" data-bs-slide-to="6" data-bs-target="#mallPhotoCarousel" type="button"></button></div><div class="carousel-inner vh-100"><div class="carousel-item active"><div class="vh-100 d-flex align-items-center justify-content-center"><img alt="Sm City Marilao - Gallery Photo 1" class="d-block w-100 mh-100 vh-100 object-fit-contain cursor-pointer" data-action="click-&gt;photo#enlargePhoto" decoding="async" height="800" loading="lazy" src="https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13815/sm-city-marilao-is-a-major-shopping-mall-located-in-the-ibayo-district-J6NM54.jpg" width="1200" /></div></div><div class="carousel-item"><div class="vh-100 d-flex align-items-center justify-content-center"><img alt="Sm City Marilao - Gallery Photo 2" class="d-block w-100 mh-100 vh-100 object-fit-contain cursor-pointer" data-action="click-&gt;photo#enlargePhoto" decoding="async" height="800" loading="lazy" src="https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13816/maxresdefault.jpg" width="1200" /></div></div><div class="carousel-item"><div class="vh-100 d-flex align-items-center justify-content-center"><img alt="Sm City Marilao - Gallery Photo 3" class="d-block w-100 mh-100 vh-100 object-fit-contain cursor-pointer" data-action="click-&gt;photo#enlargePhoto" decoding="async" height="800" loading="lazy" src="https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13817/an-image-titled-09659-sm-city-marilao-ibayo-marilao-bulacan-18-depicts-J6NM5R.jpg" width="1200" /></div></div><div class="carousel-item"><div class="vh-100 d-flex align-items-center justify-content-center"><img alt="Sm City Marilao - Gallery Photo 4" class="d-block w-100 mh-100 vh-100 object-fit-contain cursor-pointer" data-action="click-&gt;photo#enlargePhoto" decoding="async" height="800" loading="lazy" src="https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13818/09659-sm-city-marilao-ibayo-marilao-bulacan-07-J6NM56.jpg" width="1200" /></div></div><div class="carousel-item"><div class="vh-100 d-flex align-items-center justify-content-center"><img alt="Sm City Marilao - Gallery Photo 5" class="d-block w-100 mh-100 vh-100 object-fit-contain cursor-pointer" data-action="click-&gt;photo#enlargePhoto" decoding="async" height="800" loading="lazy" src="https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13819/sm-city-marilao-located-in-ibayo-marilao-bulacan-is-a-major-shopping-J6NM66.jpg" width="1200" /></div></div><div class="carousel-item"><div class="vh-100 d-flex align-items-center justify-content-center"><img alt="Sm City Marilao - Gallery Photo 6" class="d-block w-100 mh-100 vh-100 object-fit-contain cursor-pointer" data-action="click-&gt;photo#enlargePhoto" decoding="async" height="800" loading="lazy" src="https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13820/09659-sm-city-marilao-ibayo-marilao-bulacan-05-J6NM52.jpg" width="1200" /></div></div><div class="carousel-item"><div class="vh-100 d-flex align-items-center justify-content-center"><img alt="Sm City Marilao - Gallery Photo 7" class="d-block w-100 mh-100 vh-100 object-fit-contain cursor-pointer" data-action="click-&gt;photo#enlargePhoto" decoding="async" height="800" loading="lazy" src="https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/13821/20221006-15.png" width="1200" /></div></div></div></div><button class="carousel-control-prev" data-bs-slide="prev" data-bs-target="#mallPhotoCarousel" type="button"><span aria-hidden="true" class="carousel-control-prev-icon"></span><span class="visually-hidden">Previous</span></button><button class="carousel-control-next" data-bs-slide="next" data-bs-target="#mallPhotoCarousel" type="button"><span aria-hidden="true" class="carousel-control-next-icon"></span><span class="visually-hidden">Next</span></button></div></div></div></div><div id="mall-photo-scripts"><script>deletePhoto = function(elementID) {
  var img = document.getElementById(elementID)
  if (!img) return
  var thumb = img.closest('.thumbnail-item')
  if (!thumb) return
  var strip = document.getElementById('thumbnail-strip')
  if (!strip) return
  var thumbs = Array.from(strip.querySelectorAll('.thumbnail-item'))
  var idx = thumbs.indexOf(thumb)

  // Remove carousel item
  var items = document.querySelectorAll('#main-slide .carousel-item')
  if (items[idx]) {
    var wasActive = items[idx].classList.contains('active')
    items[idx].remove()
    if (wasActive) {
      var remaining = document.querySelectorAll('#main-slide .carousel-item')
      if (remaining.length > 0) remaining[0].classList.add('active')
    }
  }

  // Remove thumbnail
  thumb.remove()

  // Re-index thumbnail data-slide-index attributes
  document.querySelectorAll('#thumbnail-strip .thumbnail-item').forEach(function(t, i) {
    t.setAttribute('data-slide-index', i)
  })

  // Also remove from enlargement modal carousel
  var modalItems = document.querySelectorAll('#mallPhotoCarousel .carousel-item')
  if (modalItems[idx]) {
    var wasModalActive = modalItems[idx].classList.contains('active')
    modalItems[idx].remove()
    if (wasModalActive) {
      var remainingModal = document.querySelectorAll('#mallPhotoCarousel .carousel-item')
      if (remainingModal.length > 0) remainingModal[0].classList.add('active')
    }
  }

  // Re-index modal indicators
  var indicators = document.querySelectorAll('#mallPhotoCarousel .carousel-indicators button')
  if (indicators) {
    indicators.forEach(function(btn, i) {
      btn.setAttribute('data-bs-slide-to', i)
      btn.setAttribute('aria-label', 'Slide ' + (i + 1))
    })
  }
}</script></div></template></turbo-stream>