/**
 * RENIC Variation Swatches - Frontend Stylesheet
 * Shopify Dawn-inspired Design Tokens & Architecture
 *
 * @package RENIC_Variation_Swatches
 */

:root {
	--rvs-gap: 10px;
	--rvs-radius: 999px;
	--rvs-border: #d9d9d9;
	--rvs-border-hover: #1a1a1a;
	--rvs-border-selected: #111111;
	--rvs-bg: #ffffff;
	--rvs-text: #111111;
	--rvs-muted: #6b7280;
	--rvs-selected-bg: #111111;
	--rvs-selected-text: #ffffff;
	--rvs-size-color: 36px;
	--rvs-size-image: 44px;
	--rvs-btn-h: 40px;
	--rvs-btn-w: 48px;
	--rvs-btn-pad: 16px;
	--rvs-font-size: 14px;
	--rvs-border-width: 1px;
	--rvs-highlight-size: 52px;
	--rvs-tooltip-bg: #111111;
	--rvs-tooltip-text: #ffffff;
	--rvs-ease: cubic-bezier(0.4, 0, 0.2, 1);
	--rvs-dur: 0.18s;
}

/* Hidden Native Select (Visually clipped for a11y & screen readers) */
.rvs-hidden-select {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* Table Integration for Standard WooCommerce & Themes */
.variations tr:has(.rvs-wrap) th.label,
.variations tr.rvs-has-swatches th.label {
	display: none;
}
.variations tr:has(.rvs-wrap) td.value,
.variations tr.rvs-has-swatches td.value {
	display: block;
	width: 100%;
	padding: 0 0 16px 0;
}

/* Outer Swatch Wrapper */
.rvs-wrap {
	display: block;
	margin-bottom: 18px;
	min-height: 44px;
	box-sizing: border-box;
}

/* Label Row (Shopify style: "Color: Ocean Blue") */
.rvs-label-line {
	display: flex !important;
	align-items: center !important;
	justify-content: flex-start !important;
	width: 100% !important;
	font-size: var(--rvs-font-size);
	line-height: 1.4;
	margin-bottom: 8px;
	gap: 4px !important;
}
.rvs-attr-name {
	font-weight: 500;
	color: var(--rvs-muted);
}
.rvs-sep {
	color: var(--rvs-muted);
	margin-right: 2px;
}
.rvs-selected-name {
	font-weight: 600;
	color: var(--rvs-text);
	margin-left: 2px;
}
.rvs-clear-link {
	margin-left: auto !important;
	padding-left: 8px !important;
	font-size: 12px;
	color: var(--rvs-muted);
	text-decoration: underline;
	cursor: pointer;
	white-space: nowrap !important;
	transition: color var(--rvs-dur) var(--rvs-ease);
}
.rvs-clear-link:hover {
	color: var(--rvs-text);
}

/* Swatches List */
.rvs-list {
	display: flex !important;
	flex-wrap: wrap !important;
	flex-direction: row !important;
	align-items: center !important;
	gap: var(--rvs-gap) !important;
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* Base Swatch Item */
.rvs-item {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-sizing: border-box;
	user-select: none;
	touch-action: manipulation;
	min-width: 44px;
	min-height: 44px;
	transition: transform var(--rvs-dur) var(--rvs-ease),
				border-color var(--rvs-dur) var(--rvs-ease),
				background-color var(--rvs-dur) var(--rvs-ease),
				color var(--rvs-dur) var(--rvs-ease),
				box-shadow var(--rvs-dur) var(--rvs-ease);
}

.rvs-item:active {
	transform: scale(0.96);
}

/* Keyboard Focus Ring */
.rvs-item:focus-visible {
	outline: 2px solid var(--rvs-border-selected);
	outline-offset: 2px;
}

/* ==========================================================================
   COLOR SWATCHES
   ========================================================================== */
.rvs-item--color {
	width: var(--rvs-size-color);
	height: var(--rvs-size-color);
	padding: 2px;
	border: var(--rvs-border-width) solid var(--rvs-border);
	background-color: var(--rvs-bg);
}

/* Shape: Round */
.rvs-shape--round .rvs-item--color,
.rvs-item--color.rvs-shape--round {
	border-radius: 999px;
}
.rvs-shape--round .rvs-item--color .rvs-swatch,
.rvs-item--color.rvs-shape--round .rvs-swatch {
	border-radius: 999px;
}

/* Shape: Square */
.rvs-shape--square .rvs-item--color,
.rvs-item--color.rvs-shape--square {
	border-radius: 0;
}
.rvs-shape--square .rvs-item--color .rvs-swatch,
.rvs-item--color.rvs-shape--square .rvs-swatch {
	border-radius: 0;
}

/* Shape: Rounded Pill */
.rvs-shape--rounded .rvs-item--color,
.rvs-item--color.rvs-shape--rounded {
	border-radius: var(--rvs-radius);
}
.rvs-shape--rounded .rvs-item--color .rvs-swatch,
.rvs-item--color.rvs-shape--rounded .rvs-swatch {
	border-radius: calc(var(--rvs-radius) - 2px);
}

.rvs-item--color .rvs-swatch {
	display: block;
	width: 100%;
	height: 100%;
	background-color: var(--rvs-c1, #111111);
}

/* Dual Color: Diagonal 50/50 split */
.rvs-item--color.is-dual .rvs-swatch {
	background: linear-gradient(135deg, var(--rvs-c1) 50%, var(--rvs-c2) 50%) !important;
}

/* Multi Color: Conic split */
.rvs-item--color.is-multi .rvs-swatch {
	background: var(--rvs-conic, conic-gradient(#ff0000 0deg 120deg, #00ff00 120deg 240deg, #0000ff 240deg 360deg)) !important;
}

.rvs-item--color:hover {
	border-color: var(--rvs-border-hover);
}

/* Color Selected States */
.rvs-item--color.is-selected {
	border-color: var(--rvs-border-selected);
	box-shadow: 0 0 0 2px var(--rvs-bg), 0 0 0 4px var(--rvs-border-selected);
}

/* ==========================================================================
   IMAGE SWATCHES
   ========================================================================== */
.rvs-item--image {
	width: var(--rvs-size-image);
	height: var(--rvs-size-image);
	padding: 2px;
	border: var(--rvs-border-width) solid var(--rvs-border);
	border-radius: 8px;
	background-color: var(--rvs-bg);
}

.rvs-shape--round .rvs-item--image {
	border-radius: 999px;
}
.rvs-shape--square .rvs-item--image {
	border-radius: 0;
}

.rvs-item--image .rvs-swatch {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	overflow: hidden;
}

.rvs-item--image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}

.rvs-item--image:hover {
	border-color: var(--rvs-border-hover);
}

.rvs-item--image.is-selected {
	border-color: var(--rvs-border-selected);
	box-shadow: 0 0 0 2px var(--rvs-border-selected);
}

/* ==========================================================================
   BUTTON / LABEL SWATCHES (Shopify Dawn pill)
   ========================================================================== */
.rvs-item--button {
	height: var(--rvs-btn-h);
	min-width: var(--rvs-btn-w);
	padding-inline: var(--rvs-btn-pad);
	border-radius: var(--rvs-radius);
	border: var(--rvs-border-width) solid var(--rvs-border);
	background-color: var(--rvs-bg);
	color: var(--rvs-text);
	font-size: var(--rvs-font-size);
	font-weight: 500;
	letter-spacing: 0.2px;
}

.rvs-item--button:hover {
	border-color: var(--rvs-border-hover);
}

/* Button Selected: Solid Fill (Default) */
.rvs-item--button.is-selected {
	background-color: var(--rvs-selected-bg);
	color: var(--rvs-selected-text);
	border-color: var(--rvs-border-selected);
}

/* Button Selected: Outline Variant */
.rvs-selected--outline .rvs-item--button.is-selected {
	background-color: var(--rvs-bg);
	color: var(--rvs-text);
	border-color: var(--rvs-border-selected);
	box-shadow: 0 0 0 1px var(--rvs-border-selected);
	font-weight: 600;
}

/* Button Selected: Outer Ring Variant */
.rvs-selected--ring .rvs-item--button.is-selected {
	border-color: var(--rvs-border-selected);
	box-shadow: 0 0 0 2px var(--rvs-bg), 0 0 0 4px var(--rvs-border-selected);
}

/* ==========================================================================
   RADIO BUTTON SWATCHES (HORIZONTAL ROW LAYOUT)
   ========================================================================== */
.rvs-wrap--radio .rvs-list {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: wrap !important;
	align-items: center !important;
	gap: var(--rvs-gap, 8px) !important;
}

.rvs-item--radio {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: auto !important;
	flex: 0 0 auto !important;
	padding: 8px 16px !important;
	border-radius: 8px !important;
	border: var(--rvs-border-width, 1px) solid var(--rvs-border) !important;
	background-color: var(--rvs-bg) !important;
	color: var(--rvs-text) !important;
	font-size: var(--rvs-font-size) !important;
	gap: 8px !important;
	white-space: nowrap !important;
}

.rvs-radio-indicator {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid var(--rvs-border);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	transition: border-color var(--rvs-dur) var(--rvs-ease);
}

.rvs-radio-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: transparent;
	transition: background-color var(--rvs-dur) var(--rvs-ease);
}

.rvs-item--radio:hover {
	border-color: var(--rvs-border-hover);
}

.rvs-item--radio.is-selected {
	border-color: var(--rvs-border-selected);
}

.rvs-item--radio.is-selected .rvs-radio-indicator {
	border-color: var(--rvs-border-selected);
}

.rvs-item--radio.is-selected .rvs-radio-dot {
	background-color: var(--rvs-border-selected);
}

/* ==========================================================================
   HIGHLIGHTED ATTRIBUTE (LARGER SIZE)
   ========================================================================== */
.rvs-wrap.is-highlight .rvs-item--color {
	width: var(--rvs-highlight-size);
	height: var(--rvs-highlight-size);
}

.rvs-wrap.is-highlight .rvs-item--image {
	width: var(--rvs-highlight-size);
	height: var(--rvs-highlight-size);
}

.rvs-wrap.is-highlight .rvs-item--button {
	height: calc(var(--rvs-btn-h) + 8px);
	font-size: calc(var(--rvs-font-size) + 2px);
}

/* ==========================================================================
   OUT-OF-STOCK & DISABLED STATES
   ========================================================================== */
/* Variant: Cross-out */
.rvs-item.is-oos.oos-cross {
	opacity: 0.45;
	position: relative;
	overflow: hidden;
}
.rvs-item.is-oos.oos-cross::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(
		to top right,
		transparent calc(50% - 1px),
		#ef4444 calc(50% - 1px),
		#ef4444 calc(50% + 1px),
		transparent calc(50% + 1px)
	);
	pointer-events: none;
}

/* Variant: Blur */
.rvs-item.is-oos.oos-blur {
	opacity: 0.35;
	filter: blur(1px);
}

/* Variant: Hide */
.rvs-item.is-oos.oos-hide {
	display: none !important;
}

.rvs-item.is-disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

/* ==========================================================================
   TOOLTIPS (Shopify style floating bubbles)
   ========================================================================== */
/* Text Tooltip via data-tooltip */
[data-tooltip] {
	position: relative;
}

@media (hover: hover) {
	[data-tooltip]::before,
	[data-tooltip]::after {
		position: absolute;
		left: 50%;
		transform: translateX(-50%) translateY(4px);
		opacity: 0;
		visibility: hidden;
		transition: opacity var(--rvs-dur) var(--rvs-ease),
					transform var(--rvs-dur) var(--rvs-ease),
					visibility var(--rvs-dur) var(--rvs-ease);
		pointer-events: none;
		z-index: 100;
	}

	[data-tooltip]::before {
		content: attr(data-tooltip);
		bottom: calc(100% + 8px);
		padding: 5px 10px;
		background-color: var(--rvs-tooltip-bg);
		color: var(--rvs-tooltip-text);
		font-size: 11px;
		font-weight: 500;
		line-height: 1.2;
		white-space: nowrap;
		border-radius: 6px;
		box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
	}

	[data-tooltip]::after {
		content: "";
		bottom: calc(100% + 2px);
		width: 0;
		height: 0;
		border-left: 5px solid transparent;
		border-right: 5px solid transparent;
		border-top: 6px solid var(--rvs-tooltip-bg);
	}

	[data-tooltip]:hover::before,
	[data-tooltip]:hover::after,
	[data-tooltip]:focus-visible::before,
	[data-tooltip]:focus-visible::after {
		opacity: 1;
		visibility: visible;
		transform: translateX(-50%) translateY(0);
	}

	/* Rich Image Tooltip Box (.rvs-tip) */
	.rvs-tip {
		position: absolute;
		bottom: calc(100% + 8px);
		left: 50%;
		transform: translateX(-50%) translateY(4px);
		opacity: 0;
		visibility: hidden;
		background-color: var(--rvs-tooltip-bg);
		color: var(--rvs-tooltip-text);
		padding: 6px;
		border-radius: 8px;
		box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
		z-index: 101;
		pointer-events: none;
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 4px;
		transition: opacity var(--rvs-dur) var(--rvs-ease),
					transform var(--rvs-dur) var(--rvs-ease),
					visibility var(--rvs-dur) var(--rvs-ease);
	}

	.rvs-tip-img {
		width: 100px;
		height: 100px;
		object-fit: cover;
		border-radius: 4px;
		display: block;
	}

	.rvs-tip-text {
		font-size: 11px;
		font-weight: 500;
		white-space: nowrap;
		padding-inline: 4px;
	}

	.rvs-tip-arrow {
		position: absolute;
		bottom: -6px;
		left: 50%;
		transform: translateX(-50%);
		width: 0;
		height: 0;
		border-left: 6px solid transparent;
		border-right: 6px solid transparent;
		border-top: 6px solid var(--rvs-tooltip-bg);
	}

	.rvs-item:hover .rvs-tip,
	.rvs-item:focus-visible .rvs-tip {
		opacity: 1;
		visibility: visible;
		transform: translateX(-50%) translateY(0);
	}

	/* When rich tooltip exists, suppress pure text pseudo-elements */
	.rvs-item:has(.rvs-tip)::before,
	.rvs-item:has(.rvs-tip)::after {
		display: none !important;
	}
}

/* Touch devices: disable tooltips */
@media (hover: none) {
	[data-tooltip]::before,
	[data-tooltip]::after,
	.rvs-tip {
		display: none !important;
	}
}

/* ==========================================================================
   REMAINING STOCK DISPLAY
   ========================================================================== */
.rvs-stock-note {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 8px 0 14px;
	font-size: 13px;
	font-weight: 600;
	color: #d97706; /* Warm amber */
	background-color: #fef3c7;
	padding: 4px 10px;
	border-radius: 999px;
	width: fit-content;
}

.rvs-stock-note::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background-color: #d97706;
	display: inline-block;
}

/* ==========================================================================
   ACCESSIBILITY & PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.rvs-item,
	.rvs-swatch,
	[data-tooltip]::before,
	[data-tooltip]::after,
	.rvs-tip,
	.rvs-archive-img-tip {
		transition: none !important;
		transform: none !important;
	}
}

/* ==========================================================================
   GROUP SWATCHES (Phase 3)
   ========================================================================== */
.rvs-groups-wrap {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
}

.rvs-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.rvs-group-title {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--rvs-muted);
	margin: 0 0 2px 0;
}

