/* ============================================================
 * WooCommerce 3D Gallery — frontend
 * Universal "Ver en 3D" button + premium modal lightbox.
 * All selectors are namespaced (wc3d-*) and modal renders into
 * <body> with high z-index so theme styles cannot break it.
 * ============================================================ */

/* ---------------- Image wrap (used when button is anchored) ---------------- */
.wc3d-img-wrap {
	position: relative;
	display: inline-block;
	max-width: 100%;
}

/* ---------------- CTA button (shared) ---------------- */
.wc3d-cta {
	display: inline-flex !important;
	align-items: center;
	gap: 0.5rem;
	padding: 0.7rem 1.2rem;
	margin: 0;
	background: rgba(15, 15, 15, 0.88) !important;
	color: #fff !important;
	border: 1px solid rgba(255, 255, 255, 0.22) !important;
	border-radius: 999px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
	transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
}

.wc3d-cta:hover,
.wc3d-cta:focus-visible {
	background: rgba(0, 0, 0, 0.95) !important;
	border-color: rgba(255, 255, 255, 0.4) !important;
	transform: translateY(-1px);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
	outline: none;
	color: #fff !important;
}

.wc3d-cta__icon {
	display: inline-flex;
	width: 1rem;
	height: 1rem;
	color: currentColor;
}

.wc3d-cta__icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.wc3d-cta__text {
	display: inline-block;
	white-space: nowrap;
}

/* Anchored mode: button sits over the bottom-right of the product image */
.wc3d-cta--anchored {
	position: absolute;
	right: 14px;
	bottom: 14px;
	z-index: 10;
}

/* Floating fallback: fixed to viewport bottom-right */
.wc3d-cta--floating {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 99998;
	padding: 0.85rem 1.4rem;
	font-size: 0.9rem;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}

@media (max-width: 600px) {
	.wc3d-cta--anchored {
		right: 10px;
		bottom: 10px;
		padding: 0.55rem 0.95rem;
		font-size: 0.78rem;
	}
	.wc3d-cta--floating {
		right: 14px;
		bottom: 14px;
		padding: 0.7rem 1.1rem;
	}
}

/* ---------------- Modal lightbox ---------------- */
.wc3d-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wc3d-modal--open {
	display: flex;
}

.wc3d-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(8, 8, 10, 0.86);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	animation: wc3d-fade 0.25s ease;
}

.wc3d-modal__card {
	position: relative;
	width: 100%;
	height: 100%;
	max-width: 1400px;
	max-height: 92vh;
	background: #0a0a0a;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
	animation: wc3d-pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.1);
	box-sizing: border-box;
}

.wc3d-modal__iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	background: #000;
}

.wc3d-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	width: 42px;
	height: 42px;
	padding: 0;
	margin: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.2);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.wc3d-modal__close:hover,
.wc3d-modal__close:focus-visible {
	background: rgba(255, 255, 255, 0.22);
	border-color: rgba(255, 255, 255, 0.4);
	transform: scale(1.05);
	outline: none;
}

.wc3d-modal__body {
	width: 100%;
	height: 100%;
}

.wc3d-no-scroll {
	overflow: hidden !important;
}

@media (max-width: 600px) {
	.wc3d-modal {
		padding: 12px;
	}
	.wc3d-modal__card {
		border-radius: 12px;
		max-height: 96vh;
	}
	.wc3d-modal__close {
		width: 38px;
		height: 38px;
		top: 10px;
		right: 10px;
	}
}

@keyframes wc3d-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes wc3d-pop {
	from { opacity: 0; transform: scale(0.94); }
	to { opacity: 1; transform: scale(1); }
}
