/**
 * Mighty Emporium — Bulk Variations Table
 * Layout: 4-column grid — icon | name+description | price | quantity.
 */

/* Hide the Beaver Themer price-range module under the title — the range is
   shown per-variation in the table instead. Scoped by load: this stylesheet
   only enqueues on products handled by the bulk-variations table. */
.fl-module-fl-woo-product-price {
	display: none;
}

.me-bv-wrap {
	margin: 0 0 1.5em;
}

.me-bv-heading {
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0 0 0.85em;
}

.me-bv-table {
	display: flex;
	flex-direction: column;
}

/* 4-column grid: icon | name+desc (widest) | price | quantity (narrow). */
.me-bv-row {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) auto auto;
	align-items: center;
	column-gap: 1em;
	padding: 0.85em 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.me-bv-row:first-child {
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Col 1 — icon (clickable) */
.me-bv-icon {
	width: 64px;
	height: 64px;
	display: block;
}

.me-bv-icon img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 4px;
	display: block;
	margin: 0;
}

/* Col 2 — name + description (widest column) */
.me-bv-meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.me-bv-name {
	font-weight: 700;
	line-height: 1.25;
	font-size: 1.15em;
}

.me-bv-desc {
	font-size: 1em;
	opacity: 0.7;
	line-height: 1.3;
	margin-top: 2px;
}

.me-bv-desc p {
	margin: 0;
}

/* Icon + name are clickable to swap the main product image. */
.me-bv-pick {
	cursor: pointer;
}

.me-bv-pick:hover .me-bv-name {
	text-decoration: underline;
}

/* Col 3 — price (tight to content; right-aligned) */
.me-bv-price {
	font-weight: 600;
	white-space: nowrap;
	justify-self: end;
	text-align: right;
}

.me-bv-price del {
	opacity: 0.5;
	font-weight: 400;
	margin-right: 0.35em;
}

/* Col 4 — quantity stepper (narrow, right-aligned) */
.me-bv-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 999px;
	overflow: hidden;
	justify-self: end;
}

/* Compact stepper. Higher specificity (.me-bv-qty .me-bv-step) beats the
   theme's generic .fl-page button styling so hover/active are clean. */
.me-bv-qty .me-bv-step {
	border: 0;
	background: #fff;
	color: #111;
	width: 1.5em;
	height: 1.9em;
	font-size: 0.9rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	box-shadow: none;
	transition: background 0.12s ease, color 0.12s ease;
}

.me-bv-qty .me-bv-step:hover,
.me-bv-qty .me-bv-step:focus,
.me-bv-qty .me-bv-step:active {
	background: #000;
	color: #fff;
	border: 0;
	outline: none;
	box-shadow: none;
}

.me-bv-input {
	width: 2.2em;
	text-align: center;
	border: 0;
	border-left: 1px solid rgba(0, 0, 0, 0.12);
	border-right: 1px solid rgba(0, 0, 0, 0.12);
	background: transparent;
	font-size: 16px;
	padding: 0.4em 0;
	-moz-appearance: textfield;
	appearance: textfield;
}

.me-bv-input::-webkit-outer-spin-button,
.me-bv-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Out-of-stock row */
.me-bv-row--unavailable {
	opacity: 0.55;
}

.me-bv-oos {
	font-size: 0.85em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-weight: 600;
	justify-self: end;
}

/* Actions */
.me-bv-actions {
	margin-top: 1.25em;
}

.me-bv-add.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

/* Notice */
.me-bv-notice {
	margin-top: 0.85em;
	font-size: 0.9em;
}

.me-bv-notice.is-success {
	color: #2e7d32;
}

.me-bv-notice.is-error {
	color: #c62828;
}

/* Mobile: icon spans two rows; name on top, price + quantity beneath. */
@media (max-width: 600px) {
	.me-bv-row {
		grid-template-columns: 64px minmax(0, 1fr) auto;
		grid-template-areas:
			"icon meta meta"
			"icon price qty";
		row-gap: 0.4em;
	}

	.me-bv-icon  { grid-area: icon; }
	.me-bv-meta  { grid-area: meta; }
	.me-bv-price { grid-area: price; justify-self: start; }
	.me-bv-qty,
	.me-bv-oos   { grid-area: qty; }
}

/* ----------------------------------------------------------------------------
   THEME-OVERRIDE LAYER (must win the cascade)
   bb-theme ships:
     • .woocommerce h3:not(.woocommerce-shop h3){text-transform:capitalize}  (0,2,2)
     • input[type=number]{width:100%;font-size:14px;padding:6px 12px}         (0,1,1)
   Both beat plain single-class selectors, so these use higher specificity
   (.me-bv-wrap …) + !important to force our styling. Scoped to this widget.
---------------------------------------------------------------------------- */
.me-bv-wrap .me-bv-heading {
	text-transform: uppercase !important;
}

/* Variation name in standard case (overrides any theme capitalize/uppercase). */
.me-bv-wrap .me-bv-name {
	text-transform: none !important;
}

/* Compact, rounded quantity stepper (matches the target mockup). */
.me-bv-wrap .me-bv-qty {
	width: auto !important;
	background: #fff !important;
}

.me-bv-wrap .me-bv-qty .me-bv-input {
	width: 40px !important;
	min-width: 0 !important;
	max-width: 40px !important;
	height: auto !important;
	font-size: 16px !important;
	padding: 4px 0 !important;
	text-align: center !important;
	display: inline-block !important;
	background: transparent !important;
	border: 0 !important;
	border-left: 1px solid rgba(0, 0, 0, 0.12) !important;
	border-right: 1px solid rgba(0, 0, 0, 0.12) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.me-bv-wrap .me-bv-qty .me-bv-step {
	width: 26px !important;
	height: 32px !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: #fff !important;
	color: #777 !important;
	font-size: 16px !important;
	line-height: 1 !important;
	box-shadow: none !important;
	cursor: pointer !important;
}

.me-bv-wrap .me-bv-qty .me-bv-step:hover,
.me-bv-wrap .me-bv-qty .me-bv-step:focus,
.me-bv-wrap .me-bv-qty .me-bv-step:active {
	background: #000 !important;
	color: #fff !important;
	border: 0 !important;
	outline: none !important;
}

/* Disabled add-to-cart button (non-purchasers / logged-out) — greyed like the
   standard button on every other product. */
.me-bv-wrap .single_add_to_cart_button.disabled,
.me-bv-wrap .single_add_to_cart_button:disabled {
	opacity: 0.5 !important;
	cursor: not-allowed !important;
}