/* ==========================================================================
   ARCHIVE / SHOP CARD SWATCHES (Phase 3)
   ========================================================================== */
.rvs-archive {
	display: block;
	margin: 8px 0;
	box-sizing: border-box;
	clear: both;
}

.rvs-archive-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Alignment modifier */
.rvs-archive[data-align="center"] .rvs-archive-list,
.rvs-archive[style*="--rvs-archive-align: center"] .rvs-archive-list,
.rvs-archive[style*="--rvs-archive-align:center"] .rvs-archive-list {
	justify-content: center;
}
.rvs-archive[data-align="right"] .rvs-archive-list,
.rvs-archive[style*="--rvs-archive-align: right"] .rvs-archive-list,
.rvs-archive[style*="--rvs-archive-align:right"] .rvs-archive-list {
	justify-content: flex-end;
}
.rvs-archive[data-align="left"] .rvs-archive-list,
.rvs-archive[style*="--rvs-archive-align: left"] .rvs-archive-list,
.rvs-archive[style*="--rvs-archive-align:left"] .rvs-archive-list {
	justify-content: flex-start;
}

.rvs-archive .rvs-item {
	position: relative;
	cursor: pointer;
	text-decoration: none;
	color: inherit;
}

/* Archive item dimensions driven by custom property */
.rvs-archive .rvs-item--color .rvs-swatch,
.rvs-archive .rvs-item--image .rvs-swatch {
	width: var(--rvs-archive-size, 26px);
	height: var(--rvs-archive-size, 26px);
}

