/* YITH Quick View: Modal sizing & scroll fixes */
@media (min-width: 769px) {
  /* Force wrapper to use viewport and ignore plugin JS inline sizing */
  #yith-quick-view-modal .yith-wcqv-wrapper {
    width: min(1000px, calc(100vw - 60px)) !important;
    height: calc(100vh - 120px) !important;
    left: 50% !important;
    top: 60px !important;
    transform: translateX(-50%) !important;
  }

  /* Allow main container to scroll as a single scroll area */
  #yith-quick-view-modal.open .yith-wcqv-main {
    height: 100% !important;
    overflow: auto !important;
  }

  /* Remove restrictive max-height on summary to avoid nested scrolls */
  #yith-quick-view-content div.summary {
    max-height: none !important;
    overflow: visible !important;
  }
}

/* Remove extra nested scroll from inner product wrapper imposed by theme */
#yith-quick-view-modal #yith-quick-view-content > .product > .product {
  max-height: none !important;
  overflow: visible !important;
}

/* Images should not force full-height scrolling; let them size naturally */
#yith-quick-view-content div.images a,
#yith-quick-view-content div.images img {
  height: auto !important;
  max-height: 70vh;
}

/* Mobile: full-viewport modal with single scroll area */
@media (max-width: 768px) {
  #yith-quick-view-modal .yith-wcqv-wrapper {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    transform: none !important;
    border-radius: 0 !important;
  }

  #yith-quick-view-modal.open .yith-wcqv-main {
    height: 100vh !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  #yith-quick-view-content div.summary {
    max-height: none !important;
    overflow: visible !important;
  }
}
