/* Masala B2B Quote Request - front end. Everything is scoped under .msb2b. */

.msb2b {
	--msb2b-accent: #c0392b;
	--msb2b-text: #222;
	--msb2b-muted: #6b6b6b;
	--msb2b-border: #e3e3e3;
	--msb2b-bg: #fff;
	--msb2b-soft: #faf7f2;
	--msb2b-radius: 8px;
	--msb2b-max-width: 1140px;
	max-width: var(--msb2b-max-width);
	margin-right: auto;
	margin-left: auto;
	color: var(--msb2b-text);
	font-size: 15px;
	line-height: 1.45;
	padding-bottom: 80px;
}

.msb2b *,
.msb2b *::before,
.msb2b *::after {
	box-sizing: border-box;
}

.msb2b [hidden] {
	display: none !important;
}

.msb2b-intro {
	margin-bottom: 16px;
}

/* Steps */
.msb2b-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	margin: 0 0 20px;
	padding: 12px 16px;
	background: var(--msb2b-soft);
	border-radius: var(--msb2b-radius);
	font-size: 14px;
}

.msb2b-steps b {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	margin-right: 6px;
	border-radius: 50%;
	background: var(--msb2b-accent);
	color: #fff;
	font-size: 12px;
}

/* Toolbar */
.msb2b-toolbar {
	display: flex;
	gap: 10px;
	margin-bottom: 10px;
}

.msb2b-search {
	flex: 1 1 auto;
}

.msb2b-cat {
	flex: 0 0 260px;
}

.msb2b input[type="search"],
.msb2b input[type="text"],
.msb2b input[type="email"],
.msb2b input[type="tel"],
.msb2b input[type="number"],
.msb2b select,
.msb2b textarea {
	width: 100%;
	min-height: 42px;
	margin: 0;
	padding: 8px 12px;
	border: 1px solid var(--msb2b-border);
	border-radius: 6px;
	background: #fff;
	color: var(--msb2b-text);
	font: inherit;
	box-shadow: none;
}

.msb2b input:focus,
.msb2b select:focus,
.msb2b textarea:focus {
	outline: 2px solid var(--msb2b-accent);
	outline-offset: -1px;
	border-color: var(--msb2b-accent);
}

.msb2b-count {
	margin: 6px 0 10px;
	color: var(--msb2b-muted);
	font-size: 13px;
}

/* Buttons */
.msb2b .msb2b-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 42px;
	margin: 0;
	padding: 8px 18px;
	border: 1px solid var(--msb2b-accent);
	border-radius: 6px;
	background: var(--msb2b-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	white-space: nowrap;
	transition: filter .15s, background .15s;
}

.msb2b .msb2b-btn:hover {
	filter: brightness(.92);
}

.msb2b .msb2b-btn:disabled {
	opacity: .55;
	cursor: not-allowed;
}

.msb2b .msb2b-btn--ghost {
	background: #fff;
	color: var(--msb2b-accent);
}

.msb2b .msb2b-btn--block {
	width: 100%;
	margin-top: 8px;
	min-height: 48px;
	font-size: 16px;
}

.msb2b .msb2b-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--msb2b-accent);
	font: inherit;
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
}

/* Product list */
.msb2b-list {
	border: 1px solid var(--msb2b-border);
	border-radius: var(--msb2b-radius);
	overflow: hidden;
	background: var(--msb2b-bg);
	transition: opacity .15s;
}

.msb2b-list:empty {
	border: 0;
}

.msb2b-list.is-loading {
	opacity: .5;
}

.msb2b-row {
	display: grid;
	grid-template-columns: 64px 1fr 130px 110px;
	align-items: center;
	gap: 14px;
	padding: 10px 14px;
	border-top: 1px solid var(--msb2b-border);
}

.msb2b-row:first-child {
	border-top: 0;
}

.msb2b-row.is-selected {
	background: var(--msb2b-soft);
}

.msb2b-row__img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 6px;
	background: #f3f3f3;
}

.msb2b-row__name {
	font-weight: 600;
}

.msb2b-row__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin-top: 2px;
	color: var(--msb2b-muted);
	font-size: 13px;
}

.msb2b-row__cat {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 20px;
	background: #f1ede6;
	color: #5b4a32;
	font-size: 12px;
}

.msb2b-row__qty {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
}

.msb2b-qty-label {
	color: var(--msb2b-muted);
	font-size: 13px;
}

.msb2b .msb2b-row__qty .msb2b-qty {
	flex: 0 0 84px;
	width: 84px;
	text-align: center;
}

.msb2b .msb2b-add {
	width: 100%;
}

.msb2b-row.is-selected .msb2b-add {
	background: #fff;
	color: var(--msb2b-accent);
}

.msb2b-more {
	margin-top: 14px;
	text-align: center;
}

