/* Stop the catalog from scrolling. Do not set body position:fixed:
   that makes #top.header_fixed_nav stick to the shifted body and leaves the viewport.
   scrollbar-gutter keeps the page width so the background does not jump. */
html.product-quickview-open {
	overflow: hidden !important;
	scrollbar-gutter: stable;
	overscroll-behavior: none;
}

/* Body must stay overflow:visible. overflow:hidden on body releases
   position:sticky and the filter column jumps up. The page scroll lock is on html. */
html.product-quickview-open body,
html.product-quickview-open body.modal-open {
	overflow: visible !important;
	padding-right: 0 !important;
	margin-right: 0 !important;
	position: static !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	width: auto !important;
	overscroll-behavior: none;
}

/* Popup document: vertical scroll only. A sideways bar flashes when the
   vertical scrollbar changes the width (rows, 100vw, slider arrows). */
html:has(body.is-product-popup) {
	overflow-x: clip !important;
	overflow-y: auto !important;
}

/* Stay centered for the whole open cycle, including the fade-out.
   Bootstrap drops .in before the modal is hidden; without flex the dialog jumps to the top-left. */
html.product-quickview-open .product-quickview-modal.modal {
	position: fixed !important;
	top: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	left: 0 !important;
	z-index: 100000 !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	overflow: hidden !important;
	overscroll-behavior: none;
	padding: 0 !important;
	margin: 0 !important;
	opacity: 0;
	transition: opacity 0.2s linear !important;
}

html.product-quickview-open .product-quickview-modal.modal.in,
html.product-quickview-open .product-quickview-modal.modal.show {
	opacity: 1;
}

html.product-quickview-open .modal-backdrop {
	position: fixed !important;
	top: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	left: 0 !important;
	z-index: 99999 !important;
	transition: opacity 0.2s linear;
}

.product-quickview-modal.modal.fade .product-quickview-modal__dialog,
.product-quickview-modal.modal.in .product-quickview-modal__dialog,
.product-quickview-modal.modal.show .product-quickview-modal__dialog {
	transform: none !important;
	transition: none !important;
}

.product-quickview-modal .product-quickview-modal__dialog {
	width: min(960px, calc(100vw - 3rem));
	max-width: calc(100vw - 3rem);
	height: var(--qv-dialog-max, calc(100vh - 32px));
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	margin: 0;
	display: flex;
	flex-direction: column;
	position: relative;
}

.product-quickview-modal .product-quickview-modal__content {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	border-radius: 8px;
	overflow: hidden;
}

.product-quickview-modal .product-quickview-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	flex: 0 0 auto;
	padding: 16px 16px 12px;
	border-bottom: 1px solid var(--lightgrey-color, #dbdbdb);
}

.product-quickview-modal .product-quickview-modal__header .modal-title {
	flex: 1;
	order: 1;
	margin: 0;
	min-width: 0;
	font-size: 1.1em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Same close control as the contact dialog (.login-modal__close). */
.product-quickview-modal .product-quickview-modal__header .login-modal__close {
	order: 2;
	float: none;
	opacity: 1;
	text-shadow: none;
}

.product-quickview-modal .product-quickview-modal__body {
	flex: 1 1 auto;
	min-height: 0;
	height: auto;
	padding: 0;
	overflow: hidden;
	background: #fff;
}

.product-quickview-modal .product-quickview-modal__iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	background: #fff;
	overscroll-behavior: contain;
}

/* PDP chrome hide when loaded inside the iframe (?popup=1 → body.is-product-popup) */
body.is-product-popup {
	background: #fff !important;
}

body.is-product-popup .preloader,
body.is-product-popup #spinner,
body.is-product-popup #top,
body.is-product-popup header,
body.is-product-popup #menu,
body.is-product-popup .header_video,
body.is-product-popup #header_video,
body.is-product-popup footer,
body.is-product-popup .breadcrumb,
body.is-product-popup #cart-container,
body.is-product-popup #button-cart-toggle,
body.is-product-popup #btnwhatsapp,
body.is-product-popup #whatsapp-widget-panel,
body.is-product-popup .gojiraf,
body.is-product-popup .back-to-top,
body.is-product-popup #push-notification-banner,
body.is-product-popup #customer-completion-popup {
	display: none !important;
}

body.is-product-popup #catalog-page {
	margin: 0 !important;
	padding: 0 !important;
}

body.is-product-popup #product-product {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

/* Title lives in the modal header; hide the duplicate inside the iframe. */
body.is-product-popup h1.product-title {
	display: none !important;
}

/* Short "Agregar" label must stay on one line inside the narrow popup column. */
body.is-product-popup #product-product .btn-group {
	flex-wrap: wrap;
	max-width: 100%;
}

body.is-product-popup #product-product #button-cart.btn_shopping_cart {
	flex: 0 0 auto;
	width: auto;
	max-width: 100%;
	height: auto;
	min-height: 40px;
	overflow: visible;
	white-space: nowrap;
	padding: 6px 14px;
}

/* Thumb action stack (eye + wishlist) */
.product-thumb__actions {
	position: absolute;
	top: 5px;
	right: 5px;
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}

.product-thumb__actions .btn.btn_wish_thumb {
	position: static;
	top: auto;
	right: auto;
}

.btn.btn_quickview_thumb,
.product-thumb .btn.btn_quickview_thumb,
.product-list .btn.btn_quickview_thumb {
	position: static;
	top: auto;
	left: auto;
	right: auto;
	width: auto;
	height: auto;
	border-radius: 4px !important;
	transform: none;
}

/* Compact PLP list row actions */
.plp-list__thumb-actions {
	position: absolute;
	top: 4px;
	right: 4px;
	z-index: 3;
	display: flex;
	flex-direction: row;
	gap: 2px;
}

.plp-list__actions .btn.btn_quickview_thumb {
	width: auto;
	height: auto;
}

.product-thumb--plp-list .plp-list__wish {
	position: static;
	padding: 2px 6px;
	line-height: 1;
}
