/**
 * Frontend styles — "Buy More, Save More" panel & bundle builder.
 * Uses --nlqd-accent (falls back to a neutral) so it can inherit the theme.
 */

.nlqd-panel {
	--nlqd-accent: #1a1a1a;
	--nlqd-accent-soft: rgba(26, 26, 26, 0.08);
	margin: 1em 0 1.5em;
	padding: 16px;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	background: #fafafa;
}

.nlqd-panel__heading {
	font-weight: 600;
	font-size: 0.95em;
	margin-bottom: 12px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* --- Simple product tiers --- */

.nlqd-tiers {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.nlqd-tier {
	position: relative;
	flex: 1 1 140px;
	min-width: 120px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 14px;
	border: 2px solid #e2e2e2;
	background: #fff;
	cursor: pointer;
	text-align: left;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nlqd-badge--pill .nlqd-tier { border-radius: 999px; }
.nlqd-badge--pill.nlqd-panel--bundle .nlqd-bundle-tier { border-radius: 999px; }
.nlqd-tier { border-radius: 8px; }

.nlqd-tier:hover,
.nlqd-tier:focus-visible {
	border-color: var(--nlqd-accent);
	outline: none;
}

.nlqd-tier.is-active {
	border-color: var(--nlqd-accent);
	background: var(--nlqd-accent-soft);
	box-shadow: 0 0 0 1px var(--nlqd-accent) inset;
}

.nlqd-tier__qty { font-weight: 700; }
.nlqd-tier__percent { color: var(--nlqd-accent); font-weight: 600; }
.nlqd-tier__each { font-size: 0.85em; color: #666; }

.nlqd-tier__check {
	position: absolute;
	top: 8px;
	right: 10px;
	color: var(--nlqd-accent);
	opacity: 0;
	font-weight: 700;
}

.nlqd-tier.is-active .nlqd-tier__check { opacity: 1; }

.nlqd-live {
	margin-top: 12px;
	font-size: 0.95em;
}

.nlqd-live__label { font-weight: 600; margin-right: 6px; }

/* --- Bundle builder --- */

.nlqd-panel--bundle .nlqd-bundle__tiers {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 16px;
}

.nlqd-bundle-tier {
	flex: 1 1 130px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 14px;
	border: 2px solid #e2e2e2;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	text-align: center;
}

.nlqd-bundle-tier:hover,
.nlqd-bundle-tier:focus-visible {
	border-color: var(--nlqd-accent);
	outline: none;
}

.nlqd-bundle-tier.is-active {
	border-color: var(--nlqd-accent);
	background: var(--nlqd-accent-soft);
	box-shadow: 0 0 0 1px var(--nlqd-accent) inset;
}

.nlqd-bundle-tier__qty { font-weight: 700; }
.nlqd-bundle-tier__label { font-size: 0.85em; color: var(--nlqd-accent); }

.nlqd-bundle-row {
	padding: 14px 0;
	border-top: 1px dashed #e0e0e0;
}

.nlqd-bundle-row__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.nlqd-bundle-row__label { font-weight: 600; }

.nlqd-bundle-row__price { font-weight: 600; white-space: nowrap; }

.nlqd-bundle-row__selects {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.nlqd-bundle-row__field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 0.85em;
	flex: 1 1 140px;
	min-width: 0;
}

.nlqd-bundle-row__field-label { color: #555; }

.nlqd-bundle-row__field select {
	width: 100%;
	box-sizing: border-box;
	max-width: 100%;
}

.nlqd-bundle-row.has-error { background: #fdf3f3; border-radius: 6px; }
.nlqd-bundle-row__error { margin-top: 6px; color: #b32d2e; font-size: 0.85em; }

.nlqd-bundle__summary {
	margin: 14px 0;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
}

.nlqd-summary__row {
	display: flex;
	justify-content: space-between;
	padding: 3px 0;
}

.nlqd-summary__row--discount { color: #1e7e34; }

.nlqd-summary__row--total {
	font-weight: 700;
	font-size: 1.1em;
	border-top: 1px solid #eee;
	margin-top: 6px;
	padding-top: 8px;
}

.nlqd-bundle__add.is-loading { opacity: 0.6; cursor: progress; }

.nlqd-bundle__error { margin-top: 10px; }
.nlqd-bundle__error.is-error { color: #b32d2e; }
.nlqd-bundle__error.is-success {
	color: #1e7e34;
	padding: 10px 12px;
	background: #eef7f0;
	border: 1px solid #cfe8d6;
	border-radius: 6px;
}

.nlqd-bundle__view-cart {
	font-weight: 600;
	text-decoration: underline;
}

/* --- Responsive ---
 * Breakpoint at 600px so it also handles narrow product-page columns and
 * small tablets, not just phones. */

@media (max-width: 600px) {
	.nlqd-panel { padding: 14px; }

	/* Full-width, tappable tier buttons. */
	.nlqd-tier,
	.nlqd-bundle-tier { flex: 1 1 100%; }

	/* Compact bundle pills: "Buy 2  ·  5% off" on a single line. */
	.nlqd-bundle-tier {
		flex-direction: row;
		justify-content: center;
		align-items: baseline;
		gap: 8px;
		padding: 14px 16px;
	}

	.nlqd-tier { padding: 14px 16px; }

	/* Stack the variation dropdowns full width with comfortable touch height. */
	.nlqd-bundle-row__selects { flex-direction: column; gap: 12px; }
	.nlqd-bundle-row__field { flex: 1 1 auto; width: 100%; }
	.nlqd-bundle-row__field select { min-height: 44px; font-size: 16px; }

	/* Full-width primary action = big, easy tap target. */
	.nlqd-bundle__add { width: 100%; }
}
