/**
 * WC Sconto Quantità Pro — blocco sconto quantità.
 * Palette e tipografia del template prodotto Betheme:
 * verde #4B5A52 (titolo e pulsante carrello) · testo #1D231E · salvia #CCD5AE
 * (variazione selezionata) · bordi #E2E2E2 · fondo #F5F5F5.
 */

.ywdpd-table-discounts-wrapper .osm-sq {
	--osm-green: #4B5A52;
	--osm-green-dark: #3F4C45;
	--osm-gold: #CCD5AE;
	--osm-gold-soft: #F1F4E6;
	--osm-ink: #1D231E;
	--osm-muted: #6f6f63;
	--osm-cream: #F5F5F5;
	--osm-line: #E2E2E2;
	--osm-alert: #B5533A;

	box-sizing: border-box;
	margin: 20px 0 0;
	padding: 16px;
	border: 1px solid var(--osm-line);
	border-radius: 8px;
	background: #fff;
	color: var(--osm-ink);
	line-height: 1.4;
}

.ywdpd-table-discounts-wrapper .osm-sq *,
.ywdpd-table-discounts-wrapper .osm-sq *::before,
.ywdpd-table-discounts-wrapper .osm-sq *::after {
	box-sizing: border-box;
}

/* Il markup originale del plugin non viene più stampato, ma se un altro
   contesto lo reintroduce restiamo puliti. */
.ywdpd-table-discounts-wrapper .osm-sq p {
	margin: 0;
}

/* ── Testata ─────────────────────────────────────────── */

.ywdpd-table-discounts-wrapper .osm-sq__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin-bottom: 12px;
}

.ywdpd-table-discounts-wrapper .osm-sq__badge {
	order: -1;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--osm-green);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}

.ywdpd-table-discounts-wrapper .osm-sq__title {
	flex: 1 1 auto;
	font-size: 16px;
	font-weight: 600;
	color: var(--osm-ink);
}

.ywdpd-table-discounts-wrapper .osm-sq__claim {
	flex: 1 1 100%;
	font-size: 13px;
	color: var(--osm-muted);
}

/* ── Countdown ───────────────────────────────────────── */

.ywdpd-table-discounts-wrapper .osm-sq__timer {
	margin-bottom: 14px;
	padding: 12px 14px;
	border: 1px solid var(--osm-line);
	border-left: 3px solid var(--osm-green);
	border-radius: 8px;
	background: var(--osm-cream);
}

.ywdpd-table-discounts-wrapper .osm-sq__timer-label {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--osm-alert);
}

.ywdpd-table-discounts-wrapper .osm-sq__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--osm-alert);
	animation: osm-sq-pulse 1.6s ease-in-out infinite;
}

@keyframes osm-sq-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50%      { opacity: 0.35; transform: scale(0.75); }
}

.ywdpd-table-discounts-wrapper .osm-sq__clock {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 8px 0 6px;
}

.ywdpd-table-discounts-wrapper .osm-sq__unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 52px;
	padding: 5px 6px;
	border: 1px solid var(--osm-line);
	border-radius: 8px;
	background: #fff;
}

.ywdpd-table-discounts-wrapper .osm-sq__unit b {
	font-size: 18px;
	font-weight: 600;
	line-height: 1.1;
	color: var(--osm-ink);
	font-variant-numeric: tabular-nums;
}

.ywdpd-table-discounts-wrapper .osm-sq__unit i {
	font-style: normal;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--osm-muted);
}

.ywdpd-table-discounts-wrapper .osm-sq__deadline {
	font-size: 12px;
	color: var(--osm-muted);
}

.ywdpd-table-discounts-wrapper .osm-sq__deadline strong {
	color: var(--osm-ink);
	font-weight: 600;
}

.ywdpd-table-discounts-wrapper .osm-sq__expired {
	font-size: 13px;
	font-weight: 600;
	color: var(--osm-alert);
}

.ywdpd-table-discounts-wrapper .osm-sq__timer.is-expired .osm-sq__timer-label,
.ywdpd-table-discounts-wrapper .osm-sq__timer.is-expired .osm-sq__clock,
.ywdpd-table-discounts-wrapper .osm-sq__timer.is-expired .osm-sq__deadline {
	display: none;
}

/* ── Fasce (tabella YITH ristilizzata a card) ────────── */

.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table.osm-sq__tiers {
	display: block;
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: separate;
	border-spacing: 0;
	background: none;
	table-layout: auto;
}

.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table tbody {
	display: flex;
	flex-direction: column;
	gap: 10px;
	border: 0;
}

.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table tr.osm-sq__tier {
	position: relative;
	display: flex;
	align-items: stretch;
	gap: 0;
	border: 1px solid var(--osm-line);
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.18s ease;
}

.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table tr.osm-sq__tier:hover {
	border-color: var(--osm-green);
}

.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table tr.osm-sq__tier--best {
	border-color: var(--osm-gold);
}

.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table tr.osm-sq__tier.is-active {
	border-color: var(--osm-green);
}

/* Reset delle celle: annulla bordi/padding/colori del CSS di YITH e del tema. */
.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table td {
	display: block;
	border: 0 !important;
	background: none !important;
	text-align: left;
	vertical-align: middle;
	color: inherit;
	font-size: 14px;
}

.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table td.qty-info,
.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table td.qty-price-info {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
}

.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table td.qty-info {
	flex: 0 0 auto;
	min-width: 42%;
	padding: 12px 10px 12px 14px;
}

.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table td.qty-price-info {
	flex: 1 1 auto;
	align-items: flex-end;
	padding: 12px 14px 12px 10px;
	text-align: right;
}

