<turbo-stream action="append" target="modal_portal"><template><div class="modal fade show d-block" tabindex="-1" role="dialog" style="background: rgba(0,0,0,0.5);" 
     data-controller="modal" data-action="click->modal#backdropClose">
  <div class="modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable" role="document">
    <div class="modal-content border-0 shadow-lg" style="border-radius: 1px;">
      <div class="modal-body p-0">
        <button type="button" class="close position-absolute p-3 text-dark" style="top: 0; right: 0; z-index: 10;" data-action="click->modal#close">
          <span aria-hidden="true">&times;</span>
        </button>
        
        <div class="row no-gutters">
          <!-- Gallery (Images + Video) -->
          <div class="col-md-6 bg-light d-flex flex-column" data-controller="gallery" style="background-color: #f8f9fa;">
             
             <!-- Main Viewer (Splide) -->
             <div class="gallery-viewer position-relative w-100 flex-grow-1 quick-view-gallery-viewer splide" 
                  data-gallery-target="track"
                  style="aspect-ratio: 3/4;">
                 <!-- Track -->
                 <div class="splide__track w-100 h-100">
                     <ul class="splide__list h-100">
                         <!-- Slide 0: Featured Image -->
                         <li class="splide__slide h-100 d-flex align-items-center justify-content-center" data-gallery-target="slide">
                             <img class="img-fluid h-100" style="object-fit: contain;" src="/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6IjQ1ZGQ0ODZhLTE3YmYtNDU3YS1hYmFmLWUwODEwM2M0ZDA5MSIsInB1ciI6ImJsb2JfaWQifX0=--f9dded5cd808babb2229fd81dae19512f64b38c9/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJqcGciLCJyZXNpemVfdG9fbGltaXQiOls4MDAsMTAwMF19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--5a69deef678850a5651fcbed19e7aa45ce79dcca/DSC_1109.jpg" />
                         </li>
        
                         <!-- Slide 1: Video (If Attached) -->
        
                         <!-- Slides 2..N: Additional Images -->
                     </ul>
                 </div>
             </div>

             <!-- Thumbnails -->
             <div class="gallery-thumbs d-flex justify-content-center p-3 bg-white border-top" style="gap: 10px; overflow-x: auto;">
                 <!-- Thumb 0 -->
                 <div class="cursor-pointer border border-transparent p-1 active border-dark" 
                      data-gallery-target="thumb" 
                      data-action="click->gallery#goToSlide" 
                      data-index="0"
                      style="width: 60px; height: 80px; transition: border 0.3s;">
                      <img class="w-100 h-100" style="object-fit: cover;" src="/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6IjQ1ZGQ0ODZhLTE3YmYtNDU3YS1hYmFmLWUwODEwM2M0ZDA5MSIsInB1ciI6ImJsb2JfaWQifX0=--f9dded5cd808babb2229fd81dae19512f64b38c9/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJqcGciLCJyZXNpemVfdG9fbGltaXQiOlsxMDAsMTMzXX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--9012fd3ae6f9bb19755f8c28f9af2da8d9e095d1/DSC_1109.jpg" />
                 </div>

                 <!-- Thumb 1: Video (If Attached) -->

                 <!-- Thumbs 2..N: Additional Images -->

             </div>
          </div>
          
          <!-- Details (The Dossier) -->
          <div class="col-md-6 p-4 p-lg-5 d-flex flex-column quick-view-dossier-container">
             <div class="mb-2 d-flex justify-content-between align-items-center">
                 <span class="badge badge-dark text-uppercase tracking-wider px-2 py-1">IN STOCK</span>
                 <span class="text-muted small">Style #SCB23-MS-147</span>
             </div>
             
             <h2 class="text-serif font-weight-bold mb-1">SCB23-MS-147</h2>
             

             <!-- Spec Sheet -->
             <div class="specs mb-4 bg-light-texture p-3 border-left-gold">
                <h6 class="text-uppercase small tracking-wider font-weight-bold mb-3 border-bottom pb-1">Specifications</h6>
                <div class="row small text-muted">
                    <div class="col-6 mb-2">
                        <strong>Silhouette:</strong><br> A-line
                    </div>
                    
                    <div class="col-6 mb-2">
                        <strong>Neckline:</strong><br> Rounded
                    </div>

                    <div class="col-6 mb-2">
                        <strong>Fabric:</strong><br> Lace
                    </div>

                    <div class="col-6 mb-2">
                         <strong>Colors:</strong><br> 
                         <div class="d-flex flex-wrap mt-1">
                                <span class="badge badge-light border mr-1 mb-1" style="font-weight: normal;">White</span>
                                <span class="badge badge-light border mr-1 mb-1" style="font-weight: normal;">Pink</span>
                                <span class="badge badge-light border mr-1 mb-1" style="font-weight: normal;">Silver</span>
                         </div>
                    </div>
                </div>
             </div>
             
             <!-- Availability Logic (Shared) -->
                            <!-- Availability Logic -->
               
               <!-- 1. LIVE STOCK MATRIX (Only if items exist physically) -->

               <!-- 2. SPECIAL ORDER PROMO (Or Discontinued Warning) -->
               <!-- 2. SPECIAL ORDER PROMO (Or Discontinued Warning) -->
                   <div class="special-order mb-4 p-3 bg-light">
                       <h6 class="text-uppercase small tracking-wider font-weight-bold mb-1 text-muted">
                          <i class="fas fa-shipping-fast mr-1"></i> Special Order Available
                       </h6>
                       <p class="small text-muted mb-0">
                              Need a different size or color? We can order it for you.
                       </p>
                   </div>

             
             <!-- Stacked Full Width Buttons -->
             <div class="actions mt-auto">
                 <a class="btn btn-dark btn-block btn-lg text-uppercase tracking-wider mb-3 shadow-sm" href="/appointments/book?product_id=b146109b-163f-4db9-9b1a-484f9968d59b">
                    Book Try-On
</a>                 
                 
                 <a class="btn btn-outline-dark btn-block text-uppercase tracking-wider" data-turbo="false" href="/product/scb23-ms-147">View Full Details</a>
             </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

</template></turbo-stream>