/**
 * Mango-style size selector for variable products (konte-child).
 *
 * Layered on top of the WooBoost "label" size swatches. konte-size-selector.js
 * adds the .kss class (and .kss--default / .kss--collapsed states) plus the
 * collapsed row, stock labels and selection arrow. WooCommerce variation logic
 * is untouched — if the JS/CSS is absent the native swatches still work.
 */

/* Full panel width (the group/wrapper otherwise shrink to the swatches). */
body.konte-variable-pdp .kss {
	position: relative;
	width: 100%;
	display: block;
}

/* ---------- Expanded list ---------- */
body.konte-variable-pdp .kss .wcboost-variation-swatches__wrapper {
	display: flex;
	flex-direction: column;
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid #e5e5e5;
	max-height: 200px;            /* ~4 full rows + a peek of the 5th */
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 0, 0, 0.35) transparent;
}

body.konte-variable-pdp .kss .wcboost-variation-swatches__wrapper::-webkit-scrollbar {
	width: 4px;
}

body.konte-variable-pdp .kss .wcboost-variation-swatches__wrapper::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.3);
	border-radius: 4px;
}

body.konte-variable-pdp .kss .wcboost-variation-swatches__wrapper::-webkit-scrollbar-track {
	background: transparent;
}

body.konte-variable-pdp .kss .wcboost-variation-swatches__item {
	display: flex;
	align-items: center;
	width: 100%;
	max-width: none;
	min-height: 44px;
	margin: 0;
	padding: 0 14px;
	border: 0;
	border-radius: 0;
	background: transparent;
	cursor: pointer;
	font-size: 0.95rem;
	color: #161619;
	box-sizing: border-box;
	transition: background-color 0.2s ease;
}

body.konte-variable-pdp .kss .wcboost-variation-swatches__item:hover {
	background: #fafafa;
}

body.konte-variable-pdp .kss .wcboost-variation-swatches__item .wcboost-variation-swatches__name {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.2;
}

/* Stock label (injected by JS), pushed to the right */
body.konte-variable-pdp .kss .kss-stock {
	margin-left: auto;
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #c0392b;
	white-space: nowrap;
}

body.konte-variable-pdp .kss .kss-stock--out {
	color: #999;
}

/* Selection arrow (injected by JS) — visible only on the selected row, and
   only once the shopper has made a choice (not for the default highlight). */
body.konte-variable-pdp .kss .wcboost-variation-swatches__item .kss-arrow {
	margin-left: 12px;
	opacity: 0;
	transition: opacity 0.2s ease;
}

body.konte-variable-pdp .kss:not(.kss--default) .wcboost-variation-swatches__item.selected .kss-arrow {
	opacity: 1;
}

/* Default (pre-selection) highlight = grey background on the default size */
body.konte-variable-pdp .kss.kss--default .wcboost-variation-swatches__item.selected {
	background: #f2f2f2;
}

/* User-selected highlight */
body.konte-variable-pdp .kss:not(.kss--default) .wcboost-variation-swatches__item.selected {
	background: #f7f7f7;
	font-weight: 500;
}

/* Out-of-stock rows */
body.konte-variable-pdp .kss .wcboost-variation-swatches__item.kss-oos {
	color: #b3b3b3;
	cursor: not-allowed;
}

/* ---------- Collapsed row (after a size is chosen) ---------- */
body.konte-variable-pdp .kss-collapsed-row {
	display: none;
	align-items: center;
	width: 100%;
	min-height: 44px;
	padding: 0 14px;
	border-top: 1px solid #e5e5e5;
	border-bottom: 1px solid #e5e5e5;
	background: #fff;
	cursor: pointer;
	font-size: 0.95rem;
	color: #161619;
	box-sizing: border-box;
}

body.konte-variable-pdp .kss-collapsed-row .kss-cr-stock {
	margin-left: auto;
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #c0392b;
	white-space: nowrap;
}

body.konte-variable-pdp .kss-collapsed-row .kss-chevron {
	margin-left: 14px;
	font-size: 0.9rem;
	line-height: 1;
}

/* Collapsed state: hide the list, show the single row */
body.konte-variable-pdp .kss.kss--collapsed .wcboost-variation-swatches__wrapper {
	display: none;
}

body.konte-variable-pdp .kss.kss--collapsed .kss-collapsed-row {
	display: flex;
}

/* ---------- Disable the swatch hover tooltip ----------
   The wcboost plugin renders a hover tooltip via ::before (arrow) and ::after
   (label bubble) on each swatch item. Remove it (does not affect the visible
   size labels, which use the separate __name element). */
body.konte-variable-pdp .product-type-variable .wcboost-variation-swatches--has-tooltip .wcboost-variation-swatches__item::before,
body.konte-variable-pdp .product-type-variable .wcboost-variation-swatches--has-tooltip .wcboost-variation-swatches__item::after {
	display: none !important;
	content: none !important;
}

/* ---------- Remove the swatch ring on size rows ----------
   The plugin draws a box-shadow "ring" (1px default, 2px hover/focus/selected)
   that looks like a rounded border. Remove it on the size list; hover uses the
   grey background instead, and keyboard focus keeps a subtle outline. */
body.konte-variable-pdp .product-type-variable .wcboost-variation-swatches__item,
body.konte-variable-pdp .product-type-variable .wcboost-variation-swatches__item:hover,
body.konte-variable-pdp .product-type-variable .wcboost-variation-swatches__item:focus,
body.konte-variable-pdp .kss .wcboost-variation-swatches__item.selected {
	box-shadow: none !important;
}

body.konte-variable-pdp .kss .wcboost-variation-swatches__item:focus-visible {
	outline: 2px solid rgba(0, 0, 0, 0.2);
	outline-offset: -2px;
}

/* ---------- Remove the swatch __name outline ring (all states) ----------
   The plugin draws outline:1px + outline-offset:3px around the swatch __name
   on hover AND when selected, which appears as a round/elliptical border
   around the size (and colour) name. Remove it in every state — selection is
   shown by the row background / colour-name, and the row gets a grey hover. */
body.konte-variable-pdp .product-type-variable .wcboost-variation-swatches--default .wcboost-variation-swatches__name {
	outline: none !important;
	outline-offset: 0 !important;
}
