/**
 * Variation Swatches Styles - Tessi Shop
 */

.tessi-swatch-select-hidden,
.woocommerce-select:has(.tessi-swatch-select-hidden),
.tessi-swatches-wrap .woocommerce-select {
	display: none !important;
}

/* Product Gallery: eliminate duplicate zoom / loupe icon */
.woocommerce-product-gallery__trigger img,
.woocommerce-product-gallery__trigger .emoji,
.woocommerce-product-gallery__trigger > span {
	display: none !important;
}

.woocommerce-product-gallery__trigger {
	width: 36px !important;
	height: 36px !important;
	line-height: 36px !important;
	text-align: center !important;
	font-size: 0 !important;
	overflow: hidden !important;
}

/* Variations Table Modern Layout */
.variations_form table.variations {
	width: 100%;
	display: block;
	border: none;
	margin-bottom: 12px;
}

.variations_form table.variations tbody,
.variations_form table.variations tr {
	display: block;
	width: 100%;
	border: none;
}

.variations_form table.variations th.label {
	display: block;
	width: 100%;
	text-align: left;
	padding: 0 0 8px 0;
	font-size: 15px;
	font-weight: 600;
	color: #1f2937;
	border: none;
}

.variations_form table.variations th.label label {
	display: inline-flex;
	align-items: center;
	font-weight: 600;
	color: #1f2937;
}

.variations_form table.variations td.value {
	display: block;
	width: 100%;
	padding: 0;
	border: none;
}

.tessi-swatches-wrap {
	margin: 0 0 16px;
	clear: both;
}

.tessi-swatches,
ul.xt_woovs-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.tessi-swatch,
.xt_woovs-swatches .swatch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	position: relative;
	transition: all 0.15s ease-in-out;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	background: #fff;
	user-select: none;
	box-sizing: border-box;
}

/* Inner wrappers */
.tessi-swatch .swatch-inner,
.xt_woovs-swatches .swatch .swatch-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	overflow: hidden;
}

/* Image Swatches */
.tessi-swatch--image,
.xt_woovs-swatches .swatch.swatch-image {
	width: 38px;
	height: 38px;
	padding: 2px;
}

.tessi-swatch--image img,
.xt_woovs-swatches .swatch.swatch-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 2px;
	display: block;
}

/* Color Swatches */
.tessi-swatch--color,
.xt_woovs-swatches .swatch.swatch-color {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	padding: 2px;
}

.tessi-swatch__color-dot {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	display: block;
	box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

/* Label / Button Swatches */
.tessi-swatch--label,
.xt_woovs-swatches .swatch.swatch-label {
	padding: 6px 12px;
	min-width: 36px;
	height: 32px;
	font-size: 13px;
	font-weight: 500;
	color: #333;
	border-radius: 4px;
	background: #f8fafc;
	text-align: center;
}

/* Hover state */
.tessi-swatch:hover,
.xt_woovs-swatches .swatch:hover {
	border-color: #64748b;
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* Selected state */
.tessi-swatch.selected,
.xt_woovs-swatches .swatch.selected,
.xt_woovs-swatches .swatch.xt_woovs-selected {
	border-color: #d02c1e !important; /* Tessi Brand Red */
	box-shadow: 0 0 0 2px #d02c1e !important;
}

.tessi-swatch--label.selected,
.xt_woovs-swatches .swatch.swatch-label.selected {
	background-color: #d02c1e !important;
	color: #ffffff !important;
}

/* Tooltip on hover */
.tessi-swatch[data-tooltip]::before {
	content: attr(data-tooltip);
	position: absolute;
	bottom: calc(100% + 7px);
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	padding: 4px 8px;
	background: #111827;
	color: #ffffff;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	border-radius: 4px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease, transform 0.15s ease;
	pointer-events: none;
	z-index: 100;
	box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.tessi-swatch[data-tooltip]::after {
	content: '';
	position: absolute;
	bottom: calc(100% + 1px);
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	border: 6px solid transparent;
	border-top-color: #111827;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease, transform 0.15s ease;
	pointer-events: none;
	z-index: 100;
}

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

/* Disabled state */
.tessi-swatch.disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
	position: relative;
}

.tessi-swatch.disabled::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 1px;
	background: #ff0000;
	transform: rotate(45deg);
}
