/* Wholesale Order & Commercial Direct Checkout Styles
 * Strictly compliant with MinerCore GEMINI.md design standards:
 * Full Width & Compact Height Hero, zero hardcoded colors, 100% responsive.
 */

.wholesale-page {
	background: #f8fafc;
	color: #0f172a;
}

/* Compact Full-Width Hero conforming strictly to GEMINI.md */
.wholesale-hero {
	width: 100% !important;
	padding: 42px 0 48px !important;
	min-height: auto !important;
	background: linear-gradient(135deg, #091e36 0%, #0d2d4d 55%, #0d3e52 100%) !important;
	color: #ffffff !important;
	position: relative;
	overflow: hidden;
}

.wholesale-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 80% 20%, rgba(20, 184, 166, 0.12) 0%, transparent 60%);
	pointer-events: none;
}

.wholesale-hero .mc-inner-hero__wrap {
	position: relative;
	z-index: 1;
}

.wholesale-hero h1 {
	font-size: clamp(2rem, 3.8vw, 3.2rem) !important;
	font-weight: 700 !important;
	line-height: 1.15 !important;
	color: #ffffff !important;
	margin: 8px 0 12px !important;
	letter-spacing: -0.02em;
}

.wholesale-hero p {
	color: #cbd5e1 !important;
	font-size: 1.05rem !important;
	line-height: 1.6 !important;
	max-width: 760px;
	margin: 0;
}

