/**
 * Sitisocial Framework
 * Product Configurator
 *
 * @version 2.0.0
 */


/* =========================================================
   VARIABLES FALLBACK
   ========================================================= */

.ssf-product-configurator,
.ssf-product-quantity-configurator {
	--ssf-pc-text: var(--ssf-color-text, #171717);
	--ssf-pc-muted: var(--ssf-color-text-muted, #686868);
	--ssf-pc-dark: var(--ssf-color-dark, #171717);
	--ssf-pc-primary: var(--ssf-color-primary, #e30613);
	--ssf-pc-white: var(--ssf-color-white, #ffffff);
	--ssf-pc-border: var(--ssf-color-border, #dedede);
	--ssf-pc-border-dark: var(--ssf-color-border-dark, #a9a9a9);
	--ssf-pc-soft: var(--ssf-color-background-soft, #f4f4f4);
}


/* =========================================================
   WOOCOMMERCE NATIVE CONTROLS
   ========================================================= */

/*
 * Il select deve restare nel DOM per WooCommerce,
 * ma non deve essere visibile.
 */
.ssf-native-variation-select {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}


/*
 * Stessa logica per la quantità nativa.
 */
.ssf-native-quantity {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}


/*
 * Nasconde il reset nativo "Svuota".
 */
form.variations_form .reset_variations {
	display: none !important;
}


/* =========================================================
   WOOCOMMERCE VARIATIONS TABLE
   ========================================================= */

form.variations_form table.variations {
	display: block;
	width: 100%;
	margin: 0 !important;
	border: 0;
}

form.variations_form table.variations tbody {
	display: block;
	width: 100%;
}

form.variations_form
tr.ssf-product-option-row--configurator {
	display: block !important;
	width: 100%;
	margin: 0;
	padding: 0 !important;
}

form.variations_form
tr.ssf-product-option-row--configurator > th.label {
	display: none !important;
}

form.variations_form
tr.ssf-product-option-row--configurator > td.value {
	display: block !important;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
}


/* =========================================================
   CONFIGURATOR WRAPPER
   ========================================================= */

.ssf-product-configurator {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	min-width: 0;
	color: var(--ssf-pc-text);
}


/* =========================================================
   CONFIGURATOR SECTIONS
   ========================================================= */

.ssf-product-configurator__section {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	min-width: 0;
	margin: 0;
}

.ssf-product-configurator__section[hidden] {
	display: none !important;
}


/* =========================================================
   SECTION HEADERS
   ========================================================= */

.ssf-product-configurator__family-header,
.ssf-product-configurator__variant-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-width: 0;
}


/* =========================================================
   TITLES
   ========================================================= */

.ssf-product-configurator__title {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 9px;
	min-width: 0;
	margin: 0 !important;
	padding: 0;
	color: var(--ssf-pc-text) !important;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.25;
	text-transform: none;
	letter-spacing: normal;
}


/*
 * Soltanto il primo span è il numero dello step.
 * Gli altri span non devono diventare cerchi.
 */
.ssf-product-configurator__title > span:first-child {
	display: inline-flex;
	flex: 0 0 28px;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border-radius: 50%;
	background: var(--ssf-pc-dark);
	color: var(--ssf-pc-white) !important;
	font-size: 12px;
	font-weight: 800;
	line-height: 1;
}


/*
 * Testo del titolo dello step.
 */
.ssf-product-configurator__title-label,
.ssf-product-configurator__title > span:not(:first-child) {
	display: inline;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--ssf-pc-text) !important;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	white-space: normal;
}


/* =========================================================
   FAMILY HEADER ACTIONS
   ========================================================= */

.ssf-product-configurator__family-actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 9px;
	margin-left: auto;
}


/*
 * Nome del colore selezionato.
 */
.ssf-product-configurator__color-summary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px 10px;
	border-radius: 999px;
	background: var(--ssf-pc-white);
	color: var(--ssf-pc-text);
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
	white-space: nowrap;
}


/*
 * Pulsante "Cambia colore".
 */
.ssf-product-configurator__change-family {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 4px 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--ssf-pc-primary);
	box-shadow: none;
	font: inherit;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

.ssf-product-configurator__change-family:hover,
.ssf-product-configurator__change-family:focus {
	border: 0;
	background: transparent;
	color: var(--ssf-pc-dark);
	box-shadow: none;
	text-decoration: underline;
}

.ssf-product-configurator__change-family:focus-visible {
	outline: 2px solid var(--ssf-pc-primary);
	outline-offset: 3px;
}

.ssf-product-configurator__change-family[hidden],
.ssf-product-configurator__color-summary[hidden] {
	display: none !important;
}


/* =========================================================
   STEP 1 — COLOR FAMILIES
   ========================================================= */

.ssf-product-configurator__section--families {
	padding: 14px;
	border: 1px solid var(--ssf-pc-border);
	border-radius: 12px;
	background: var(--ssf-pc-white);
}


/*
 * Quattro colonne compatte sulla scheda desktop.
 */
.ssf-product-family-options {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
	width: 100%;
	min-width: 0;
}

.ssf-product-family-option {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-width: 0;
	min-height: 48px;
	margin: 0;
	padding: 7px 8px;
	overflow: hidden;
	border: 1px solid var(--ssf-pc-border);
	border-radius: 8px;
	background: var(--ssf-pc-white);
	color: var(--ssf-pc-text);
	box-shadow: none;
	font: inherit;
	text-align: left;
	cursor: pointer;
	appearance: none;
	transition:
		border-color 160ms ease,
		box-shadow 160ms ease,
		background-color 160ms ease,
		transform 160ms ease;
}

.ssf-product-family-option:hover {
	border-color: var(--ssf-pc-dark);
	background: var(--ssf-pc-white);
	color: var(--ssf-pc-text);
	transform: translateY(-1px);
}

.ssf-product-family-option:focus-visible {
	outline: 2px solid var(--ssf-pc-primary);
	outline-offset: 2px;
}

.ssf-product-family-option.is-selected {
	border-color: var(--ssf-pc-primary);
	background: rgba(227, 6, 19, 0.035);
	color: var(--ssf-pc-text);
	box-shadow: 0 0 0 1px rgba(227, 6, 19, 0.16);
}


/* =========================================================
   COLOR VISUALS
   ========================================================= */

.ssf-product-family-option__visual,
.ssf-product-variant-option__visual {
	display: block;
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	border: 2px solid var(--ssf-pc-white);
	border-radius: 50%;
	background: var(--ssf-family-color, #dddddd);
	box-shadow:
		0 0 0 1px rgba(0, 0, 0, 0.19),
		inset 0 1px 2px rgba(255, 255, 255, 0.38);
}


/* =========================================================
   FAMILY LABEL
   ========================================================= */

.ssf-product-family-option__content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
	overflow: hidden;
}

.ssf-product-family-option__content strong {
	display: block;
	max-width: 100%;
	margin: 0;
	color: inherit;
	font-size: 11px;
	font-weight: 800;
	line-height: 1.1;
	text-transform: none;
	letter-spacing: normal;
	overflow-wrap: anywhere;
}


/*
 * Nascondiamo il numero di varianti:
 * riduce l'altezza e semplifica la scelta.
 */
.ssf-product-family-option__content small {
	display: none !important;
}


/* =========================================================
   STEP 1 COLLAPSED
   ========================================================= */

.ssf-product-configurator__section--collapsed {
	padding: 10px 12px;
	border: 1px solid var(--ssf-pc-border);
	border-radius: 10px;
	background: var(--ssf-pc-soft);
}

.ssf-product-configurator__section--collapsed
.ssf-product-family-options {
	display: none !important;
}

.ssf-product-configurator__section--collapsed
.ssf-product-configurator__family-header {
	min-height: 30px;
}

.ssf-product-configurator__section--collapsed
.ssf-product-configurator__title {
	font-size: 14px;
}


/* =========================================================
   STEP 2 — VARIANTS
   ========================================================= */

.ssf-product-configurator__section--variants {
	padding: 14px;
	border: 1px solid var(--ssf-pc-border);
	border-radius: 10px;
	background: var(--ssf-pc-soft);
}

.ssf-product-configurator__selected-family {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	padding: 6px 10px;
	border-radius: 999px;
	background: var(--ssf-pc-white);
	color: var(--ssf-pc-text);
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
	white-space: nowrap;
}


/* =========================================================
   VARIANT GRID
   ========================================================= */

.ssf-product-variant-options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	width: 100%;
	min-width: 0;
}

.ssf-product-variant-option {
	display: flex;
	align-items: center;
	gap: 9px;
	width: 100%;
	min-width: 0;
	min-height: 44px;
	margin: 0;
	padding: 8px 10px;
	overflow: hidden;
	border: 1px solid var(--ssf-pc-border);
	border-radius: 8px;
	background: var(--ssf-pc-white);
	color: var(--ssf-pc-text);
	box-shadow: none;
	font: inherit;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
	text-align: left;
	cursor: pointer;
	appearance: none;
	transition:
		border-color 160ms ease,
		box-shadow 160ms ease,
		background-color 160ms ease;
}

.ssf-product-variant-option:hover {
	border-color: var(--ssf-pc-dark);
	background: var(--ssf-pc-white);
	color: var(--ssf-pc-text);
}

.ssf-product-variant-option:focus-visible {
	outline: 2px solid var(--ssf-pc-primary);
	outline-offset: 2px;
}

.ssf-product-variant-option.is-selected {
	border-color: var(--ssf-pc-primary);
	background: rgba(227, 6, 19, 0.04);
	color: var(--ssf-pc-text);
	box-shadow: 0 0 0 1px rgba(227, 6, 19, 0.14);
}

.ssf-product-variant-option.is-disabled,
.ssf-product-variant-option:disabled {
	opacity: 0.42;
	cursor: not-allowed;
}

.ssf-product-variant-option__visual {
	width: 22px;
	height: 22px;
}

.ssf-product-variant-option__label {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	text-transform: none;
	letter-spacing: normal;
	overflow-wrap: anywhere;
}


/* =========================================================
   EMPTY MESSAGE
   ========================================================= */

.ssf-product-configurator__empty {
	margin: 0;
	color: var(--ssf-pc-muted);
	font-size: 12px;
	line-height: 1.4;
}


/* =========================================================
   WOOCOMMERCE VARIATION INFORMATION
   ========================================================= */

.single_variation_wrap {
	margin: 0 !important;
}

.woocommerce-variation {
	margin: 0 !important;
	padding: 14px 0 10px;
}

.woocommerce-variation-description {
	margin: 0 0 7px;
}

.woocommerce-variation-description p {
	margin: 0;
	color: var(--ssf-pc-text);
	font-size: 14px;
	line-height: 1.4;
}

.woocommerce-variation-price {
	margin: 0 0 10px;
}

.woocommerce-variation-price .price {
	display: block;
	margin: 0;
	color: var(--ssf-pc-text);
	font-size: 19px;
	font-weight: 800;
	line-height: 1.2;
}

.woocommerce-variation-availability {
	margin: 0;
}


/* =========================================================
   STEP 3 — QUANTITY CONFIGURATOR
   ========================================================= */

.ssf-product-quantity-configurator {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	margin: 0 0 14px;
	padding: 14px;
	border: 1px solid var(--ssf-pc-border);
	border-radius: 10px;
	background: var(--ssf-pc-soft);
	color: var(--ssf-pc-text);
}

.ssf-product-quantity-configurator[hidden] {
	display: none !important;
}

.ssf-product-quantity-configurator__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	margin: 0;
}

.ssf-product-quantity-configurator__header
.ssf-product-configurator__title {
	margin: 0 !important;
	color: var(--ssf-pc-text) !important;
	font-size: 15px;
}

.ssf-product-quantity-configurator__body {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 10px 12px;
	align-items: start;
	width: 100%;
}


/* =========================================================
   QUANTITY CONTROLS
   ========================================================= */

.ssf-product-quantity-controls {
	display: inline-grid;
	grid-template-columns: 38px 48px 38px;
	align-items: center;
	min-height: 42px;
	overflow: hidden;
	border: 1px solid var(--ssf-pc-border);
	border-radius: 8px;
	background: var(--ssf-pc-white);
}

.ssf-product-quantity-control {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 42px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--ssf-pc-text);
	box-shadow: none;
	font: inherit;
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	appearance: none;
}

.ssf-product-quantity-control:hover,
.ssf-product-quantity-control:focus {
	border: 0;
	background: var(--ssf-pc-soft);
	color: var(--ssf-pc-text);
	box-shadow: none;
}

.ssf-product-quantity-control:focus-visible {
	outline: 2px solid var(--ssf-pc-primary);
	outline-offset: -2px;
}

.ssf-product-quantity-controls__value {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 42px;
	border-right: 1px solid var(--ssf-pc-border);
	border-left: 1px solid var(--ssf-pc-border);
	color: var(--ssf-pc-text);
	font-size: 15px;
	font-weight: 800;
	line-height: 1;
}


/* =========================================================
   DISCOUNT TIERS
   ========================================================= */

.ssf-product-discount-tiers {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	min-width: 0;
}

.ssf-product-discount-tier {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	min-width: 0;
	min-height: 42px;
	margin: 0;
	padding: 7px 10px;
	border: 1px solid var(--ssf-pc-border);
	border-radius: 8px;
	background: var(--ssf-pc-white);
	color: var(--ssf-pc-text);
	box-shadow: none;
	font: inherit;
	font-size: 11px;
	line-height: 1;
	cursor: pointer;
	appearance: none;
	transition:
		border-color 160ms ease,
		background-color 160ms ease,
		box-shadow 160ms ease;
}

.ssf-product-discount-tier:hover {
	border-color: var(--ssf-pc-dark);
	background: var(--ssf-pc-white);
	color: var(--ssf-pc-text);
}

.ssf-product-discount-tier:focus-visible {
	outline: 2px solid var(--ssf-pc-primary);
	outline-offset: 2px;
}

.ssf-product-discount-tier strong {
	color: inherit;
	font-size: inherit;
	font-weight: 800;
}

.ssf-product-discount-tier span {
	color: var(--ssf-pc-primary);
	font-size: inherit;
	font-weight: 800;
}

.ssf-product-discount-tier.is-active {
	border-color: var(--ssf-pc-primary);
	background: rgba(227, 6, 19, 0.045);
	box-shadow: 0 0 0 1px rgba(227, 6, 19, 0.12);
}


/* =========================================================
   PRICE SUMMARY
   ========================================================= */

.ssf-product-price-summary {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 100%;
	margin: 0;
	padding-top: 10px;
	border-top: 1px solid var(--ssf-pc-border);
	color: var(--ssf-pc-text);
}

.ssf-product-price-summary__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	width: 100%;
	margin: 0;
	color: var(--ssf-pc-muted);
	font-size: 12px;
	line-height: 1.3;
}