.rvs-archive .rvs-item--button .rvs-swatch {
	min-height: calc(var(--rvs-archive-size, 26px) + 4px);
	padding: 2px 8px;
	font-size: 11px;
}

/* Hidden items when limit exceeded */
.rvs-archive .rvs-item.is-extra {
	display: none !important;
}

/* MORE pill (+3) */
.rvs-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	color: var(--rvs-muted);
	border: 1px solid var(--rvs-border);
	background: var(--rvs-bg);
	border-radius: 999px;
	padding: 4px 8px;
	text-decoration: none;
	transition: all var(--rvs-dur) var(--rvs-ease);
	cursor: pointer;
}

.rvs-more:hover {
	color: var(--rvs-text);
	border-color: var(--rvs-border-hover);
	background: #f9fafb;
}

/* Archive Floating Image Tooltip */
.rvs-archive-img-tip {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	width: 64px;
	height: 64px;
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	overflow: hidden;
	z-index: 999;
	transition: opacity var(--rvs-dur) var(--rvs-ease), transform var(--rvs-dur) var(--rvs-ease), visibility var(--rvs-dur);
}

.rvs-archive-img-tip img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rvs-item:hover .rvs-archive-img-tip {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   FILTER WIDGET SWATCHES (Phase 3)
   ========================================================================== */
.rvs-filter-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none !important;
	padding: 0 !important;
	margin: 8px 0 !important;
}

