/* ============================================================
 * Enspire Product Loop Widget — Styles
 * ============================================================ */

/* ----- Grid ----- */
.enspire-product-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	column-gap: 20px;
	row-gap: 32px;
	grid-auto-rows: min-content;
	align-items: start;
	padding-bottom: 20px;
}

/* ----- Item ----- */
.enspire-product-item {
	position: relative;
	height: 100%;
}

/* ----- Image wrap (padding-bottom aspect ratio trick) ----- */
.enspire-product-image-wrap {
	position: relative;
	width: 100%;
	height: 0;
	padding-bottom: 100%;
	overflow: hidden;
	background-color: #f5f5f5;
}

.enspire-product-image-link {
	position: absolute;
	inset: 0;
	display: block;
}

/* ----- Images ----- */
.enspire-product-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.45s ease;
}

.enspire-product-img-main {
	opacity: 1;
	z-index: 1;
}

.enspire-product-img-hover {
	opacity: 0;
	z-index: 2;
}

.has-hover-image:hover .enspire-product-img-main {
	opacity: 0;
}

.has-hover-image:hover .enspire-product-img-hover {
	opacity: 1;
}

/* ----- Category badge ----- */
.enspire-product-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 10;
	background-color: #1a1a1a;
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1;
	padding: 4px 10px;
	pointer-events: none;
}

/* ----- Overlay ----- */
.enspire-product-overlay {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: flex-end;
	background-color: rgba(0, 0, 0, 0.12);
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.enspire-product-item:hover .enspire-product-overlay {
	opacity: 1;
}

/* Botoes capturam cliques; resto do overlay deixa passar para o link da imagem */
.enspire-btn-quick-view,
.enspire-btn-add-to-cart {
	pointer-events: auto;
}

/* ----- Quick View button (top-right of overlay) ----- */
.enspire-btn-quick-view {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 6;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #ffffff;
	color: #1a1a1a;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	transform: scale(0.75);
	opacity: 0;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.3s ease, opacity 0.3s ease;
}

.enspire-btn-quick-view svg {
	width: 15px;
	height: 15px;
	display: block;
	flex-shrink: 0;
	pointer-events: none;
}

.enspire-product-item:hover .enspire-btn-quick-view {
	transform: scale(1);
	opacity: 1;
}

.enspire-btn-quick-view:hover {
	background-color: #1a1a1a;
	color: #ffffff;
}

.enspire-btn-quick-view:focus-visible {
	outline: 2px solid #1a1a1a;
	outline-offset: 2px;
}

/* ----- Add to Cart button (bottom slide-up) ----- */
.enspire-btn-add-to-cart {
	display: block;
	width: 100%;
	padding: 11px 16px;
	background-color: #1a1a1a;
	color: #ffffff;
	text-align: center;
	text-decoration: none;
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border: none;
	cursor: pointer;
	line-height: 1.4;
	transform: translateY(100%);
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.35s ease;
	white-space: nowrap;
}

.enspire-product-item:hover .enspire-btn-add-to-cart {
	transform: translateY(0);
}

.enspire-btn-add-to-cart:hover,
.enspire-btn-add-to-cart:focus {
	background-color: #333333;
	color: #ffffff;
	text-decoration: none;
}

.enspire-btn-add-to-cart.loading::after {
	content: '';
	display: inline-block;
	width: 10px;
	height: 10px;
	border: 2px solid rgba(255,255,255,0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: enspire-btn-spin 0.6s linear infinite;
	margin-left: 8px;
	vertical-align: middle;
}

.enspire-btn-add-to-cart.added {
	background-color: #4caf50 !important;
}

@keyframes enspire-btn-spin {
	to { transform: rotate(360deg); }
}

/* ----- Product info ----- */
.enspire-product-info {
	padding: 10px 0;
}

.enspire-product-title {
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
}

.enspire-product-title a {
	color: inherit;
	text-decoration: none;
}

.enspire-product-title a:hover {
	text-decoration: none;
}

.enspire-product-price {
	font-size: 14px;
	color: #333;
	line-height: 1.3;
}

.enspire-product-price del {
	opacity: 0.55;
	margin-right: 4px;
}

.enspire-wc-notice {
	padding: 12px 16px;
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	font-size: 13px;
}

/* ============================================================
 * Quick View Modal
 * ============================================================ */

.enspire-qv-modal {
	position: fixed;
	inset: 0;
	z-index: 999990;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.enspire-qv-overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.5);
	cursor: pointer;
}

.enspire-qv-container {
	position: relative;
	background: #ffffff;
	width: 100%;
	max-width: 860px;
	max-height: 90vh;
	display: flex;
	flex-direction: row;
	z-index: 1;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

/* Close button */
.enspire-qv-close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 10;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,0.9);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	padding: 0;
	color: #1a1a1a;
	transition: background-color 0.2s, transform 0.2s;
}