/* Commercial informative banner */
.wholesale-commercial-banner {
	background: #ffffff;
	border: 1px solid #bfdbfe;
	border-left: 4px solid var(--brand-primary, #2563eb);
	border-radius: 12px;
	padding: 14px 20px;
	margin-bottom: 24px;
	display: flex;
	align-items: center;
	gap: 14px;
	color: #1e3a8a;
	font-size: 0.92rem;
	line-height: 1.5;
	box-shadow: 0 2px 10px rgba(37, 99, 235, 0.04);
}

.wholesale-commercial-banner svg {
	color: var(--brand-primary, #2563eb);
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
}

.wholesale-commercial-banner p {
	margin: 0;
	font-weight: 500;
}

/* Portal Container */
.wholesale-portal-container {
	padding: 38px 0 80px;
}

/* Card Foundation */
.quote-form-card {
	background: #ffffff;
	border: 1px solid #d7e2ea;
	border-radius: 14px;
	padding: 24px 28px;
	margin-bottom: 24px;
	box-shadow: 0 7px 24px rgba(15, 42, 67, 0.045);
}

.quote-form-card > header,
.wholesale-step-header {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 24px;
	padding-bottom: 18px;
	border-bottom: 1px solid #f1f5f9;
}

.wholesale-step-header {
	margin: 32px 0 20px;
	border-bottom: 1px solid #e2e8f0;
}

.quote-form-card > header > b,
.wholesale-step-header > b {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: rgba(37, 99, 235, 0.08);
	color: var(--brand-primary, #2563eb);
	font-size: 1.1rem;
	font-weight: 700;
	flex-shrink: 0;
}

.quote-form-card h3,
.wholesale-step-header h3 {
	margin: 0;
	font-size: 1.3rem;
	font-weight: 700;
	color: #0f172a;
}

.quote-form-card header p,
.wholesale-step-header p {
	margin: 4px 0 0;
	font-size: 0.9rem;
	color: #64748b;
}

/* TIER PROGRESSION STEPPER */
.wholesale-tier-stepper {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 24px;
}

.tier-step {
	position: relative;
	background: #f8fafc;
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	transition: all 0.25s ease;
}

.tier-step__badge {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #64748b;
}

.tier-step strong {
	font-size: 0.98rem;
	color: #1e293b;
}

.tier-step b {
	font-size: 1.05rem;
	color: var(--brand-primary, #2563eb);
}

.tier-step.is-active {
	border-color: var(--brand-accent, #16a34a);
	background: rgba(22, 163, 74, 0.05);
	box-shadow: 0 4px 14px rgba(22, 163, 74, 0.1);
}

.tier-step.is-active .tier-step__badge {
	color: var(--brand-accent, #16a34a);
}

.tier-step.is-active b {
	color: var(--brand-accent, #16a34a);
}

.tier-step.is-reached:not(.is-active) {
	border-color: #cbd5e1;
	background: #f1f5f9;
}

/* PRODUCT ROWS */
.wholesale-product-rows {
	margin-bottom: 16px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.quote-product-row {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px 18px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.quote-product-row:hover {
	border-color: #cbd5e1;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.quote-product-row__inputs {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 160px 44px;
	gap: 14px;
	align-items: end;
}

.quote-product-row label > span {
	display: block;
	font-size: 0.78rem;
	font-weight: 600;
	color: #475569;
	margin-bottom: 6px;
}

.quote-product-row select,
.quote-product-row input {
	width: 100%;
	height: 44px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 0 12px;
	font-size: 0.95rem;
	background: #ffffff;
	color: #0f172a;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.quote-product-row select:focus,
.quote-product-row input:focus {
	border-color: var(--brand-primary, #2563eb);
	outline: none;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.quote-remove-row {
	height: 44px;
	width: 44px;
	border: 1px solid #fecaca;
	background: #fef2f2;
	color: #dc2626;
	border-radius: 8px;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.quote-remove-row:hover {
	background: #fee2e2;
	border-color: #fca5a5;
}

/* Row-level breakdown strip */
.quote-product-row__breakdown {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 10px;
	padding: 10px 14px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
}

.row-stat {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.row-stat__label {
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #64748b;
}

.row-stat__value {
	font-size: 0.92rem;
	font-weight: 700;
	color: #1e293b;
}

.row-stat__value.text-accent {
	color: var(--brand-accent, #16a34a);
}

/* Tier Badges in Row & Checkout Table */
.row-tier-badge,
.mc-wholesale-tier-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border-radius: 6px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	line-height: 1.4;
}

.row-tier-badge.tier-1,
.mc-wholesale-tier-badge.tier-1 {
	background: rgba(37, 99, 235, 0.1);
	color: var(--brand-primary, #2563eb);
	border: 1px solid rgba(37, 99, 235, 0.25);
}

.row-tier-badge.tier-2,
.mc-wholesale-tier-badge.tier-2 {
	background: rgba(13, 148, 136, 0.12);
	color: #0f766e;
	border: 1px solid rgba(13, 148, 136, 0.3);
}

.row-tier-badge.tier-3,
.mc-wholesale-tier-badge.tier-3 {
	background: rgba(22, 163, 74, 0.12);
	color: var(--brand-accent, #16a34a);
	border: 1px solid rgba(22, 163, 74, 0.3);
}

.row-tier-badge.tier-0 {
	background: #f1f5f9;
	color: #94a3b8;
	border: 1px solid #e2e8f0;
}

/* Checkout Review Table Custom Formatting */
.mc-wholesale-line-note {
	margin-top: 4px;
}

.mc-wholesale-tier-badge {
	background: rgba(22, 163, 74, 0.1);
	color: var(--brand-accent, #16a34a);
	border: 1px solid rgba(22, 163, 74, 0.25);
	font-size: 0.7rem;
	padding: 1px 6px;
}

.mc-wholesale-review-pricing {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
}

.mc-wholesale-review-pricing del {
	font-size: 0.8rem;
	color: #94a3b8;
}

.mc-wholesale-review-pricing strong {
	color: #0f172a;
	font-weight: 700;
}

.mc-wholesale-badge-pill {
	display: inline-block;
	background: #dcfce7;
	color: #15803d;
	font-size: 0.68rem;
	font-weight: 700;
	padding: 1px 6px;
	border-radius: 4px;
	margin-top: 2px;
}

.quote-add-product {
	width: 100%;
	padding: 14px;
	border: 2px dashed #cbd5e1;
	border-radius: 12px;
	background: transparent;
	color: var(--brand-primary, #2563eb);
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	text-align: center;
}

.quote-add-product:hover {
	border-color: var(--brand-primary, #2563eb);
	background: rgba(37, 99, 235, 0.03);
}

/* LIVE FINANCIAL SUMMARY */
.quote-live-summary {
	margin-top: 24px;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1px;
	background: #e2e8f0;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	overflow: hidden;
}

.quote-live-summary > div {
	background: #ffffff;
	padding: 16px;
}

.quote-live-summary span {
	display: block;
	font-size: 0.76rem;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 4px;
}

.quote-live-summary strong {
	display: block;
	font-size: 1.15rem;
	color: #0f172a;
	font-weight: 700;
}

.quote-live-summary__total {
	background: #f8fafc !important;
}

.quote-live-summary__total strong {
	color: var(--brand-primary, #2563eb);
}

.quote-live-summary small {
	grid-column: 1 / -1;
	background: #f1f5f9;
	padding: 12px 16px;
	font-size: 0.88rem;
	color: #334155;
	border-top: 1px solid #e2e8f0;
}

/* CHECKOUT LOCK & INTEGRATION */
:is(.wholesale-checkout-section, .wholesale-checkout-card).is-locked .wholesale-woocommerce-checkout-wrap {
	opacity: 0.35;
	pointer-events: none;
	filter: grayscale(1);
	user-select: none;
}

.wholesale-woocommerce-checkout-wrap {
	position: relative;
	width: 100%;
}

.wholesale-woocommerce-checkout-wrap form.woocommerce-checkout {
	width: 100% !important;
	max-width: 100% !important;
}

.wholesale-woocommerce-checkout-wrap .woocommerce-notices-wrapper:empty {
	display: none;
}

.wholesale-woocommerce-checkout-wrap .woocommerce-form-login-toggle,
.wholesale-woocommerce-checkout-wrap .woocommerce-form-coupon-toggle {
	margin-bottom: 16px;
}

.wholesale-min-warning {
	margin-bottom: 24px;
}

.wholesale-min-warning__box {
	display: flex;
	align-items: center;
	gap: 16px;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 12px;
	padding: 16px 20px;
	color: #92400e;
}

.wholesale-min-warning__box svg {
	color: #d97706;
	flex: 0 0 auto;
}

.wholesale-min-warning__box strong {
	display: block;
	font-size: 0.95rem;
	margin-bottom: 2px;
}

.wholesale-min-warning__box p {
	margin: 0;
	font-size: 0.88rem;
	color: #b45309;
}

/* OFFICIAL QUOTE / CONFIRMATION (PAPER VIEW) */
.wholesale-result {
	padding: 40px 0 80px;
}

.quote-created-banner {
	display: flex;
	align-items: center;
	gap: 16px;
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	border-radius: 12px;
	padding: 18px 24px;
	margin-bottom: 24px;
	color: #065f46;
}

.quote-created-banner > span {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #10b981;
	color: #ffffff;
	display: grid;
	place-items: center;
	font-size: 1.1rem;
	font-weight: 700;
	flex: 0 0 auto;
}

.quote-created-banner strong {
	display: block;
	font-size: 1.05rem;
	color: #064e3b;
}

.quote-created-banner p {
	margin: 3px 0 0;
	font-size: 0.9rem;
	color: #047857;
}

.official-quote {
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 16px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
	overflow: hidden;
}

.official-quote > header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 24px 32px;
	border-top: 5px solid var(--brand-primary, #2563eb);
	border-bottom: 1px solid #e2e8f0;
	background: #ffffff;
}

.official-quote > header img {
	max-height: 52px;
	max-width: 220px;
	object-fit: contain;
}

.official-quote > header div {
	text-align: right;
}

.official-quote > header span {
	display: block;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: #64748b;
}

.official-quote > header b {
	font-size: 1.35rem;
	color: #0f172a;
}

.official-quote__meta {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
}

.official-quote__meta > div {
	padding: 16px 24px;
	border-right: 1px solid #e2e8f0;
}

.official-quote__meta > div:last-child {
	border-right: 0;
}

.official-quote__meta span {
	display: block;
	font-size: 0.72rem;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	margin-bottom: 4px;
}

.official-quote__meta strong {
	font-size: 0.95rem;
	color: #0f172a;
}

.official-quote__parties {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	padding: 28px 32px;
	border-bottom: 1px solid #e2e8f0;
}

.official-quote__parties span {
	display: block;
	font-size: 0.72rem;
	font-weight: 700;
	color: #64748b;
	letter-spacing: 0.08em;
	margin-bottom: 6px;
}

.official-quote__parties h3 {
	margin: 0 0 6px;
	font-size: 1.15rem;
	color: #0f172a;
}

.official-quote__parties p {
	margin: 0;
	font-size: 0.88rem;
	line-height: 1.6;
	color: #475569;
}

.official-quote__table {
	padding: 0 32px;
	overflow-x: auto;
}

.official-quote table {
	width: 100%;
	border-collapse: collapse;
	min-width: 650px;
}

.official-quote th {
	background: #f8fafc;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #475569;
	padding: 12px 14px;
	text-align: left;
	border-bottom: 1px solid #e2e8f0;
}

.official-quote th:nth-child(n+3),
.official-quote td:nth-child(n+3) {
	text-align: right;
}

.official-quote td {
	padding: 14px;
	border-bottom: 1px solid #f1f5f9;
	font-size: 0.9rem;
	color: #1e293b;
}

.official-quote__totals {
	display: grid;
	grid-template-columns: 1fr 380px;
	gap: 32px;
	padding: 28px 32px;
	border-bottom: 1px solid #e2e8f0;
}

.quote-saving {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 20px;
	align-self: start;
}

.quote-saving span {
	display: block;
	font-size: 0.76rem;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
}

.quote-saving strong {
	display: block;
	font-size: 1.5rem;
	color: var(--brand-accent, #16a34a);
	margin: 6px 0;
}

.quote-saving small {
	display: block;
	font-size: 0.82rem;
	color: #64748b;
}

.official-quote__totals dl {
	margin: 0;
}

.official-quote__totals dl > div {
	display: flex;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid #f1f5f9;
	font-size: 0.92rem;
}

.official-quote__totals dl > div:last-child {
	border-bottom: 0;
	padding-top: 14px;
	font-size: 1.18rem;
	font-weight: 700;
	color: #0f172a;
}

.official-quote__totals dt {
	color: #64748b;
}

.official-quote__totals dd {
	margin: 0;
	color: #0f172a;
	font-weight: 600;
}

.official-quote__payment {
	margin: 24px 32px 30px;
	padding: 20px 24px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
}

.official-quote__payment > span {
	display: block;
	font-size: 0.75rem;
	font-weight: 700;
	color: #0f766e;
	letter-spacing: 0.08em;
	margin-bottom: 12px;
}

.official-quote__payment > div {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 14px;
}

.official-quote__payment article {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 14px 18px;
}

.official-quote__payment article strong {
	display: block;
	color: #0f172a;
	margin-bottom: 6px;
}

.official-quote__payment article p {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.6;
	color: #475569;
}

.official-quote > footer {
	padding: 20px 32px;
	background: #f8fafc;
	border-top: 1px solid #e2e8f0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	font-size: 0.82rem;
	color: #64748b;
}

.official-quote > footer p {
	margin: 0;
	max-width: 720px;
	line-height: 1.5;
}

.quote-actions {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 24px;
}

/* RESPONSIVE QUERIES */
@media (max-width: 1024px) {
	.quote-live-summary {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	.official-quote__meta {
		grid-template-columns: repeat(2, 1fr);
	}
	.official-quote__meta > div:nth-child(2) {
		border-right: 0;
	}
	.official-quote__meta > div:nth-child(1),
	.official-quote__meta > div:nth-child(2) {
		border-bottom: 1px solid #e2e8f0;
	}
	.official-quote__totals {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 768px) {
	.wholesale-tier-stepper {
		grid-template-columns: 1fr;
	}
	.quote-product-row__inputs {
		grid-template-columns: 1fr 120px 44px;
	}
	.quote-product-row__breakdown {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}
	.quote-live-summary {
		grid-template-columns: 1fr 1fr;
	}
	.quote-live-summary__total {
		grid-column: 1 / -1;
	}
	.official-quote__parties {
		grid-template-columns: 1fr;
		gap: 20px;
	}
	.official-quote > footer {
		flex-direction: column;
		align-items: flex-start;
	}
	.quote-actions {
		flex-direction: column;
	}
	.quote-actions .btn {
		width: 100%;
		justify-content: center;
	}
}

@media (max-width: 540px) {
	.quote-product-row__inputs {
		grid-template-columns: 1fr 44px;
		row-gap: 10px;
	}
	.quote-product-row__inputs .quote-field-model {
		grid-column: 1 / -1;
	}
	.quote-product-row__breakdown {
		grid-template-columns: 1fr;
		gap: 6px;
	}
	.quote-form-card,
	.wholesale-checkout-card {
		padding: 20px 16px;
	}
	.official-quote > header {
		flex-direction: column;
		align-items: flex-start;
		gap: 14px;
		padding: 20px 16px;
	}
	.official-quote > header div {
		text-align: left;
	}
	.official-quote__meta {
		grid-template-columns: 1fr;
	}
	.official-quote__meta > div {
		border-right: 0;
		border-bottom: 1px solid #e2e8f0;
	}
	.official-quote__parties,
	.official-quote__table,
	.official-quote__totals,
	.official-quote__payment {
		padding-left: 16px;
		padding-right: 16px;
	}
	.official-quote__payment {
		margin-left: 16px;
		margin-right: 16px;
	}
}

/* PRINT STYLES */
@media print {
	body > *:not(#page),
	header.site-header,
	footer.site-footer,
	.wholesale-hero,
	.wholesale-subnotice-bar,
	.quote-actions,
	.quote-created-banner {
		display: none !important;
	}
	.wholesale-page,
	.wholesale-result {
		background: #ffffff !important;
		padding: 0 !important;
	}
	.official-quote {
		border: 0 !important;
		box-shadow: none !important;
	}
}