.rvs-filter-item {
	display: inline-flex;
	align-items: center;
	margin: 0 !important;
	padding: 0 !important;
}

.rvs-filter-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	color: inherit;
	padding: 2px;
	border-radius: 4px;
	transition: opacity var(--rvs-dur) var(--rvs-ease);
}

.rvs-filter-link:hover {
	opacity: 0.85;
}

.rvs-filter-item.chosen .rvs-swatch,
.rvs-filter-item.is-chosen .rvs-swatch {
	border-color: var(--rvs-border-selected) !important;
	box-shadow: 0 0 0 1px var(--rvs-border-selected) !important;
}

.rvs-filter-item.chosen .rvs-item--button .rvs-swatch,
.rvs-filter-item.is-chosen .rvs-item--button .rvs-swatch {
	background-color: var(--rvs-selected-bg) !important;
	color: var(--rvs-selected-text) !important;
}

.rvs-filter-count {
	font-size: 11px;
	color: var(--rvs-muted);
}

/* WooCommerce Filter Block Adaptation */
.wc-block-attribute-filter .rvs-filter-list {
	margin-top: 10px;
}

/* ==========================================================================
   BLOCKS & DIRECT LINKS (Phase 4)
   ========================================================================== */
.rvs-align--center .rvs-list {
	justify-content: center;
}