/* Neutralizza l'hover teal del plugin. */
.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table tr td:hover,
.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table tr td.qty-price-info:hover span,
.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table tr td.ywdpd_active {
	color: inherit !important;
	background: none !important;
	border: 0 !important;
}

/* Colonna sinistra */

.ywdpd-table-discounts-wrapper .osm-sq__pick {
	position: absolute;
	top: 50%;
	left: 14px;
	width: 20px;
	height: 20px;
	margin-top: -10px;
	border: 2px solid #cfcfc6;
	border-radius: 50%;
	background: #fff;
	transition: border-color 0.18s ease, background-color 0.18s ease;
}

.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table td.qty-info {
	padding-left: 44px;
}

.ywdpd-table-discounts-wrapper .osm-sq__tier.is-active .osm-sq__pick {
	border-color: var(--osm-green);
	background: var(--osm-green);
	box-shadow: inset 0 0 0 3px #fff;
}

.ywdpd-table-discounts-wrapper .osm-sq__qty {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 5px;
}

.ywdpd-table-discounts-wrapper .osm-sq__qty b {
	font-size: 18px;
	font-weight: 600;
	line-height: 1.1;
	color: var(--osm-ink);
}

.ywdpd-table-discounts-wrapper .osm-sq__qty i {
	font-style: normal;
	font-size: 13px;
	color: var(--osm-muted);
}

.ywdpd-table-discounts-wrapper .osm-sq__percent {
	align-self: flex-start;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--osm-green);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.ywdpd-table-discounts-wrapper .osm-sq__tier--best .osm-sq__percent {
	background: var(--osm-gold);
	color: var(--osm-ink);
}

.ywdpd-table-discounts-wrapper .osm-sq__flag {
	position: absolute;
	top: -11px;
	right: 12px;
	padding: 2px 9px;
	border-radius: 999px;
	background: var(--osm-gold);
	color: var(--osm-ink);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* Colonna destra */

.ywdpd-table-discounts-wrapper .osm-sq__prices {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 6px;
}

.ywdpd-table-discounts-wrapper .osm-sq__was {
	font-size: 13px;
	color: var(--osm-muted);
	text-decoration: line-through;
}

.ywdpd-table-discounts-wrapper .osm-sq__now,
.ywdpd-table-discounts-wrapper .osm-sq__now .amount,
.ywdpd-table-discounts-wrapper .osm-sq__now bdi {
	font-size: 18px;
	font-weight: 600;
	color: var(--osm-green-dark);
	text-decoration: none;
}

.ywdpd-table-discounts-wrapper .osm-sq__each {
	font-size: 12px;
	color: var(--osm-muted);
}

.ywdpd-table-discounts-wrapper .osm-sq__save {
	font-size: 13px;
	color: var(--osm-green-dark);
}

.ywdpd-table-discounts-wrapper .osm-sq__save strong {
	font-weight: 600;
}

.ywdpd-table-discounts-wrapper .osm-sq__total {
	font-size: 12px;
	color: var(--osm-muted);
}

.ywdpd-table-discounts-wrapper .osm-sq__ship {
	display: inline-block;
	margin-top: 2px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--osm-gold-soft);
	color: var(--osm-ink);
	font-size: 12px;
	font-weight: 600;
}

/* ── Piede ───────────────────────────────────────────── */

.ywdpd-table-discounts-wrapper .osm-sq__hint {
	margin-top: 12px;
	font-size: 12px;
	color: var(--osm-muted);
}

.ywdpd-table-discounts-wrapper .osm-sq__note {
	margin-top: 8px;
	font-size: 13px;
	color: var(--osm-ink);
}

.ywdpd-table-discounts-wrapper .osm-sq__note p {
	margin: 0 0 4px;
}

.ywdpd-table-discounts-wrapper .osm-sq__note p:empty {
	display: none;
}

.ywdpd-table-discounts-wrapper .osm-sq__trust {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 12px 0 0;
	padding: 12px 0 0;
	border-top: 1px solid var(--osm-line);
	list-style: none;
}

.ywdpd-table-discounts-wrapper .osm-sq__trust li {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 12px;
	color: var(--osm-muted);
}

.ywdpd-table-discounts-wrapper .osm-sq__trust li::before {
	content: "";
	flex: 0 0 auto;
	width: 12px;
	height: 7px;
	border-left: 2px solid var(--osm-green);
	border-bottom: 2px solid var(--osm-green);
	transform: rotate(-45deg) translateY(-2px);
}

/* ── Schermi stretti ─────────────────────────────────── */

@media (max-width: 400px) {

	.ywdpd-table-discounts-wrapper .osm-sq {
		padding: 14px;
	}

	.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table td.qty-info {
		min-width: 0;
		padding-right: 6px;
		padding-left: 36px;
	}

	.ywdpd-table-discounts-wrapper .osm-sq__pick {
		left: 10px;
	}

	.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table td.qty-price-info {
		padding-left: 6px;
	}

	.ywdpd-table-discounts-wrapper .osm-sq__qty b {
		font-size: 17px;
	}

	.ywdpd-table-discounts-wrapper .osm-sq__now,
	.ywdpd-table-discounts-wrapper .osm-sq__now .amount,
	.ywdpd-table-discounts-wrapper .osm-sq__now bdi {
		font-size: 16px;
	}

	.ywdpd-table-discounts-wrapper .osm-sq__unit {
		min-width: 46px;
	}
}

@media (prefers-reduced-motion: reduce) {

	.ywdpd-table-discounts-wrapper .osm-sq__dot {
		animation: none;
	}

	.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table tr.osm-sq__tier,
	.ywdpd-table-discounts-wrapper .osm-sq__pick {
		transition: none;
	}
}
