/**
 * WC Sconto Quantità Pro — blocco sconto quantità.
 * Palette allineata alle global colors del sito (Astra):
 * 0 #727a35 oliva · 1 #cbb677 oro · 2/6 #4c5a52 · 4 #f8f6f3 crema.
 */

.ywdpd-table-discounts-wrapper .osm-sq {
	--osm-green: #727a35;
	--osm-green-dark: #5c6329;
	--osm-green-soft: #f3f5ea;
	--osm-gold: #cbb677;
	--osm-gold-soft: #faf5e7;
	--osm-ink: #4c5a52;
	--osm-muted: #7d8880;
	--osm-cream: #f8f6f3;
	--osm-line: #e4ded3;
	--osm-alert: #b5533a;

	box-sizing: border-box;
	margin: 24px 0;
	padding: 18px;
	border: 1px solid var(--osm-line);
	border-radius: 16px;
	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: 8px 10px;
	margin-bottom: 14px;
}

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

.ywdpd-table-discounts-wrapper .osm-sq__title {
	flex: 1 1 auto;
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--osm-ink);
}

.ywdpd-table-discounts-wrapper .osm-sq__claim {
	flex: 1 1 100%;
	font-size: 0.85rem;
	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: 4px solid var(--osm-gold);
	border-radius: 12px;
	background: var(--osm-cream);
}

.ywdpd-table-discounts-wrapper .osm-sq__timer-label {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 0.8rem;
	font-weight: 700;
	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: 1.2rem;
	font-weight: 700;
	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: 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--osm-muted);
}

.ywdpd-table-discounts-wrapper .osm-sq__deadline {
	font-size: 0.78rem;
	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: 0.85rem;
	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: 14px;
	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: 2px solid var(--osm-line);
	border-radius: 14px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table tr.osm-sq__tier:hover {
	border-color: var(--osm-gold);
	box-shadow: 0 4px 14px rgba(76, 90, 82, 0.1);
}

.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);
	background: var(--osm-green-soft);
	box-shadow: 0 0 0 3px rgba(114, 122, 53, 0.14);
}

/* 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: 1rem;
}

.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: 14px 10px 14px 14px;
}

.ywdpd-table-discounts-wrapper .osm-sq #ywdpd-quantity-table td.qty-price-info {
	flex: 1 1 auto;
	align-items: flex-end;
	padding: 14px 14px 14px 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 #cfc7b8;
	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: 1.3rem;
	font-weight: 700;
	line-height: 1.1;
	color: var(--osm-ink);
}

.ywdpd-table-discounts-wrapper .osm-sq__qty i {
	font-style: normal;
	font-size: 0.85rem;
	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: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

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

.ywdpd-table-discounts-wrapper .osm-sq__flag {
	position: absolute;
	top: -11px;
	right: 12px;
	padding: 2px 9px;
	border-radius: 999px;
	background: var(--osm-gold);
	color: #4a3d16;
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	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: 0.85rem;
	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: 1.22rem;
	font-weight: 700;
	color: var(--osm-green-dark);
	text-decoration: none;
}

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

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

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

.ywdpd-table-discounts-wrapper .osm-sq__total {
	font-size: 0.76rem;
	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: #7a6421;
	font-size: 0.72rem;
	font-weight: 600;
}

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

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

.ywdpd-table-discounts-wrapper .osm-sq__note {
	margin-top: 8px;
	font-size: 0.85rem;
	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: 0.76rem;
	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: 1.15rem;
	}

	.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: 1.08rem;
	}

	.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;
	}
}