.enspire-qv-close:hover {
	background: #1a1a1a;
	color: #fff;
	transform: scale(1.05);
}

.enspire-qv-close:focus-visible {
	outline: 2px solid #1a1a1a;
	outline-offset: 2px;
}

/* Image column */
.enspire-qv-image-col {
	flex: 0 0 50%;
	position: relative;
	background-color: #f5f5f5;
	min-height: 320px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.enspire-qv-loading {
	display: flex;
	align-items: center;
	justify-content: center;
}

.enspire-qv-loading svg {
	animation: enspire-spin 0.8s linear infinite;
}

@keyframes enspire-spin {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}

.enspire-qv-image {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

/* Info column */
.enspire-qv-info-col {
	flex: 0 0 50%;
	padding: 44px 40px;
	display: flex;
	flex-direction: column;
	justify-content: flex-start; /* Controlled by Elementor */
	gap: 16px;
	overflow-y: auto;
}

.enspire-qv-title {
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
	margin: 0;
	padding-right: 24px;
	color: #1a1a1a;
}

.enspire-qv-price {
	font-size: 18px;
	font-weight: 500;
	color: #1a1a1a;
	line-height: 1.3;
}

.enspire-qv-price .woocommerce-Price-amount {
	font-size: inherit;
	color: inherit;
}

.enspire-qv-price del {
	opacity: 0.45;
	font-size: 14px;
	margin-right: 4px;
}

.enspire-qv-description {
	font-size: 13px;
	color: #666;
	line-height: 1.65;
}

.enspire-qv-description p {
	margin: 0;
}

/* Actions row */
.enspire-qv-actions {
	display: flex;
	gap: 10px;
	align-items: stretch;
	flex-wrap: wrap;
}

/* Quantity control */
.enspire-qv-qty {
	display: flex;
	align-items: stretch;
	border: 1px solid #d0d0d0;
	height: 44px;
	flex-shrink: 0;
}

.enspire-qty-btn {
	background: none;
	border: none;
	width: 38px;
	height: 100%;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #1a1a1a;
	transition: background-color 0.15s;
	padding: 0;
}

.enspire-qty-btn:hover {
	background-color: #f0f0f0;
}

.enspire-qty-input {
	width: 44px;
	height: 100%;
	border: none;
	border-left: 1px solid #d0d0d0;
	border-right: 1px solid #d0d0d0;
	text-align: center;
	font-size: 14px;
	outline: none;
	-moz-appearance: textfield;
	color: #1a1a1a;
	font-family: inherit;
}

.enspire-qty-input::-webkit-outer-spin-button,
.enspire-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Add to cart button (modal) */
.enspire-qv-add-to-cart {
	flex: 1;
	min-width: 130px;
	height: 44px;
	background-color: #1a1a1a;
	color: #ffffff;
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	transition: background-color 0.2s;
	padding: 0 20px;
}

.enspire-qv-add-to-cart:hover:not(:disabled) {
	background-color: #333;
}

.enspire-qv-add-to-cart:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.enspire-qv-add-to-cart.loading {
	pointer-events: none;
	opacity: 0.7;
}

.enspire-qv-add-to-cart.added {
	background-color: #4caf50 !important;
}

/* Meta */
.enspire-qv-meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: auto;
	padding-top: 4px;
	border-top: 1px solid #f0f0f0;
}

.enspire-qv-sku-row,
.enspire-qv-cat-row {
	font-size: 12px;
	color: #888;
}

.enspire-qv-meta-label {
	font-weight: 600;
	color: #555;
	margin-right: 4px;
}

/* Scroll lock when modal is open */
body.enspire-qv-open {
	overflow: hidden;
}

/* ============================================================
 * Responsive
 * ============================================================ */

@media (max-width: 1024px) {
	.enspire-product-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.enspire-product-grid {
		grid-template-columns: repeat(1, 1fr);
		padding-bottom: 40px;
	}

	.enspire-product-item {
		margin-bottom: 20px;
		display: flow-root;
	}

	.enspire-qv-container {
		flex-direction: column;
		max-height: 90vh;
		overflow-y: auto;
	}

	.enspire-qv-image-col {
		flex: none;
		height: 260px;
		min-height: unset;
	}

	.enspire-qv-info-col {
		padding: 28px 24px;
		gap: 12px;
		overflow-y: unset;
	}

	.enspire-qv-title {
		font-size: 17px;
	}
}

/* ============================================================
 * Section Header (Title & Subtitle)
 * ============================================================ */
.enspire-section-header {
	margin-bottom: 30px;
	display: flex;
	flex-direction: column;
}

.enspire-section-title {
	margin: 0 0 10px;
	font-size: 28px;
	font-weight: 600;
	color: #1a1a1a;
}

.enspire-section-subtitle {
	font-size: 16px;
	color: #666;
	line-height: 1.5;
}

