/**
 * Damavand Storefront 0.3.10 (R19-O) — «گالری رنگ‌ها» (inc/r19-color-gallery.php).
 *
 * The stage keeps the main image's fixed ratio (1:1 desktop, 16:10 phones — design.css) and the
 * light photo tile (product-images.css); inside it a horizontal scroll-snap strip holds one slide
 * per colour (native swipe, RTL order, works without JS). Dark/gold tokens from design.css.
 *
 * @package Damavand_Storefront
 */

/* The media column must not grow to the thumbnail row's width (grid items default to min-width: auto). */
.dmv-product__media { min-width: 0; }
.dmv-cg {
	max-width: 100%;
	--dmv-cg-accent: var(--dmv-accent, #C89B6B);
	--dmv-cg-surface: var(--dmv-surface, #1F2226);
	--dmv-cg-border: var(--dmv-border, #2E3238);
	--dmv-cg-text: var(--dmv-text, #E8E8EA);
	--dmv-cg-muted: var(--dmv-muted, #A9AEB5);
	position: relative;
	min-width: 0;
}

/* ---------------------------------------------------------------- stage */
body.dmv-design .dmv-product__media .dv-product-media.dmv-cg__stage,
.dv-product-media.dmv-tile.dmv-cg__stage {
	display: block;
	position: relative;
	padding: 0;
	overflow: hidden;
}
.dmv-cg__track {
	position: absolute;
	inset: 0;
	display: flex;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.dmv-cg__track::-webkit-scrollbar { display: none; }
.dmv-cg__slide {
	position: relative;
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 14px 14px 40px;
	box-sizing: border-box;
	scroll-snap-align: center;
	scroll-snap-stop: always;
	scroll-margin-top: 190px; /* no-JS #anchor: clear the sticky header */
}
.dmv-cg__slide.is-active { scroll-initial-target: nearest; }
.dmv-cg__zoom {
	display: block;
	width: 100%;
	height: 100%;
	cursor: zoom-in;
	border-radius: 10px;
	-webkit-tap-highlight-color: transparent;
}
.dmv-cg__zoom:focus-visible { outline: 2px solid var(--dmv-cg-accent); outline-offset: -2px; }
.dmv-cg .dmv-tile .dmv-cg__zoom img,
.dmv-cg .dmv-tile .dmv-cg__zoom picture { width: 100% !important; height: 100% !important; object-fit: contain !important; }

/* Colour name on the photo (bottom, start side). */
.dmv-cg__cap {
	position: absolute;
	inset-inline-start: 12px;
	bottom: 10px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: calc(100% - 24px);
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(11, 11, 13, .78);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.6;
	pointer-events: none;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}
.dmv-cg__cap .dmv-cdot { width: 12px; height: 12px; }

/* Prev / next (added by the script; pointer devices). */
.dmv-cg__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-top: -22px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 50%;
	background: rgba(11, 11, 13, .62);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s, opacity .15s;
}
.dmv-cg__nav:hover { background: rgba(11, 11, 13, .85); }
.dmv-cg__nav:focus-visible { outline: 2px solid var(--dmv-cg-accent); outline-offset: 2px; }
.dmv-cg__nav[disabled] { opacity: 0; pointer-events: none; }
.dmv-cg__nav--prev { inset-inline-start: 10px; }
.dmv-cg__nav--next { inset-inline-end: 10px; }
@media (hover: hover) and (pointer: fine) {
	.dmv-cg.is-js .dmv-cg__nav { display: inline-flex; }
}

/* ----------------------------------------------------------------- dots */
.dmv-cg__dots {
	display: none;
	justify-content: center;
	gap: 6px;
	margin: 10px 0 0;
}
.dmv-cg.is-js .dmv-cg__dots { display: flex; }
.dmv-cg__dot {
	width: 7px;
	height: 7px;
	border-radius: 999px;
	background: #4A4F57;
	transition: width .2s, background .2s;
}
.dmv-cg__dot.is-active { width: 20px; background: var(--dmv-cg-accent); }

/* ------------------------------------------------------- heading + thumbs */
.dmv-cg__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin: 14px 0 8px;
}
.dmv-cg__title { color: var(--dmv-cg-text); font-size: 15px; font-weight: 700; }
.dmv-cg__count {
	display: inline-flex;
	align-items: center;
	padding: 1px 10px;
	border-radius: 999px;
	border: 1px solid rgba(200, 155, 107, .5);
	background: rgba(200, 155, 107, .12);
	color: var(--dmv-cg-accent);
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.8;
}
.dmv-cg__hint { color: var(--dmv-cg-muted); font-size: 12.5px; margin-inline-start: auto; }

.dmv-cg__thumbs {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 76px;
	gap: 6px;
	margin: 0;
	padding: 4px 2px 8px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: thin;
	scrollbar-color: #3A3F46 transparent;
}
.dmv-cg__ti { margin: 0; padding: 0; scroll-snap-align: start; }
.dmv-cg__thumb {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 5px 4px 6px;
	border: 1px solid var(--dmv-cg-border);
	border-radius: 12px;
	background: var(--dmv-cg-surface);
	color: var(--dmv-cg-text);
	text-decoration: none;
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s, background .15s;
	-webkit-tap-highlight-color: transparent;
}
.dmv-cg a.dmv-cg__thumb, .dmv-cg a.dmv-cg__thumb:visited { color: var(--dmv-cg-text); text-decoration: none; }
.dmv-cg a.dmv-cg__thumb:hover { border-color: #4A4F57; color: var(--dmv-cg-text); }
.dmv-cg a.dmv-cg__thumb.is-active { color: #fff; }
.dmv-cg__thumb:focus-visible { outline: 2px solid var(--dmv-cg-accent); outline-offset: 2px; }
.dmv-cg__thumb.is-active {
	border-color: var(--dmv-cg-accent);
	box-shadow: 0 0 0 1px var(--dmv-cg-accent), 0 6px 18px rgba(200, 155, 107, .18);
	background: #24211D;
}
.dmv-cg__timg.dmv-tile {
	display: block;
	width: 64px;
	height: 64px;
	padding: 3px;
	border-radius: 9px;
}
.dmv-cg__tname {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 4px;
	width: 100%;
	font-size: 11.5px;
	line-height: 1.5;
	text-align: center;
	overflow-wrap: anywhere;
}
.dmv-cg__tname .dmv-cdot { width: 10px; height: 10px; margin-top: 3px !important; }
.dmv-cg__sel {
	position: absolute;
	top: 52px;
	left: 50%;
	transform: translateX(-50%);
	padding: 0 6px;
	border-radius: 999px;
	background: var(--dmv-cg-accent);
	color: #0B0B0D;
	font-size: 9.5px;
	font-weight: 800;
	line-height: 1.7;
	white-space: nowrap;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.dmv-cg__sel[hidden] { display: none; }
.dmv-cg__thumb.is-selected .dmv-cg__timg { box-shadow: 0 0 0 2px var(--dmv-cg-accent); }

@media (max-width: 899px) {
	.dmv-cg__hint { flex-basis: 100%; margin-inline-start: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.dmv-cg__dot, .dmv-cg__thumb, .dmv-cg__nav { transition: none; }
}

/* ------------------------------------------------- floating contact button
 * While the thumbnail strip is in the bottom zone of the viewport (where the fixed «ارتباط» button
 * sits) the script sets html.dmv-cg-float-off: the button fades/slides out of the way, never while
 * its menu is open or it has keyboard focus. Only pages with the gallery load this file. */
.dmv-cg-page .dmv-float { transition: opacity .22s ease, transform .22s ease, visibility 0s linear 0s; }
html.dmv-cg-float-off .dmv-float:not(.is-open):not(:focus-within) {
	opacity: 0;
	transform: translateY(24px);
	pointer-events: none;
	visibility: hidden;
	transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
@media (prefers-reduced-motion: reduce) {
	.dmv-cg-page .dmv-float, html.dmv-cg-float-off .dmv-float:not(.is-open):not(:focus-within) { transition: none; transform: none; }
}

/* ------------------------------------------------------------- lightbox */
html.dmv-cg-lock, html.dmv-cg-lock body { overflow: hidden !important; overscroll-behavior: none; }
.dmv-cg-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	background: #0A0A0C;
	color: #fff;
	direction: rtl;
}
.dmv-cg-lb[hidden] { display: none; }
.dmv-cg-lb__bar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: max(10px, env(safe-area-inset-top)) 12px 10px;
	flex: none;
}
.dmv-cg-lb__title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.dmv-cg-lb__pos { color: #A9AEB5; font-size: 13px; font-weight: 500; }
.dmv-cg-lb__close,
.dmv-cg-lb__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .2);
	border-radius: 50%;
	background: rgba(255, 255, 255, .06);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}
.dmv-cg-lb__close:hover, .dmv-cg-lb__nav:hover { background: rgba(255, 255, 255, .14); }
.dmv-cg-lb__close:focus-visible, .dmv-cg-lb__nav:focus-visible { outline: 2px solid var(--dmv-accent, #C89B6B); outline-offset: 2px; }
.dmv-cg-lb__nav[disabled] { opacity: .25; cursor: default; }
.dmv-cg-lb__body { position: relative; flex: 1; min-height: 0; }
.dmv-cg-lb__track {
	position: absolute;
	inset: 0;
	display: flex;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	overscroll-behavior: contain;
	scrollbar-width: none;
}
.dmv-cg-lb__track::-webkit-scrollbar { display: none; }
.dmv-cg-lb__slide {
	flex: 0 0 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 8px 12px;
	box-sizing: border-box;
	scroll-snap-align: center;
	scroll-snap-stop: always;
}
.dmv-cg-lb__slide img {
	display: block;
	max-width: min(100%, 1000px);
	max-height: 100%;
	width: auto;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	border-radius: 14px;
	background: var(--dmv-tile-bg, #DEDDDC);
}
.dmv-cg-lb__nav { position: absolute; top: 50%; margin-top: -22px; z-index: 2; background: rgba(11, 11, 13, .6); }
.dmv-cg-lb__nav--prev { inset-inline-start: 12px; }
.dmv-cg-lb__nav--next { inset-inline-end: 12px; }
.dmv-cg-lb__foot { flex: none; display: flex; justify-content: center; gap: 6px; padding: 12px 0 max(14px, env(safe-area-inset-bottom)); }
.dmv-cg-lb__foot .dmv-cg__dot { background: #555A62; }
.dmv-cg-lb__foot .dmv-cg__dot.is-active { background: var(--dmv-accent, #C89B6B); }
@media (hover: none) {
	.dmv-cg-lb__nav { display: none; }
}