/* Sticky bar */
.msb2b-bar {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99990; /* Above theme sticky footers (cart/account bars); below the modal. */
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
	background: #fff;
	border-top: 1px solid var(--msb2b-border);
	box-shadow: 0 -4px 18px rgba(0, 0, 0, .08);
}

.msb2b-bar__count {
	font-weight: 600;
}

/* Modal */
html.msb2b-locked {
	overflow: hidden;
}

.msb2b-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.msb2b-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .55);
}

.msb2b-modal__panel {
	position: relative;
	width: 100%;
	max-width: 760px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 26px 28px;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.msb2b-modal h2 {
	margin: 0 0 16px;
	font-size: 22px;
}

.msb2b-modal h3 {
	margin: 0;
	font-size: 16px;
}

.msb2b .msb2b-modal__x {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--msb2b-muted);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.msb2b .msb2b-modal__x:hover {
	background: #f2f2f2;
}

.msb2b-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.msb2b-selected {
	max-height: 280px;
	overflow-y: auto;
	margin-bottom: 22px;
	border: 1px solid var(--msb2b-border);
	border-radius: var(--msb2b-radius);
}

.msb2b-sel {
	display: grid;
	grid-template-columns: 44px 1fr 90px 32px;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-top: 1px solid var(--msb2b-border);
}

.msb2b-sel:first-child {
	border-top: 0;
}

.msb2b-sel img {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 4px;
}

.msb2b-sel__name span {
	display: block;
	font-weight: 600;
	font-size: 14px;
}

.msb2b-sel__name small {
	color: var(--msb2b-muted);
}

.msb2b .msb2b-sel .msb2b-row__qty .msb2b-qty {
	flex-basis: 72px;
	width: 72px;
}

.msb2b .msb2b-remove {
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #f4f4f4;
	color: #444;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.msb2b .msb2b-remove:hover {
	background: #fde4e1;
	color: var(--msb2b-accent);
}

.msb2b-empty {
	margin: 0;
	padding: 18px;
	color: var(--msb2b-muted);
	text-align: center;
}

/* Form */
.msb2b-form h3 {
	margin-bottom: 10px;
}

.msb2b-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px 16px;
}

.msb2b-field label {
	display: block;
	margin-bottom: 4px;
	font-size: 13px;
	font-weight: 600;
}

.msb2b-field--full {
	grid-column: 1 / -1;
}

.msb2b-req {
	color: var(--msb2b-accent);
}

.msb2b-field__error {
	display: block;
	min-height: 0;
	color: #b3261e;
	font-size: 12px;
}

.msb2b-field.has-error input {
	border-color: #b3261e;
}

.msb2b-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.msb2b-notice {
	margin-bottom: 12px;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 14px;
}

.msb2b-notice--error {
	background: #fdecea;
	color: #8a1c13;
}

/* Success */
.msb2b-success {
	padding: 20px 0 6px;
	text-align: center;
}

.msb2b-success__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin-bottom: 12px;
	border-radius: 50%;
	background: #e7f6ec;
	color: #1e7b3c;
	font-size: 32px;
}

.msb2b-success p {
	max-width: 460px;
	margin: 0 auto 10px;
}

.msb2b-success__ref {
	font-weight: 700;
}

/* Mobile */
@media (max-width: 767px) {
	.msb2b-toolbar {
		flex-direction: column;
	}

	.msb2b-cat {
		flex-basis: auto;
	}

	.msb2b-row {
		grid-template-columns: 56px 1fr;
		gap: 8px 12px;
		padding: 12px;
	}

	.msb2b-row__img {
		width: 56px;
		height: 56px;
	}

	/* Qty and Add share one line under the product. */
	.msb2b-row > .msb2b-row__qty {
		grid-column: 1 / 2;
	}

	.msb2b .msb2b-row > .msb2b-add {
		grid-column: 2 / 3;
	}

	.msb2b-row__qty .msb2b-qty-label {
		display: none;
	}

	.msb2b .msb2b-row__qty .msb2b-qty {
		flex-basis: 56px;
		width: 56px;
		padding: 8px 4px;
	}

	.msb2b-bar {
		justify-content: space-between;
	}

	.msb2b-bar .msb2b-btn {
		padding: 8px 14px;
		font-size: 14px;
	}

	.msb2b-modal {
		padding: 0;
		align-items: flex-end;
	}

	.msb2b-modal__panel {
		max-height: 92vh;
		padding: 22px 16px;
		border-radius: 14px 14px 0 0;
	}

	.msb2b-sel {
		grid-template-columns: 40px 1fr 64px 32px;
		gap: 8px;
	}

	.msb2b .msb2b-sel .msb2b-row__qty .msb2b-qty {
		flex-basis: 64px;
		width: 64px;
	}

	.msb2b-grid {
		grid-template-columns: 1fr;
	}
}
