/**
 * Add-Ons Table widget — frontend styling.
 *
 * Theme tokens (resolved by mzr-settings CSS Options at wp_head priority 5):
 *   --mzr-primary-color, --mzr-secondary-color, --mzr-grey-color,
 *   --mzr-divider-color, --mzr-text-color, --mzr-font-primary
 */

.meshut-aot {
	margin: 1.5rem 0;
	color: var(--mzr-text-color, #1a1a1a);
	font-family: inherit;
}

.meshut-aot__section-header {
	font-family: var(--mzr-font-primary, inherit);
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--mzr-secondary-color, #0F1E2E);
	margin: 0 0 1rem;
}

.meshut-aot__section + .meshut-aot__section {
	margin-top: 2rem;
}

.meshut-aot__sub-header {
	font-family: var(--mzr-font-primary, inherit);
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--mzr-secondary-color, #0F1E2E);
	margin: 0 0 0.75rem;
	padding: 0.5rem 1rem;
	background: var(--mzr-grey-color, #f5f5f5);
	border-left: 3px solid var(--mzr-primary-color, #B8952A);
	border-radius: 16px;
	overflow: hidden;
}

.meshut-aot__table-wrap {
	border: 1px solid var(--mzr-divider-color, #e5e5e5);
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
}

.meshut-aot__table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	margin: 0;
}

.meshut-aot__table thead th {
	font-size: 0.8125rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--mzr-secondary-color, #0F1E2E);
	background: var(--mzr-grey-color, #f5f5f5);
	padding: 0.625rem 0.75rem;
	text-align: left;
	border-bottom: 1px solid var(--mzr-divider-color, #e5e5e5);
	white-space: nowrap;
}

.meshut-aot__th-thumb { width: 80px; }
.meshut-aot__th-sku   { width: 120px; }
.meshut-aot__th-price { width: 110px; text-align: right; }
.meshut-aot__th-qty   { width: 130px; }
.meshut-aot__th-action { width: 160px; }

.meshut-aot__row td {
	padding: 0.625rem 0.75rem;
	border-bottom: 1px solid var(--mzr-divider-color, #e5e5e5);
	vertical-align: middle;
}

.meshut-aot__row:last-child td {
	border-bottom: 0;
}

.meshut-aot__td-thumb {
	width: 80px;
}

.meshut-aot__thumb {
	display: block;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid var(--mzr-divider-color, #e5e5e5);
	background: var(--mzr-grey-color, #f5f5f5);
}

.meshut-aot__td-sku {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.875rem;
	color: var(--mzr-secondary-color, #0F1E2E);
}

.meshut-aot__td-title {
	font-weight: 500;
}

.meshut-aot__low-note {
	display: inline-block;
	margin-left: 0.5rem;
	padding: 0.125rem 0.5rem;
	font-size: 0.75rem;
	font-weight: 500;
	background: #fef3c7;
	color: #92400e;
	border-radius: 999px;
}

.meshut-aot__td-price {
	font-weight: 600;
	text-align: right;
	color: var(--mzr-primary-color, #B8952A);
	white-space: nowrap;
}

/* Qty pill — bumped specificity + targeted !important to survive
   WoodMart's input + button overrides (min-height, border-radius,
   background, padding). */

.meshut-aot .meshut-aot__qty-wrap {
	display: inline-flex !important;
	align-items: stretch !important;
	width: auto !important;
	height: 32px !important;
	min-height: 0 !important;
	max-height: 32px !important;
	padding: 0 !important;
	border: 1px solid var(--mzr-divider-color, #d1d5db) !important;
	border-radius: 999px !important;
	background: #fff !important;
	overflow: hidden !important;
	box-shadow: none !important;
	box-sizing: border-box !important;
	line-height: 1 !important;
}

.meshut-aot .meshut-aot__qty-wrap .meshut-aot__qty-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex: 0 0 30px !important;
	width: 30px !important;
	height: 30px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-height: 30px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--mzr-secondary-color, #0F1E2E) !important;
	font-size: 1.125rem !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	cursor: pointer;
	transition: background 0.15s ease;
}

.meshut-aot .meshut-aot__qty-wrap .meshut-aot__qty-btn:hover:not(:disabled) {
	background: var(--mzr-grey-color, #f5f5f5) !important;
}

.meshut-aot .meshut-aot__qty-wrap .meshut-aot__qty-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.meshut-aot .meshut-aot__qty-wrap .meshut-aot__qty {
	flex: 0 0 40px !important;
	width: 40px !important;
	height: 30px !important;
	min-height: 0 !important;
	max-height: 30px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-left: 1px solid var(--mzr-divider-color, #d1d5db) !important;
	border-right: 1px solid var(--mzr-divider-color, #d1d5db) !important;
	border-radius: 0 !important;
	background: #fff !important;
	background-color: #fff !important;
	box-shadow: none !important;
	outline: none !important;
	color: var(--mzr-secondary-color, #0F1E2E) !important;
	text-align: center !important;
	font-size: 0.9375rem !important;
	font-weight: 500 !important;
	line-height: 30px !important;
	-moz-appearance: textfield !important;
	-webkit-appearance: none !important;
	appearance: textfield !important;
}

.meshut-aot .meshut-aot__qty-wrap .meshut-aot__qty::-webkit-outer-spin-button,
.meshut-aot .meshut-aot__qty-wrap .meshut-aot__qty::-webkit-inner-spin-button {
	-webkit-appearance: none !important;
	margin: 0 !important;
	display: none !important;
}

.meshut-aot .meshut-aot__qty-wrap .meshut-aot__qty:disabled {
	background: var(--mzr-grey-color, #f5f5f5) !important;
	color: #9ca3af !important;
	cursor: not-allowed;
}

.meshut-aot .meshut-aot__btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: auto !important;
	height: 32px !important;
	min-height: 0 !important;
	max-height: 32px !important;
	padding: 0 1.25rem !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: var(--mzr-secondary-color, #0F1E2E) !important;
	color: #fff !important;
	font-size: 0.875rem !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: background 0.15s ease;
	white-space: nowrap;
	box-sizing: border-box !important;
}

.meshut-aot .meshut-aot__btn:hover:not(:disabled) {
	background: var(--mzr-primary-color, #B8952A) !important;
}

.meshut-aot .meshut-aot__btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.meshut-aot__btn--busy {
	opacity: 0.7;
	pointer-events: none;
}

.meshut-aot__btn--added {
	background: #16a34a;
}

.meshut-aot__checkbox-label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	margin: 0;
}

.meshut-aot__checkbox {
	width: 18px;
	height: 18px;
	margin: 0;
	cursor: pointer;
	accent-color: var(--mzr-primary-color, #B8952A);
}

.meshut-aot__row--oos td {
	opacity: 0.55;
}

.meshut-aot__row--oos .meshut-aot__qty,
.meshut-aot__row--oos .meshut-aot__checkbox {
	pointer-events: none;
}

.meshut-aot__oos {
	display: inline-block;
	padding: 0.25rem 0.625rem;
	font-size: 0.8125rem;
	font-weight: 600;
	background: var(--mzr-grey-color, #f5f5f5);
	color: #6b7280;
	border-radius: 4px;
	white-space: nowrap;
}

.meshut-aot__bulk-bar {
	margin-top: 1rem;
	display: flex;
	justify-content: flex-end;
}

.meshut-aot__bulk-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	padding: 0 1.5rem;
	border: none;
	border-radius: 999px;
	background: var(--mzr-primary-color, #B8952A);
	color: #fff;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease;
}

.meshut-aot__bulk-btn:hover:not(:disabled) {
	background: var(--mzr-secondary-color, #0F1E2E);
}

.meshut-aot__bulk-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.meshut-aot__message {
	margin-top: 0.75rem;
	padding: 0.625rem 0.875rem;
	border-radius: 4px;
	font-size: 0.875rem;
}

.meshut-aot__message--error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.meshut-aot__message--success {
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

/* Elementor editor placeholder */
.meshut-aot--placeholder {
	padding: 1.5rem;
	background: var(--mzr-grey-color, #f5f5f5);
	border: 1px dashed var(--mzr-divider-color, #d1d5db);
	border-radius: 4px;
	text-align: center;
	color: #6b7280;
	font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
	.meshut-aot__table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}
	.meshut-aot__th-thumb,
	.meshut-aot__td-thumb {
		width: 64px;
	}
	.meshut-aot__thumb {
		width: 48px;
		height: 48px;
	}
}
