/**
 * Product Color Gallery — Frontend Styles v1.1.0
 */

/* Load Playfair Display from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

.pcg-gallery {
	--pcg-swatch-size: 90px;
	--pcg-gap: 12px;
	--pcg-active-color: #FD0101;
	--pcg-border-inactive: #d0d0d0;

	box-sizing: border-box;
	width: 100%;
	max-width: 700px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.pcg-gallery *,
.pcg-gallery *::before,
.pcg-gallery *::after {
	box-sizing: border-box;
}

.pcg-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Main Image ---------- */

.pcg-main-image-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 0.97;
	border-radius: 10px !important;
	-webkit-border-radius: 10px !important;
	overflow: hidden !important;
	background: #f4f4f5;
	-webkit-mask-image: -webkit-radial-gradient(white, black);
	mask-image: radial-gradient(white, black);
}

.pcg-main-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 10px;
	opacity: 1;
	transition: opacity 0.3s ease;
	will-change: opacity;
}

.pcg-main-image.is-fading {
	opacity: 0;
}

/* ---------- Description Text Block ---------- */

.pcg-description {
	margin: 24px 0 20px;
	padding: 0 4px;
	text-align: center;
}

.pcg-description-title {
	font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
	font-size: 1.45rem;
	font-weight: 700;
	color: #1a1a1a;
	line-height: 1.3;
	margin: 0 0 10px;
	letter-spacing: -0.01em;
}

.pcg-description-body {
	font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
	font-size: 0.95rem;
	font-weight: 400;
	color: #555;
	line-height: 1.7;
	margin: 0;
}

/* ---------- Swatch Row ---------- */

.pcg-swatches {
	display: flex;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: center;
	gap: var( --pcg-gap );
	margin-top: 36px;
	padding: 6px 2px;
	list-style: none;
}

/* ---------- Button Reset ---------- */
.pcg-gallery button.pcg-swatch,
.pcg-gallery button.pcg-swatch:link,
.pcg-gallery button.pcg-swatch:visited,
.pcg-gallery button.pcg-swatch:hover,
.pcg-gallery button.pcg-swatch:focus,
.pcg-gallery button.pcg-swatch:active,
.pcg-gallery button.pcg-swatch:focus-visible,
.pcg-gallery button.pcg-swatch:focus-within {
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex: 0 0 auto !important;
	padding: 0 !important;
	margin: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: none !important;
	outline: none !important;
	outline-width: 0 !important;
	box-shadow: none !important;
	-webkit-tap-highlight-color: transparent !important;
	cursor: pointer !important;
	line-height: 0 !important;
	color: inherit !important;
	text-decoration: none !important;
}

/* ---------- Swatch Square (was Circle) ---------- */

.pcg-swatch-circle {
	display: block;
	position: relative;
	width: var( --pcg-swatch-size );
	height: var( --pcg-swatch-size );
	min-width: 65px;
	min-height: 80px;
	/* Square: no border-radius */
	border-radius: 6px;
	overflow: hidden;
	border: 2px solid var( --pcg-border-inactive );
	box-shadow: none;
	transform: scale(1);
	transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
	background: #f0f0f0;
	flex-shrink: 0;
}

/* ---------- Swatch Image — fills square ---------- */
.pcg-swatch-circle img {
	display: block;
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 100%;
	transform: translate(-50%, -50%) scale(1.5);
	object-fit: cover !important;
	object-position: center center !important;
	border-radius: 0;
	pointer-events: none;
	margin: 0;
	padding: 0;
	border: none;
}

/* ---------- Hover Color Name Overlay ---------- */

.pcg-swatch-hover-label {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.52);
	color: #fff;
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 10px;
	font-weight: 600;
	font-style: italic;
	line-height: 1.2;
	text-align: center;
	padding: 4px 5px;
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
	word-break: break-word;
	hyphens: auto;
	z-index: 2;
}

/* Show label on hover */
.pcg-gallery button.pcg-swatch:hover .pcg-swatch-hover-label {
	opacity: 1;
}

/* ---------- Hover ---------- */
.pcg-gallery button.pcg-swatch:hover .pcg-swatch-circle {
	border-color: #aaa;
	transform: scale(1.06);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* ---------- Active ---------- */
.pcg-swatch.is-active .pcg-swatch-circle {
	border-color: var( --pcg-active-color ) !important;
	border-width: 3px !important;
	transform: scale(1.05);
	box-shadow: 0 0 8px 1px rgba(253, 1, 1, 0.45);
	animation: pcg-active-pulse 2.2s ease-in-out infinite;
}

@keyframes pcg-active-pulse {
	0%, 100% { box-shadow: 0 0 6px 1px rgba(253, 1, 1, 0.35); }
	50%       { box-shadow: 0 0 14px 3px rgba(253, 1, 1, 0.6); }
}

.pcg-gallery button.pcg-swatch:focus-visible .pcg-swatch-circle {
	border-color: rgba(253, 1, 1, 0.5) !important;
	box-shadow: 0 0 0 3px rgba(253, 1, 1, 0.25);
}

/* ---------- Admin notice ---------- */
.pcg-admin-notice {
	padding: 12px 16px;
	background: #fef8e8;
	border: 1px solid #f0d98c;
	border-radius: 8px;
	color: #6b5b1a;
	font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
	.pcg-gallery {
		--pcg-swatch-size: 76px;
		--pcg-gap: 10px;
		max-width: 100%;
	}
	.pcg-swatches { flex-wrap: wrap; }
	.pcg-description-title { font-size: 1.2rem; }
	.pcg-description-body  { font-size: 0.88rem; }
}

@media (max-width: 480px) {
	.pcg-gallery {
		--pcg-swatch-size: 62px;
		--pcg-gap: 8px;
	}
	.pcg-swatches {
		flex-wrap: nowrap;
		overflow-x: auto;
		justify-content: flex-start;
		scroll-snap-type: x proximity;
		-webkit-overflow-scrolling: touch;
		padding: 6px 4px 10px;
	}
	.pcg-swatch { scroll-snap-align: start; }
	.pcg-swatch-hover-label { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
	.pcg-main-image,
	.pcg-swatch-circle { transition: none !important; }
	.pcg-swatch.is-active .pcg-swatch-circle {
		animation: none !important;
		box-shadow: 0 0 8px 1px rgba(253, 1, 1, 0.45);
	}
}