.rvs-align--right .rvs-list {
	justify-content: flex-end;
}

.rvs-align--left .rvs-list {
	justify-content: flex-start;
}

.rvs-variation-link {
	display: inline-flex;
	align-items: center;
	color: var(--rvs-text);
	text-decoration: underline;
	font-weight: 500;
	transition: opacity var(--rvs-dur) var(--rvs-ease);
}

.rvs-variation-link:hover {
	opacity: 0.8;
}

.rvs-block-placeholder {
	padding: 18px 24px;
	background: #f9fafb;
	border: 1px dashed #d1d5db;
	border-radius: 8px;
	text-align: center;
	color: #6b7280;
	font-size: 13px;
	font-weight: 500;
	margin: 10px 0;
}

/* Gallery image smooth transition */
.woocommerce-product-gallery__image img {
	transition: opacity 0.15s ease-in-out;
}

/* ==========================================================================
   Custom Plus Size — Hidden inputs (inside form, always present)
   ========================================================================== */
.rvs-custom-fields {
	display: none; /* hidden container for server-side POST values */
}

/* Summary chip shown below swatches after measurement is saved */
.rvs-custom-summary {
	display: none;
	align-items: center;
	gap: 8px;
	margin: 8px 0 4px;
	padding: 7px 14px;
	background: #f0fdf4;
	border: 1.5px solid #86efac;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	color: #166534;
	cursor: pointer;
	outline: none;
	transition: background var(--rvs-dur) var(--rvs-ease);
}
.rvs-custom-summary:not([hidden]) {
	display: inline-flex;
}
.rvs-custom-summary:hover {
	background: #dcfce7;
}

/* ==========================================================================
   Custom Plus Size Modal (<dialog>)
   ========================================================================== */
.rvs-modal {
	border: 0;
	padding: 0;
	border-radius: 16px;
	max-width: min(92vw, 440px);
	width: 100%;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	overflow: hidden;
}
.rvs-modal::backdrop {
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(2px);
}
.rvs-modal__card {
	padding: 28px 24px 24px;
	background: #ffffff;
}
.rvs-modal__badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	background: #111111;
	color: #ffffff;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	margin-bottom: 10px;
}
.rvs-modal__title {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 700;
	color: #111827;
	line-height: 1.3;
}
.rvs-modal__help {
	margin: 0 0 20px;
	font-size: 13px;
	line-height: 1.5;
	color: #4b5563;
}
.rvs-modal__label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #374151;
	margin-bottom: 8px;
}
.rvs-modal__label .required {
	color: #ef4444;
}
.rvs-modal__row {
	display: flex !important;
	flex-direction: row !important;
	gap: 12px !important;
	align-items: center !important;
	margin-bottom: 12px !important;
	width: 100% !important;
	box-sizing: border-box !important;
}
#rvs-m-val,
.rvs-modal__input,
input#rvs-m-val.rvs-modal__input {
	flex: 1 1 0% !important;
	min-width: 140px !important;
	max-width: none !important;
	width: auto !important;
	height: 48px !important;
	padding: 0 14px !important;
	background: #ffffff !important;
	border: 1.5px solid #d1d5db !important;
	border-radius: 8px !important;
	font-size: 16px !important;
	font-weight: 500 !important;
	color: #111827 !important;
	box-sizing: border-box !important;
	outline: none !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
	-moz-appearance: textfield;
}
#rvs-m-val::-webkit-inner-spin-button,
#rvs-m-val::-webkit-outer-spin-button {
	-webkit-appearance: none;
}
#rvs-m-val:focus {
	border-color: #111111 !important;
	box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.12) !important;
}
#rvs-m-val.rvs-invalid {
	border-color: #ef4444 !important;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}