.ssf-product-price-summary__row strong {
	color: var(--ssf-pc-text);
	font-size: 13px;
	font-weight: 800;
	white-space: nowrap;
}

.ssf-product-price-summary__row[hidden] {
	display: none !important;
}

.ssf-product-price-summary__row--total {
	margin-top: 2px;
	padding-top: 8px;
	border-top: 1px solid var(--ssf-pc-border);
	color: var(--ssf-pc-text);
	font-size: 14px;
	font-weight: 800;
}

.ssf-product-price-summary__row--total strong {
	color: var(--ssf-pc-primary);
	font-size: 18px;
	font-weight: 850;
}


/* =========================================================
   ADD TO CART
   ========================================================= */

.woocommerce-variation-add-to-cart {
	display: block !important;
	width: 100%;
	margin: 0;
	padding: 0;
}

.woocommerce-variation-add-to-cart-disabled {
	opacity: 1;
}

.woocommerce-variation-add-to-cart
.single_add_to_cart_button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	margin: 0 !important;
	padding: 12px 18px;
	border-radius: 6px;
}

.woocommerce-variation-add-to-cart
.single_add_to_cart_button.disabled,
.woocommerce-variation-add-to-cart
.single_add_to_cart_button:disabled {
	opacity: 0.48;
	cursor: not-allowed;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {

	.ssf-product-family-options {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.ssf-product-variant-options {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

	.ssf-product-configurator {
		gap: 10px;
	}

	.ssf-product-configurator__section--families,
	.ssf-product-configurator__section--variants,
	.ssf-product-quantity-configurator {
		padding: 12px;
	}

	.ssf-product-family-options {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ssf-product-variant-options {
		grid-template-columns: 1fr;
	}

	.ssf-product-family-option {
		min-height: 46px;
	}

	.ssf-product-configurator__family-header,
	.ssf-product-configurator__variant-header {
		align-items: center;
		flex-direction: row;
	}

	.ssf-product-configurator__family-actions {
		gap: 7px;
	}

	.ssf-product-configurator__section--collapsed
	.ssf-product-configurator__title-label {
		white-space: normal;
	}

	.ssf-product-configurator__color-summary {
		display: none;
	}

	.ssf-product-configurator__selected-family {
		display: inline-flex;
	}

	.ssf-product-quantity-configurator__body {
		grid-template-columns: 1fr;
	}

	.ssf-product-price-summary {
		grid-column: auto;
	}

	.ssf-product-discount-tiers {
		width: 100%;
	}

	.ssf-product-discount-tier {
		flex: 1 1 30%;
	}
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 430px) {

	.ssf-product-configurator__title {
		font-size: 14px;
	}

	.ssf-product-configurator__title > span:first-child {
		flex-basis: 26px;
		width: 26px;
		height: 26px;
		font-size: 11px;
	}

	.ssf-product-family-options {
		gap: 7px;
	}

	.ssf-product-family-option {
		gap: 7px;
		padding: 7px;
	}

	.ssf-product-family-option__visual {
		width: 24px;
		height: 24px;
	}

	.ssf-product-family-option__content strong {
		font-size: 10.5px;
	}

	.ssf-product-configurator__change-family {
		font-size: 11px;
	}

	.ssf-product-configurator__selected-family {
		padding: 5px 8px;
		font-size: 10px;
	}

	.ssf-product-quantity-controls {
		width: 100%;
		grid-template-columns: 42px 1fr 42px;
	}

	.ssf-product-quantity-control {
		width: 42px;
	}

	.ssf-product-discount-tier {
		flex: 1 1 30%;
		padding: 7px 6px;
	}
}