/* ==========================================================================
   Product Catalogue Pages — Shared Styles
   ========================================================================== */

/* --- Category Quick Nav Bar --- */
.cat-nav-bar {
	background: #fff;
	border-bottom: 1px solid var(--color-border);
	padding-block: 0.75rem;
	position: sticky;
	top: 0;
	z-index: 50;
	transition: box-shadow 0.25s ease;
}

.cat-nav-bar.scrolled {
	box-shadow: var(--shadow-sm);
}

.cat-nav-bar__inner {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.cat-nav-bar__inner::-webkit-scrollbar { display: none; }

.cat-nav-bar__label {
	flex-shrink: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--color-text-muted);
	white-space: nowrap;
}

.cat-nav-bar__links {
	display: flex;
	gap: 0.375rem;
}

.cat-nav-bar__link {
	flex-shrink: 0;
	padding: 0.3rem 0.85rem;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--color-text);
	background: var(--color-bg-alt);
	border-radius: 100px;
	text-decoration: none;
	white-space: nowrap;
	transition: background var(--transition), color var(--transition);
}

.cat-nav-bar__link:hover {
	background: var(--color-accent);
	color: #fff;
	text-decoration: none;
}

/* --- Product Category Sections --- */
.prod-cat-section {
	padding-block: 3.5rem;
	background: var(--color-bg);
}

.prod-cat-section--alt {
	background: var(--color-bg-alt);
}

.prod-cat-section:first-of-type {
	padding-top: 3rem;
}

/* --- Product Gallery Grid --- */
.prod-gallery {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
}

.prod-gallery__item {
	border-radius: var(--radius-lg);
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--color-border);
	transition: box-shadow var(--transition-lg), transform var(--transition-lg);
	cursor: pointer;
	position: relative;
}

.prod-gallery__item:hover {
	box-shadow: var(--shadow-lg);
	transform: translateY(-2px);
}

.prod-gallery__img {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border-radius: var(--radius-lg);
	background: var(--color-bg-alt);
}

.prod-gallery__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.prod-gallery__item:hover .prod-gallery__img img {
	transform: scale(1.05);
}

.prod-gallery__overlay {
	position: absolute;
	inset: 0;
	border-radius: var(--radius-lg);
	background: linear-gradient(
		to top,
		rgba(2, 6, 23, 0.65) 0%,
		rgba(2, 6, 23, 0.15) 50%,
		transparent 70%
	);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 1rem;
	pointer-events: none;
}

.prod-gallery__name {
	font-family: var(--font-heading);
	font-size: 1.0625rem;
	font-weight: 700;
	color: #fff;
	text-shadow: 0 1px 4px rgba(0,0,0,0.35);
	line-height: 1.2;
}

.prod-gallery__count {
	font-size: 0.75rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.8);
	margin-top: 0.125rem;
}

/* --- Variant Overlay Modal --- */
.variant-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
	padding: 1.5rem;
}

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

.variant-modal__panel {
	background: #fff;
	border-radius: var(--radius-lg);
	max-width: 860px;
	width: 100%;
	max-height: 85vh;
	overflow-y: auto;
	padding: 1.5rem;
	box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
	position: relative;
	animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
	from { opacity: 0; transform: translateY(20px) scale(0.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.variant-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
}

.variant-modal__title {
	font-family: var(--font-heading);
	font-size: 1.125rem;
	font-weight: 700;
}

.variant-modal__close {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: var(--color-bg-alt);
	border-radius: 50%;
	cursor: pointer;
	font-size: 1.25rem;
	color: var(--color-text-muted);
	transition: background var(--transition);
	flex-shrink: 0;
}

.variant-modal__close:hover {
	background: #e5e7eb;
}

.variant-modal__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0.75rem;
}

.variant-modal__item {
	border-radius: var(--radius);
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background: var(--color-bg-alt);
	border: 1px solid var(--color-border);
}

.variant-modal__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	cursor: zoom-in;
	transition: transform 0.25s ease, opacity 0.2s ease;
}

.variant-modal__item:hover img {
	transform: scale(1.04);
	opacity: 0.92;
}

