/**
 * Soft Variation Swatches - Frontend Styles
 * (c) Softaculous Team
 */

:root{
	--svs-item-width: 30px;
	--svs-item-height: 30px;
	--svs-item-font-size: 16px;
	--svs-tick: url("data:image/svg+xml;utf8,%3Csvg filter='drop-shadow(0px 0px 2px rgb(0 0 0 / .8))' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='4' d='M4 16L11 23 27 7'/%3E%3C/svg%3E");
	--svs-cross: url("data:image/svg+xml;utf8,%3Csvg filter='drop-shadow(0px 0px 5px rgb(255 255 255 / .6))' xmlns='http://www.w3.org/2000/svg' width='72px' height='72px' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23ff0000' stroke-linecap='round' stroke-width='0.6' d='M5 5L19 19M19 5L5 19'/%3E%3C/svg%3E");
}

/* Hide the native select dropdown once swatches are rendered */
.soft-variation-swatches .soft-variation-raw-select{
	display: none !important;
}

/* Swatches wrapper list */
ul.variable-items-wrapper{
	display: flex;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 8px;
	box-sizing: border-box;
}

ul.variable-items-wrapper::after{
	content: "";
	display: block;
	clear: both;
}

/* Individual swatch item */
li.variable-item{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--svs-item-width);
	height: var(--svs-item-height);
	float: left;
	margin: 0;
	padding: 0;
	border: 2px solid #dedede;
	box-sizing: border-box;
	cursor: pointer;
	position: relative;
	outline: none;
	transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease, opacity .2s ease;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	background-position: center center;
	background-repeat: no-repeat;
	background-size: cover;
}

li.variable-item:hover{
	border-color: #090949;
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(37, 99, 235, .25);
}

li.variable-item:focus{
	border-color: #090949;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, .35);
}

/* Inner contents wrapper - inherits the shape radius so children match the swatch shape */
.variable-item-contents{
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: inherit;
	overflow: hidden;
}

/* ---- Shape styles ---- */
.svs-style-rounded .variable-item{
	border-radius: 50%;
}

/* When rounded is selected, force square swatches (color/image/button) to be
   square so border-radius: 50% produces a perfect circle, not an oval/pill.
   Radio rows are excluded: they are auto-width text rows (input + label) and
   cramming them into a fixed circle truncates the text under the input. */
.svs-style-rounded .button-variable-item{
	width: var(--svs-item-width) !important;
	height: var(--svs-item-height) !important;
	min-width: var(--svs-item-width);
	max-width: var(--svs-item-width);
	padding: 0 !important;
	border-radius: 50%;
	/* overflow: hidden; */
}