.rvs-segmented-unit-toggle {
	display: inline-flex !important;
	flex: 0 0 auto !important;
	width: auto !important;
	max-width: none !important;
	background: #f3f4f6 !important;
	border-radius: 8px !important;
	padding: 4px !important;
	box-sizing: border-box !important;
	gap: 2px !important;
	align-items: center !important;
}
.rvs-unit-toggle-btn {
	background: transparent !important;
	border: none !important;
	padding: 0 14px !important;
	height: 40px !important;
	line-height: 40px !important;
	border-radius: 6px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	color: #64748b !important;
	cursor: pointer !important;
	white-space: nowrap !important;
	transition: all 0.15s ease !important;
	box-shadow: none !important;
	outline: none !important;
}
.rvs-unit-toggle-btn.is-active {
	background: #ffffff !important;
	color: #111111 !important;
	box-shadow: 0 1px 3px rgba(0,0,0,0.12) !important;
}
.rvs-modal__hint {
	margin: 0 0 16px;
	font-size: 12px;
	line-height: 1.4;
	color: #6b7280;
	font-style: italic;
}
.rvs-modal__error {
	margin: 0 0 14px;
	padding: 10px 14px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-left: 4px solid #ef4444;
	color: #991b1b;
	font-size: 13px;
	font-weight: 500;
	border-radius: 6px;
	line-height: 1.4;
}
.rvs-modal__error[hidden] {
	display: none;
}
.rvs-modal__actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 4px;
}
.rvs-btn-ghost {
	height: 42px;
	padding: 0 20px;
	background: transparent;
	border: 1.5px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	color: #374151;
	cursor: pointer;
	transition: all 0.15s ease;
}
.rvs-btn-ghost:hover {
	border-color: #9ca3af;
	background: #f9fafb;
}
.rvs-btn-primary {
	height: 42px;
	padding: 0 24px;
	background: #111111;
	border: 1.5px solid #111111;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 700;
	color: #ffffff;
	cursor: pointer;
	transition: all 0.15s ease;
}
.rvs-btn-primary:hover {
	background: #374151;
	border-color: #374151;
}

/* Mobile: bottom sheet */
@media (max-width: 767px) {
	.rvs-modal {
		margin: auto 0 0;
		max-width: 100%;
		border-radius: 16px 16px 0 0;
	}
	.rvs-modal__card {
		padding: 24px 20px 32px;
	}
	.rvs-modal__actions {
		flex-direction: column-reverse;
	}
	.rvs-btn-ghost,
	.rvs-btn-primary {
		width: 100%;
		justify-content: center;
	}
}

/* Legacy container fallback */
.rvs-custom-plus-size-wrap {
	display: none;
}

/* ==========================================================================
   HD Amazon Variations - Master Spec v2 Stylesheet Integration
   Pixel-perfect styling matching user specification
   ========================================================================== */

/* Prevent flash of theme UI + hide it permanently once active */
.hdav-pending form.variations_form table.variations,
.hdav-pending form.variations_form .variations {
	visibility: hidden;
	min-height: 150px;
}

