/* Product quick view modal: reuses .product-purchase (product-purchase.css) and adapts it to a modal / mobile bottom sheet. */

/* Image zoom opened from the quick view must sit above the modal (.modal is z-index 99999 in style.css). */
.mfp-above-modal.mfp-bg { z-index: 100000; }
.mfp-above-modal.mfp-wrap { z-index: 100001; }

/* Mobile side menus must cover product image overlays (zoom button z-index 999, AI badge). */
.header_wrap .navbar-collapse.mobile_side_menu { z-index: 1045; }
@media (max-width: 991px) {
    #navCatContent { z-index: 1045; }
}

#quick-view-modal .modal-dialog { max-width: 920px; }
#quick-view-modal .modal-content { border: 0; border-radius: 20px; box-shadow: 0 24px 60px rgba(25, 16, 33, .22); overflow: hidden; position: relative; }
#quick-view-modal .modal-header { border: 0; padding: 0; position: absolute; right: 14px; top: 14px; z-index: 6; }
#quick-view-modal .modal-header .btn-close { background-color: #fff; background-size: 11px; border-radius: 50%; box-shadow: 0 3px 12px rgba(25, 16, 33, .16); height: 38px; margin: 0; opacity: 1; padding: 0; width: 38px; }
#quick-view-modal .modal-header .btn-close:focus-visible { box-shadow: 0 0 0 3px rgba(118, 73, 152, .35); }
#quick-view-modal .modal-body { max-height: calc(100vh - 3.5rem); overflow-y: auto; overscroll-behavior: contain; padding: 26px; }

.qv .qv__row { --bs-gutter-x: 28px; --bs-gutter-y: 0; }
.qv .qv__media .product-image { position: sticky; top: 0; }
.qv .qv__image { aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; position: relative; }
.qv .qv__image img { height: 100%; object-fit: cover; width: 100%; }
.qv .qv__image .product_img_zoom { align-items: center; background: rgba(255, 255, 255, .92); border-radius: 50%; bottom: 12px; box-shadow: 0 3px 12px rgba(25, 16, 33, .14); display: inline-flex; height: 40px; justify-content: center; left: auto; position: absolute; right: 12px; top: auto; width: 40px; }
.qv .qv__thumbs { margin-top: 10px; }
.qv #pr_item_gallery:not(:has(.item ~ .item)) { display: none; }
.qv .qv__thumbs .product_gallery_item img { border-radius: 8px; }