/* Keep button text centered inside the circle */
.svs-style-rounded .button-variable-item .variable-item-span-button{
	padding: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Rounded radio: the row keeps its auto width, the radius rounds the row ends.
   999px avoids the 50% ellipse that .svs-style-rounded .variable-item would
   apply to a wide text row. */
.svs-style-rounded .radio-variable-item{
	border-radius: 999px;
}

.svs-style-squared .variable-item{
	border-radius: 4px;
}

/* ---- Color swatch ---- */
.variable-item-span-color{
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	background-size: cover;
	background-position: center;
}

/* ---- Image swatch ---- */
.variable-item-image{
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	border-radius: inherit;
	display: block;
}

/* ---- Button swatch ---- */
.variable-item-span-button{
	display: flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-width: 100%;
	height: 100%;
	padding: 4px 10px;
	border-radius: inherit;
	font-size: var(--svs-item-font-size);
	font-weight: 500;
	line-height: 1.2;
	color: #1f2937;
	background-color: transparent;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	box-sizing: border-box;
}

.button-variable-item{
	width: auto !important;
	min-width: var(--svs-item-width);
	padding: 0 4px;
}

/* ---- Radio swatch ---- */
ul.radio-variable-items-wrapper{
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
}

li.variable-item.radio-variable-item,
.svs-style-rounded li.variable-item.radio-variable-item,
.svs-style-squared li.variable-item.radio-variable-item{
    float: none;
    display: flex;
    align-items: center;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
}

.radio-variable-item .variable-item-contents{
    width: auto;
    height: auto;
    overflow: visible;
    justify-content: flex-start;
}

.variable-item-radio-input-wrapper{
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.variable-item-radio-input{
    width: 16px;
    height: 16px;
    margin: 0 8px 0 0;
    cursor: pointer;
    accent-color: #094349;
}

.variable-item-radio-value-wrapper{
    font-size: var(--svs-item-font-size);
    color: #1f2937;
    cursor: pointer;
}

li.variable-item.radio-variable-item.selected{
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

li.variable-item.radio-variable-item.selected::after{
    display: none !important;
}

/* ---- Selected state ---- */
.variable-item.selected{
	border-color: #090949;
	box-shadow: 0 0 0 1px rgba(37, 99, 235, .4);
}

.variable-item.selected::after{
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--svs-tick);
	background-position: center;
	background-repeat: no-repeat;
	background-size: 70% 70%;
	pointer-events: none;
}

/* Radio rows show selection via border/background + the checked input,
   not the tick overlay (which would cover the label text) */
.radio-variable-item.selected::after{
	display: none;
}

.radio-variable-item.selected{
	background-color: #e8eaf6;
}

/* ---- Disabled / Out-of-stock behaviors ---- */
.variable-item.disabled{
	cursor: not-allowed;
	pointer-events: auto;
}

/* Disabled radio button */
.radio-variable-item.disabled::after{
    display: none !important;
}

.radio-variable-item.disabled input,
.radio-variable-item.disabled .variable-item-radio-value-wrapper{
    cursor: not-allowed !important;
}

/* Blur with cross and Blur witout cross */
.svs-behavior-blur .variable-item.disabled .variable-item-contents,
.svs-behavior-blur-no-cross .variable-item.disabled .variable-item-contents {
    opacity: .5;
    filter: grayscale(.6) blur(.5px);
}

.svs-behavior-blur .variable-item.disabled::after{
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--svs-cross);
	background-position: center;
	background-repeat: no-repeat;
	background-size: 40px;
	pointer-events: none;
    z-index: 1;
}

.svs-behavior-blur .variable-item.disabled:hover::after {
    inset: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    transform: none !important;
    border: none !important;
    background-image: var(--svs-cross) !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
}

.svs-behavior-blur-no-cross .variable-item.disabled::after{
	display: none;
}

/* Hide entirely */
.svs-behavior-hide .variable-item.disabled{
	display: none !important;
}

/* ---- Tooltip ---- */
.svs-tooltip .variable-item[data-svs-tooltip]{
	position: relative;
}

.svs-tooltip .variable-item[data-svs-tooltip]:hover::before{
	content: attr(data-svs-tooltip);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: #1f2937;
	color: #fff;
	font-size: 12px;
	line-height: 1.4;
	padding: 5px 10px;
	border-radius: 4px;
	white-space: nowrap;
	z-index: 99;
	pointer-events: none;
	opacity: 1;
	transition: opacity .2s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.svs-tooltip .variable-item[data-svs-tooltip]:hover::after{
	content: "";
	position: absolute;
	bottom: calc(100% + 2px);
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	z-index: 99;
	pointer-events: none;
}

/* When the item is near the top of the viewport, show tooltip below */
.svs-tooltip .variable-item.wvs-tooltip-position-bottom[data-svs-tooltip]:hover::before{
	bottom: auto;
	top: calc(100% + 8px);
}

.svs-tooltip .variable-item.wvs-tooltip-position-bottom[data-svs-tooltip]:hover::after{
	bottom: auto;
	top: calc(100% + 2px);
	border-top-color: transparent;
	border-bottom-color: #1f2937;
}

/* ---- Archive / Shop swatches ---- */
.soft-variation-swatches-archive-wrapper{
	margin: 10px 0;
}

.soft-variation-swatches-archive-wrapper ul.variable-items-wrapper{
	justify-content: flex-start;
}

.soft-variation-swatches-archive-wrapper .variable-item{
	width: var(--svs-item-width);
	height: var(--svs-item-height);
}

.soft-variation-swatches-archive-wrapper .variable-item-span-button{
	font-size: var(--svs-item-font-size);
	padding: 0 4px;
}

/* ---- Mobile adjustments ---- */
.svs-mobile .variable-item{
	width: calc(var(--svs-item-width) * 1.1);
	height: calc(var(--svs-item-height) * 1.1);
}

.svs-mobile .variable-item-span-button{
	font-size: calc(var(--svs-item-font-size) * 1.05);
}

.woocommerce div.product form.cart table.variations td, 
.woocommerce div.product form.cart table.variations th {
vertical-align:top !important;
}

@media (max-width: 768px){
	ul.variable-items-wrapper{
		gap: 6px;
	}

	li.variable-item{
		width: calc(var(--svs-item-width) * 1.05);
		height: calc(var(--svs-item-height) * 1.05);
	}

	.variable-item-span-button{
		font-size: calc(var(--svs-item-font-size) * 1.05);
	}

	.svs-tooltip .variable-item[data-wvstooltip]:hover::before{
		font-size: 11px;
		padding: 4px 8px;
	}
}