/* =====================================================================
   Painel de produto via AJAX (estilo app) — abre por cima da página
   atual sem recarregar, com botão de voltar, busca (desktop) e WhatsApp.
   Usa as mesmas variáveis de cor do restante do plugin (vpf-frontend.css).
   ===================================================================== */

body.vpf-qv-lock {
	overflow: hidden;
}

.vpf-qv {
	position: fixed;
	inset: 0;
	z-index: 99999;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.vpf-qv.is-open {
	visibility: visible;
	opacity: 1;
}

.vpf-qv__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.vpf-qv__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	background: #ffffff;
	display: flex;
	flex-direction: column;
	transform: translateX(0);
	transition: transform 0.25s ease;
}

/* Mobile: painel ocupa a tela inteira, igual a um app. */
@media (max-width: 767px) {
	.vpf-qv__panel {
		transform: translateY(100%);
	}
	.vpf-qv.is-open .vpf-qv__panel {
		transform: translateY(0);
	}
}

/* Desktop/tablet: painel lateral, desliza da direita; o resto da tela
   escurece (backdrop), e a busca aparece no meio da barra superior. */
@media (min-width: 768px) {
	.vpf-qv__panel {
		width: min(760px, 94vw);
		box-shadow: -8px 0 30px rgba(0, 0, 0, 0.2);
		transform: translateX(100%);
	}
	.vpf-qv.is-open .vpf-qv__panel {
		transform: translateX(0);
	}
}

.vpf-qv__topbar {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 60px;
	padding: 0 14px;
	border-bottom: 1px solid var(--vpf-border, #e7e2df);
	background: #ffffff;
}

.vpf-qv__back {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 0;
	background: var(--vpf-icon-bg, #f4f1ef);
	color: #1a1a1a;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.vpf-qv__back:hover {
	background: #ece7e4;
}

.vpf-qv__back svg {
	width: 20px;
	height: 20px;
}

.vpf-qv__search {
	flex: 1 1 auto;
	position: relative;
	display: none;
}

/* A busca só aparece no painel a partir de telas maiores (a barra do
   mobile fica só com voltar + WhatsApp, para não ficar apertado). */
@media (min-width: 768px) {
	.vpf-qv__search {
		display: block;
	}
}

.vpf-qv__search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	color: #9a9a9a;
	pointer-events: none;
}

.vpf-qv__search-icon svg {
	width: 100%;
	height: 100%;
}

.vpf-qv__search-input {
	width: 100%;
	height: 40px;
	border-radius: 20px;
	border: 1px solid var(--vpf-border, #e7e2df);
	background: var(--vpf-icon-bg, #f4f1ef);
	padding: 0 14px 0 36px;
	font-size: 14px;
}

.vpf-qv__search-input:focus {
	outline: 2px solid var(--vpf-primary, #6d1626);
	outline-offset: 1px;
}

.vpf-qv__whats {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #25d366;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}

.vpf-qv__whats svg {
	width: 22px;
	height: 22px;
}

.vpf-qv__body {
	position: relative;
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.vpf-qv__loading {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	z-index: 2;
}

.vpf-qv__loading.is-visible {
	display: flex;
}

.vpf-qv__spinner {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 3px solid var(--vpf-border, #e7e2df);
	border-top-color: var(--vpf-primary, #6d1626);
	animation: vpf-qv-spin 0.7s linear infinite;
}

@keyframes vpf-qv-spin {
	to { transform: rotate(360deg); }
}

.vpf-qv__content.is-loading {
	opacity: 0.3;
}

/* ---------------------------------------------------------------------
   Conteúdo do produto dentro do painel.
   --------------------------------------------------------------------- */
.vpf-qv-product {
	padding: 20px 18px 40px;
}

.vpf-qv-gallery__main img {
	width: 100%;
	height: auto;
	border-radius: 10px;
	display: block;
}

.vpf-qv-gallery__thumbs {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	overflow-x: auto;
}

.vpf-qv-gallery__thumb {
	flex-shrink: 0;
	width: 56px;
	height: 56px;
	padding: 0;
	border-radius: 8px;
	border: 2px solid transparent;
	background: none;
	cursor: pointer;
	overflow: hidden;
}

.vpf-qv-gallery__thumb.is-active {
	border-color: var(--vpf-primary, #6d1626);
}

.vpf-qv-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.vpf-qv-summary {
	margin-top: 20px;
}

.vpf-qv-title {
	font-size: 22px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 6px 0 8px;
	line-height: 1.25;
}

.vpf-qv-price {
	font-size: 22px;
	font-weight: 700;
	color: var(--vpf-primary, #6d1626);
	margin-bottom: 6px;
}

.vpf-qv-cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 18px 0 6px;
}

.vpf-qv-cart .vpf-qty {
	background: var(--vpf-icon-bg, #f4f1ef);
	border-radius: 8px;
}

.vpf-qv-cart .vpf-qty__btn,
.vpf-qv-cart .vpf-qty__input {
	color: #1a1a1a;
}

.vpf-qv-cart .vpf-bar__button {
	color: #ffffff;
	background: var(--vpf-primary, #6d1626);
}

.vpf-qv-cart .vpf-bar__button:hover {
	background: var(--vpf-primary-dark, #4f0f1b);
}

.vpf-qv-cart .vpf-bar__button--buy {
	background: var(--vpf-black, #171717);
}

.vpf-qv-details {
	margin-top: 8px;
}

.vpf-qv-details .vpf-details {
	margin-top: 0;
	padding: 24px 18px;
}

.vpf-qv-related {
	margin-top: 28px;
}

.vpf-qv-related__grid {
	list-style: none;
	margin: 14px 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}

.vpf-qv-related__grid li.product a {
	display: block;
	text-decoration: none;
	color: #1a1a1a;
}

.vpf-qv-related__grid img {
	width: 100%;
	border-radius: 8px;
	display: block;
	margin-bottom: 8px;
}

.vpf-qv-related__grid .woocommerce-loop-product__title {
	display: block;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.3;
}

.vpf-qv-related__grid .price {
	display: block;
	font-size: 13px;
	color: var(--vpf-primary, #6d1626);
	font-weight: 700;
	margin-top: 2px;
}

@media (min-width: 992px) {
	.vpf-qv-product {
		padding: 28px 32px 48px;
	}

	.vpf-qv-related__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