form.hdav-active table.variations,
form.hdav-active .variations,
form.hdav-active .reset_variations,
form.hdav-active tr.hdav-native-row,
form.hdav-active .hdav-native-row {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* Kill theme leftover swatch pills, tooltips, and redundant wrappers */
form.hdav-active [class*="swatch"]:not(.hdav-root *),
form.hdav-active [class*="swatches"]:not(.hdav-root *),
form.hdav-active .tooltip,
form.hdav-active [role="tooltip"],
form.hdav-active .rvs-wrap,
form.hdav-active .theme-swatch-pills {
	display: none !important;
}

/* Root Container */
.hdav-root {
	margin: 16px 0 10px;
	font-family: inherit;
	color: #0F1111;
	-webkit-tap-highlight-color: transparent;
}

.hdav-root *,
.hdav-root *::before,
.hdav-root *::after {
	box-sizing: border-box;
}

.hdav-group {
	margin: 0 0 16px;
}

.hdav-label {
	font-size: 15px;
	color: #565959;
	margin-bottom: 8px;
	line-height: 1.4;
}

.hdav-label strong,
.hdav-label .hdav-val {
	color: #0F1111;
	font-weight: 700;
}

.hdav-root button {
	font: inherit;
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	text-transform: none;
	letter-spacing: 0;
	box-shadow: none;
}

/* Colour Cards - Single Row with Manual Horizontal Swipe on All Viewports */
.hdav-group--colour .hdav-track {
	display: flex !important;
	flex-wrap: nowrap !important;
	overflow-x: auto !important;
	overflow-y: hidden !important;
	gap: 10px !important;
	padding: 4px 4px 12px 4px !important;
	margin: 0 !important;
	scroll-snap-type: x mandatory !important;
	-webkit-overflow-scrolling: touch !important;
	touch-action: pan-x !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
	scrollbar-width: thin !important;
	scrollbar-color: #cbd5e1 #f1f5f9 !important;
	cursor: grab;
}
.hdav-group--colour .hdav-track:active,
.hdav-group--colour .hdav-track.is-dragging {
	cursor: grabbing;
}
.hdav-group--colour .hdav-track::-webkit-scrollbar {
	height: 6px !important;
	display: block !important;
}
.hdav-group--colour .hdav-track::-webkit-scrollbar-track {
	background: #f1f5f9 !important;
	border-radius: 999px !important;
}
.hdav-group--colour .hdav-track::-webkit-scrollbar-thumb {
	background: #cbd5e1 !important;
	border-radius: 999px !important;
	transition: background 0.2s ease !important;
}
.hdav-group--colour .hdav-track::-webkit-scrollbar-thumb:hover {
	background: #94a3b8 !important;
}

.hdav-card {
	position: relative;
	width: 92px !important;
	min-width: 92px !important;
	max-width: 92px !important;
	flex: 0 0 92px !important;
	scroll-snap-align: start !important;
	user-select: none !important;
	-webkit-user-select: none !important;
	padding: 0;
	margin: 0;
	text-align: left;
	cursor: pointer;
	background: #ffffff;
	color: #0F1111;
	border: 1px solid #D5D9D9;
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.hdav-card__img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1.15;
	background: #ffffff;
	border-bottom: 1px solid #E7E7E7;
	overflow: hidden;
	position: relative;
}

.hdav-card__img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	background: #ffffff;
}

.hdav-card__name {
	display: none;
	padding: 4px 8px 0;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
}

.hdav-card__price {
	display: block;
	padding: 6px 8px 0;
	font-size: 14px;
	line-height: 1.2;
	white-space: nowrap;
	font-weight: 600;
	color: #0F1111;
}

.hdav-card__mrp {
	display: block;
	padding: 2px 8px 8px;
	font-size: 12px;
	color: #565959;
	text-decoration: line-through;
	min-height: 22px;
}

.hdav-card:hover {
	border-color: #888C8C;
}

.hdav-card[aria-checked="true"],
.hdav-card.is-selected {
	border: 2px solid #2162A1 !important;
	box-shadow: 0 0 0 3px rgba(33, 98, 165, .18) !important;
}

.hdav-card[aria-checked="true"] .hdav-card__img {
	margin: -1px -1px 0;
}

/* Size Buttons */
.hdav-group--size .hdav-track {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.hdav-btn {
	position: relative;
	min-width: 48px;
	height: 40px;
	padding: 0 16px;
	cursor: pointer;
	background: #ffffff;
	color: #0F1111;
	border: 1px solid #D5D9D9;
	border-radius: 8px;
	font-size: 15px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: border-color .15s ease, background .15s ease;
	overflow: hidden;
}

.hdav-btn:hover {
	border-color: #888C8C;
	background: #F7FAFA;
}

.hdav-btn[aria-checked="true"],
.hdav-btn.is-selected {
	border: 2px solid #2162A1 !important;
	background: #EDFDFF !important;
	color: #0F1111 !important;
	font-weight: 700 !important;
	padding: 0 15px;
}

/* Unavailable */
.hdav-card.is-unavailable,
.hdav-btn.is-unavailable {
	opacity: .5;
	border-style: dashed;
	cursor: not-allowed;
}

.hdav-btn.is-unavailable {
	color: #8a8a8a;
}

.hdav-card.is-unavailable::after,
.hdav-btn.is-unavailable::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(to top right, transparent calc(50% - .5px), #9a9a9a 50%, transparent calc(50% + .5px));
}

/* Focus */
.hdav-card:focus-visible,
.hdav-btn:focus-visible,
.hdav-clear:focus-visible,
.hdav-chart__toggle:focus-visible {
	outline: 2px solid #007185;
	outline-offset: 2px;
}

/* Inline Size Chart Expander */
.hdav-chart {
	margin: 6px 0 16px;
}

.hdav-chart__toggle {
	background: none;
	border: 0;
	padding: 0;
	color: #007185;
	font-size: 15px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 500;
	line-height: 1.4;
}

.hdav-chart__toggle:hover {
	color: #C7511F;
	text-decoration: underline;
}

.hdav-chev-icon {
	display: inline-block;
	vertical-align: middle;
	transition: transform .2s ease;
}

.hdav-chart__toggle[aria-expanded="true"] .hdav-chev-icon {
	transform: rotate(180deg);
}

.hdav-chart__panel {
	margin-top: 10px;
	padding: 16px;
	border: 1px solid #D5D9D9;
	border-radius: 8px;
	background: #ffffff;
	overflow-x: auto;
	max-width: 100%;
}

.hdav-chart__panel table,
table.hdav-size-table {
	border-collapse: collapse;
	width: 100%;
	font-size: 14px;
	margin-bottom: 12px;
}

.hdav-chart__panel th,
.hdav-chart__panel td,
table.hdav-size-table th,
table.hdav-size-table td {
	border: 1px solid #e3e6e6;
	padding: 8px 12px;
	text-align: center;
	white-space: nowrap;
}

.hdav-chart__panel th,
table.hdav-size-table th {
	background: #f7fafa;
	font-weight: 600;
	color: #0F1111;
}

.hdav-size-guide-tip {
	font-size: 13px;
	color: #565959;
	border-top: 1px solid #eef0f0;
	padding-top: 10px;
	margin-top: 10px;
}

.hdav-size-guide-tip p {
	margin: 0 0 6px;
	color: #0F1111;
}

.hdav-size-guide-tip ul {
	margin: 0;
	padding-left: 18px;
}

.hdav-size-guide-tip li {
	margin-bottom: 4px;
}

.hdav-chart__panel[hidden] {
	display: none;
}

/* Clear Link */
.hdav-clear {
	display: inline-block;
	font-size: 13px;
	color: #565959;
	text-decoration: none;
	margin: 4px 0 10px;
}

.hdav-clear:hover {
	color: #007185;
	text-decoration: underline;
}

.hdav-clear[hidden] {
	display: none;
}

/* Amazon Dynamic Price Block */
.hdav-price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 10px;
	margin-top: 8px;
}

