/**
 * Aftertaste Discount Manager — frontend
 * Card-look. Boxen huggar innehållet (inte 100% bred).
 */

/* Mirror Aftertaste Related Products exactly — den visar margin-top korrekt
   inuti form.cart på Shoptimizer. display: inline-block är nyckeln. */
.adm-tier-pricing {
	display: inline-block;
	width: 100%;
	margin-top: 20px;
	margin-bottom: 0;
	box-sizing: border-box;
}

/* Override Aftertaste Related Products styling BARA när den följer vår box.
   Påverkar inte produkter där tier-pricing inte är aktiverat. */
.adm-tier-pricing + .aftertaste-related-products-list {
	margin-top: 14px;
	border-radius: 6px;
}

.adm-tier-pricing__card {
	background: #ffffff;
	border-radius: 6px;
	overflow: hidden;
	box-shadow:
		0 1px 2px rgba(17, 24, 39, 0.04),
		0 0 0 1px rgba(17, 24, 39, 0.08);
}

.adm-tier-pricing__heading {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 20px;
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
	font-size: 12px;
	font-weight: 600;
	color: #374151;
	letter-spacing: 0.01em;
}

.adm-tier-pricing__heading::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #16a34a;
	flex-shrink: 0;
}

.adm-pricing-table {
	width: 100%;
	margin: 0;
	border-collapse: separate;
	border-spacing: 0;
	font-size: 13px;
	color: #111827;
	line-height: 1.4;
}

/* Antal expanderar och tar mellanrummet — Rabatt + Pris packas till höger */
.adm-pricing-table thead th:nth-child(2),
.adm-pricing-table tbody td:nth-child(2),
.adm-pricing-table thead th:last-child,
.adm-pricing-table tbody td:last-child {
	width: 1%;
}

/* Header */
.adm-pricing-table thead th {
	background: #ffffff;
	color: #6b7280;
	font-weight: 600;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	text-align: left;
	padding: 10px 18px;
	border-bottom: 1px solid #e5e7eb;
	white-space: nowrap;
}

/* Body */
.adm-pricing-table tbody td {
	padding: 13px 18px;
	border-bottom: 1px solid #f3f4f6;
	vertical-align: middle;
	transition: background-color 0.12s ease;
	white-space: nowrap;
}

.adm-pricing-table tbody tr:last-child td {
	border-bottom: none;
	padding-bottom: 10px;
}

/* Antal — extra luft vänster */
.adm-pricing-table thead th:first-child,
.adm-pricing-table tbody td:first-child {
	padding-left: 24px;
}

/* Pris (sista) — extra luft höger + högerjusterad */
.adm-pricing-table thead th:last-child,
.adm-pricing-table tbody td:last-child {
	padding-right: 24px;
	text-align: right;
}

/* Rabatt (mittkolumn) — högerjusterad så den ligger nära Pris */
.adm-pricing-table thead th:nth-child(2),
.adm-pricing-table tbody td:nth-child(2) {
	text-align: right;
}

.adm-pricing-table tbody tr td:first-child {
	font-weight: 500;
	color: #111827;
}

.adm-pricing-table tbody tr td:nth-child(2) {
	color: #6b7280;
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}

.adm-pricing-table tbody tr td:last-child {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

/* Klickbara rader */
.adm-pricing-table tbody tr {
	cursor: pointer;
}

.adm-pricing-table tbody tr:hover td {
	background: #fafbfc;
}

/* Otillgänglig tier (min-qty > lagerstatus) — ej klickbar */
.adm-pricing-table tbody tr.is-disabled {
	cursor: not-allowed;
	opacity: 0.45;
}

.adm-pricing-table tbody tr.is-disabled:hover td {
	background: transparent;
}

.adm-pricing-table tbody tr.is-disabled td {
	color: #9ca3af;
}

/* Aktiv rad */
.adm-pricing-table tbody tr.is-active td {
	background: #f0fdf4;
	color: #14532d;
}

.adm-pricing-table tbody tr.is-active:hover td {
	background: #ecfccb;
}

.adm-pricing-table tbody tr.is-active td:first-child {
	box-shadow: inset 3px 0 0 #16a34a;
	color: #14532d;
}

.adm-pricing-table tbody tr.is-active td:nth-child(2) {
	color: #16a34a;
	font-weight: 600;
}

.adm-pricing-table .woocommerce-Price-amount {
	white-space: nowrap;
}