/* --- Variant Lightbox (click thumbnail to view full-size) --- */
.variant-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 10000;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.88);
	padding: 1.5rem;
	animation: lightboxFadeIn 0.2s ease;
}

.variant-lightbox.open {
	display: flex;
}

@keyframes lightboxFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.variant-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: var(--radius);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	animation: lightboxZoomIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
	cursor: zoom-out;
}

@keyframes lightboxZoomIn {
	from { opacity: 0; transform: scale(0.92); }
	to   { opacity: 1; transform: scale(1); }
}

.variant-lightbox__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border-radius: 50%;
	cursor: pointer;
	font-size: 1.5rem;
	line-height: 1;
	transition: background 0.2s ease, transform 0.2s ease;
	backdrop-filter: blur(8px);
}

.variant-lightbox__close:hover {
	background: rgba(255, 255, 255, 0.25);
	transform: rotate(90deg);
}

.variant-lightbox__caption {
	position: absolute;
	bottom: 1.25rem;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.8125rem;
	letter-spacing: 0.02em;
	padding: 0.4rem 0.85rem;
	background: rgba(0, 0, 0, 0.4);
	border-radius: 100px;
	backdrop-filter: blur(8px);
	pointer-events: none;
	max-width: 90%;
	text-align: center;
}

/* --- Gallery Actions Row --- */
.prod-gallery-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 1.5rem;
	flex-wrap: wrap;
}

.prod-gallery-actions .card-link {
	font-size: 0.875rem;
}

/* --- Responsive --- */
@media (min-width: 30em) {
	.prod-gallery {
		gap: 1.25rem;
	}
}

@media (min-width: 42em) {
	.prod-gallery {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 62em) {
	.prod-gallery {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 48em) {
	.variant-modal__grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.variant-modal {
		padding: 1rem;
	}

	.variant-modal__panel {
		padding: 1rem;
	}

	.variant-lightbox {
		padding: 0.5rem;
	}

	.variant-lightbox__close {
		top: 0.5rem;
		right: 0.5rem;
		width: 40px;
		height: 40px;
		font-size: 1.25rem;
	}
}

/* --- Prerender fallback: collapse quick nav until scrolled (JS-driven) --- */
.cat-nav-bar.collapse-if-not-scrolled {
	opacity: 1;
}

/* ==========================================================================
   AI Toys page \u2014 Feature banner + text-only gallery items
   ========================================================================== */

/* --- Section feature banner (only on cats with real images) --- */
.prod-cat-feature {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem;
	align-items: center;
	margin-bottom: 2rem;
	padding: 1.25rem;
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
}

.prod-cat-feature__image {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--color-bg-alt);
}

.prod-cat-feature__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.prod-cat-feature__body {
	padding: 0.5rem 0.5rem 0.5rem 0;
}

.prod-cat-feature__title {
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0 0 0.5rem;
	color: var(--color-text);
}

.prod-cat-feature__desc {
	font-size: 0.9375rem;
	color: var(--color-text-muted);
	line-height: 1.5;
	margin: 0 0 0.85rem;
}

.prod-cat-feature__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	font-size: 0.8125rem;
	color: var(--color-text);
}

.prod-cat-feature__meta strong {
	color: var(--color-text-muted);
	font-weight: 600;
	margin-right: 0.35rem;
}

@media (max-width: 48em) {
	.prod-cat-feature {
		grid-template-columns: 1fr;
		gap: 1rem;
		padding: 1rem;
	}
	.prod-cat-feature__body { padding: 0; }
}

/* --- Text-only gallery item (no real image yet) --- */
.prod-gallery__item--text-only {
	cursor: default;
}

.prod-gallery__img--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #f6f7f9 0%, #eceff3 100%);
	border: 1px dashed var(--color-border);
}

.prod-gallery__placeholder-text {
	font-size: 0.8125rem;
	color: var(--color-text-muted);
	letter-spacing: 0.02em;
	padding: 0.5rem 0.85rem;
	background: rgba(255, 255, 255, 0.7);
	border-radius: 100px;
	backdrop-filter: blur(4px);
}