.qv .qv__purchase { margin: 0; }
.qv .qv__title { font-size: 24px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; margin: 4px 48px 8px 0; }
.qv .qv__title a { color: #211c26; }
.qv .qv__price.product_price { align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 12px; }
.qv .qv__price .price { font-size: 30px; }
.qv .qv__price .on_sale { flex-basis: auto; font-size: 12px; padding: 7px 11px; white-space: normal; }
.qv .qv__rating { margin: -4px 0 12px; }

.qv .qv__desc { font-size: 14px; line-height: 1.6; margin-bottom: 6px; max-height: 6.4em; overflow: hidden; position: relative; }
.qv .qv__desc p:first-child { font-size: 14px; }
.qv .qv__desc::after { background: linear-gradient(rgba(255, 255, 255, 0), #fff); bottom: 0; content: ''; height: 2em; left: 0; pointer-events: none; position: absolute; right: 0; }
.qv .qv__more { color: var(--color-1st, #764998); display: inline-block; font-size: 14px; font-weight: 650; margin-bottom: 18px; }
.qv .qv__more:hover { text-decoration: underline; }

.qv .qv__formats { margin-bottom: 14px; }
.qv .qv__formats .product-format-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.qv .qv__actions { margin-top: 4px; }
.qv .success-message,
.qv .error-message { font-size: 13px; margin: 0 0 8px; }

@media (min-width: 768px) {
    .qv .qv__actions .cart_btn { align-items: stretch; display: grid; gap: 8px; grid-template-columns: 120px minmax(0, 1fr) 52px; }
    .qv .qv__actions .cart-product-quantity .quantity { grid-template-columns: 38px 44px 38px; }
    .qv .qv__actions .add_wishlist { align-items: center; border: 1px solid #e4e1e7; border-radius: 11px; display: inline-flex; justify-content: center; margin: 0; }
}

/* Mobile: bottom sheet with a sticky purchase bar. */
@media (max-width: 767px) {
    #quick-view-modal .modal-dialog,
    #quick-view-modal .modal-dialog.modal-dialog-centered { align-items: flex-end; display: flex; margin: 0; max-width: none; min-height: 100%; width: 100%; }
    #quick-view-modal.fade .modal-dialog { transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
    #quick-view-modal.show .modal-dialog { transform: none; }
    #quick-view-modal .modal-content { border-radius: 22px 22px 0 0; max-height: 92vh; max-height: 92dvh; }
    #quick-view-modal .modal-content::before { background: rgba(255, 255, 255, .85); border-radius: 3px; content: ''; height: 4px; left: 50%; position: absolute; top: 8px; transform: translateX(-50%); width: 40px; z-index: 6; }
    #quick-view-modal .modal-header { right: 12px; top: 14px; }
    #quick-view-modal .modal-header .btn-close { height: 34px; width: 34px; }
    #quick-view-modal .modal-body { max-height: 92vh; max-height: 92dvh; padding: 0; }

    .qv .qv__row { --bs-gutter-x: 0; margin: 0; }
    .qv .qv__media,
    .qv .qv__content { padding: 0; }
    .qv .qv__media .product-image { position: static; }
    .qv .qv__image { aspect-ratio: auto; border-radius: 0; height: 44vh; height: 44dvh; max-height: 380px; }
    .qv .qv__thumbs { margin: 8px 16px 0; }
    .qv .qv__thumbs .product_gallery_item img { max-height: 56px; }

    .qv .qv__purchase { padding: 16px 18px 0; }
    .qv .qv__title { font-size: 20px; margin: 0 0 6px; }
    .qv .qv__price.product_price { gap: 4px 8px; margin-bottom: 10px; }
    .qv .qv__price .price { font-size: 26px; }
    .qv .qv__price del { font-size: 14px; }
    .qv .qv__price .on_sale { font-size: 12px; padding: 6px 10px; }
    .qv .qv__desc { font-size: 14px; line-height: 1.55; max-height: 4.65em; }
    .qv .qv__more { font-size: 13.5px; margin-bottom: 16px; }

    .qv .qv__formats .product-format-heading { align-items: center; flex-direction: row; gap: 10px; }
    .qv .qv__formats .product-format-heading > span:first-child { font-size: 15px; }
    .qv .qv__formats .product-format-grid { gap: 8px; }
    .qv .qv__formats .product-format-option { min-height: 54px; }

    .qv .qv__actions { background: #fff; border-top: 1px solid #efedf1; bottom: 0; box-shadow: 0 -8px 20px rgba(25, 16, 33, .06); margin: 8px -18px 0; padding: 10px 18px calc(10px + env(safe-area-inset-bottom)); position: sticky; width: auto; z-index: 4; }
    .qv .qv__actions .cart_btn { gap: 7px; grid-template-columns: 94px minmax(0, 1fr) 46px; }
    .qv .qv__actions .cart-product-quantity { width: 94px; }
    .qv .qv__actions .cart-product-quantity .quantity { grid-template-columns: 28px 38px 28px; }
    .qv .qv__actions .cart-product-quantity .quantity .minus,
    .qv .qv__actions .cart-product-quantity .quantity .plus,
    .qv .qv__actions .cart-product-quantity .quantity .qty { height: 48px; }
    .qv .qv__actions .cart_btn .btn-fill-out { font-size: 13.5px; min-height: 48px; overflow: hidden; padding-inline: 8px; text-overflow: ellipsis; }
    .qv .qv__actions .cart_btn .btn-fill-out i { margin-right: 4px; }
    .qv .qv__actions .add_wishlist { align-items: center; border: 1px solid #e4e1e7; border-radius: 11px; display: inline-flex; justify-content: center; margin: 0; min-height: 48px; }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
    #quick-view-modal.fade .modal-dialog { transition: none; }
}
