/* TTK Variation Swatches — front-end styles (namespace: ttksw-) */

/* Hide the native dropdown once swatches take over (JS adds .ttksw-replaced). */
.woocommerce table.variations .value select.ttksw-replaced {
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.ttksw-swatches {
	--ttksw-size: 32px;
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	list-style: none;
	margin: 0 0 15px;
	padding: 0;
}

.ttksw-swatch {
	align-items: center;
	border: 0;
	cursor: pointer;
	display: inline-flex;
	height: var(--ttksw-size);
	justify-content: center;
	line-height: 1;
	margin: 0;
	overflow: visible;
	padding: 0;
	position: relative;
	width: var(--ttksw-size);
}

.woocommerce div.product .summary table.variations,
.woocommerce div.product .summary table.variations tr,
.woocommerce div.product .summary table.variations tr td {
    display: block;
}

.woocommerce div.product .summary table.variations td.label label {
    font-weight: 400;
    color: #000000;
    text-decoration: underline;
}


/* Selected-state color name: absolute under the active swatch only. */
.ttksw-swatch__name {
	display: none;
	left: 50%;
	position: absolute;
	top: calc(100% + 10px);
	transform: translateX(-50%);
	white-space: nowrap;
}

.ttksw-swatch--selected .ttksw-swatch__name {
	display: block;
	color: #111;
	font-size: 12px;
	letter-spacing: 0.02em;
	line-height: 1.2;
}


/* Shape: applied through the inline --ttksw-radius variable set by PHP from
   the saved setting. Scoped to swatch-type lists only — label-type buttons
   use their own --ttksw-label-radius so the two styles stay independent. */
.ttksw-swatches.ttksw-type--swatch .ttksw-swatch {
	border-radius: var(--ttksw-radius, 50%);
}

.ttksw-swatches.ttksw-type--swatch .ttksw-swatch:hover,
.ttksw-swatches.ttksw-type--swatch .ttksw-swatch:focus-visible,
.ttksw-swatches.ttksw-type--swatch .ttksw-swatch--selected {
	border-radius: var(--ttksw-radius, 50%);
}

/* The image inside an image-type swatch must be clipped to the same shape. */
.ttksw-swatches .ttksw-type--image img,
.ttksw-swatches .ttksw-type--image .ttksw-swatch__color {
	border-radius: var(--ttksw-radius, 50%);
	border: 1px solid rgba(0, 0, 0, 0.25);
}

.ttksw-swatches .ttksw-swatch:hover,
.ttksw-swatches .ttksw-swatch:focus-visible {
	border-color: currentColor;
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ttksw-swatches .ttksw-swatch--selected {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(0, 0, 0, 0.75);
}

.ttksw-shape--circle span.ttksw-swatch__color {
    border-radius: 100%;
    border: 1px solid rgba(0, 0, 0, 0.25);
    box-shadow: rgb(191 191 191 / 80%) 0 0 1px;
}

.ttksw-swatch__color {
	display: block;
	height: 100%;
	width: 100%;
}

.ttksw-swatch__label {
	color: inherit;
	font-size: 12px;
	padding: 2px 6px;
	text-align: center;
}

.ttksw-type--image img {
	height: 100%;
	object-fit: cover;
	width: 100%;
}

/* Options with no matching variation for the current selection. */
.ttksw-swatches .ttksw-swatch--unavailable {
	cursor: not-allowed;
	opacity: 0.3;
	pointer-events: none;
}

/* Label-type buttons (e.g. S / M / L): rectangular with a small fixed
   corner radius. Independent from the Swatch shape setting — editing either
   style never affects the other. */
.ttksw-type--label.ttksw-swatches {
	gap: 12px;
}

.ttksw-type--label .ttksw-swatch {
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: var(--ttksw-label-radius, 5px);
	height: auto;
	min-width: calc(var(--ttksw-size, 32px) + 8px);
	padding: 10px 12px;
	width: auto;
}

.ttksw-type--label .ttksw-swatch:hover,
.ttksw-type--label .ttksw-swatch:focus-visible,
.ttksw-type--label .ttksw-swatch--selected {
	border-radius: var(--ttksw-label-radius, 5px);
}

.ttksw-type--label .ttksw-swatch .ttksw-swatch__label {
	font-size: 14px;
	letter-spacing: 0.03em;
	padding: 0;
	white-space: nowrap;
}

.ttksw-type--label .ttksw-swatch--selected {
	background: #111;
	border-color: #111;
	color: #fff;
}

/* Small hint above the variations table on products pairing a swatch
   attribute (e.g. Color) with other required attributes (e.g. Size). */
.ttksw-size-note {
    color: #5c5c5c;
    font-size: 12px;
    line-height: 1.4;
    margin: 5px 0 5px;
}

/* Hide once every swatch/label attribute has a value chosen. */
.ttksw-size-note.ttksw-hidden {
	display: none;
}

/* --- Low-stock badge (#19): circular overlay on the product image ------- */

/* Anchor for the absolutely-positioned badge. Core WC already sets this, so
   this is protection against themes resetting it. */
.woocommerce-product-gallery {
	position: relative;
}

.ttksw-low-stock-badge {
    align-items: center;
    background: #e91e63;
    border: 1px solid #e91e63;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    color: #fff;
    display: flex;
    font-size: 11px;
    font-weight: 400;
    justify-content: center;
    left: 14px;
    letter-spacing: 0.02em;
    line-height: 1.3;
    padding: 10px 14px;
    pointer-events: none;
    position: absolute;
    text-align: center;
    top: 100px;
	height: 100px;
    width: 100px;
    z-index: 5;
}
.ttksw-low-stock-badge.ttksw-hidden {
	display: none;
}
@media (max-width: 1023px) {
	.ttksw-low-stock-badge {
		top: 40px;
		width: 90px;
		height: 90px;
		letter-spacing: 0;
		line-height: 1.3;
		font-size: 10px;
	}
}
@media (max-width: 480px) {
	.ttksw-low-stock-badge {
		line-height: 1.3;
		padding: 5px 5px;
		width: 80px;
		height: 80px;
	}
}