.hdav-price__off {
	color: #CC0C39;
	font-size: 26px;
	font-weight: 300;
	line-height: 1;
}

.hdav-price__now {
	font-size: 30px;
	font-weight: 500;
	color: #0F1111;
	line-height: 1;
}

.hdav-price__mrp {
	width: 100%;
	font-size: 14px;
	color: #565959;
	margin-top: 4px;
}

.hdav-price__mrp s {
	text-decoration: line-through;
}

/* Toast Notification */
.hdav-toast {
	position: fixed;
	bottom: 24px;
	right: 24px;
	background: #0f1111;
	color: #ffffff;
	padding: 12px 18px;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	font-size: 14px;
	line-height: 1.4;
	z-index: 999999;
	display: flex;
	align-items: center;
	gap: 10px;
	opacity: 0;
	transform: translateY(12px);
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.hdav-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.hdav-toast b {
	color: #ffd814;
}

/* Mobile Responsive */
@media (max-width: 767px) {
	.hdav-group--colour .hdav-track {
		flex-wrap: nowrap !important;
		overflow-x: auto !important;
		gap: 8px !important;
		padding: 3px 3px 10px !important;
		margin: 0 !important;
		scroll-snap-type: x mandatory !important;
		-webkit-overflow-scrolling: touch !important;
		scrollbar-width: thin !important;
		overscroll-behavior-x: contain;
	}

	.hdav-group--colour .hdav-track::-webkit-scrollbar {
		height: 4px !important;
		display: block !important;
	}

	.hdav-card {
		width: 92px !important;
		min-width: 92px !important;
		max-width: 92px !important;
		flex: 0 0 92px !important;
		scroll-snap-align: start !important;
	}

	.hdav-btn {
		min-width: 48px;
		height: 44px;
	}

	.hdav-root.hdav-show-name--always .hdav-card__name {
		display: block;
	}
}

@media (max-width: 360px) {
	.hdav-card {
		width: 92px;
		flex-basis: 92px;
	}
	.hdav-btn {
		padding: 0 12px;
	}
}

@media (min-width: 1200px) {
	.hdav-card {
		width: 96px;
		flex-basis: 96px;
	}
}

/* Gallery Variation Sync (Desktop & Mobile) */
.flexy-item.is-hidden,
.flexy-pills ol li.is-hidden,
.flexy-item[hidden],
.flexy-pills ol li[hidden],
.spf-sw-slide.is-hidden,
.spf-sw-dot.is-hidden {
	display: none !important;
}

@media (min-width: 1000px) {
	.flexy-items > .flexy-item {
		height: auto !important;
		min-height: 400px;
	}
	.flexy-items > .flexy-item.flexy-item-is-visible {
		height: auto !important;
	}
	.flexy-view {
		min-height: 400px;
	}
}



