/**
 * Cart / checkout / mini-cart styling for add-on fee rows.
 *
 * Brand tokens from mzr-settings — fall back to inline defaults.
 */

/* ----- Cart page + checkout section ----- */

.meshut-addon-cart-section {
	margin: 1.5rem 0;
	padding: 1rem 1.25rem;
	border: 1px solid var(--mzr-divider-color, #e5e5e5);
	border-radius: 16px;
	background: #fff;
}

.meshut-addon-cart-section--empty {
	display: none;
}

.meshut-addon-cart-heading {
	margin: 0 0 0.75rem;
	font-family: var(--mzr-font-primary, inherit);
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--mzr-secondary-color, #0F1E2E);
}

.meshut-addon-cart-list {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
}

.meshut-addon-cart-row {
	display: grid;
	grid-template-columns: 64px 1fr auto auto auto;
	gap: 0.75rem;
	align-items: center;
	padding: 0.5rem 0;
	border-top: 1px solid var(--mzr-divider-color, #f0f0f0);
}

.meshut-addon-cart-row:first-child {
	border-top: 0;
	padding-top: 0;
}

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

.meshut-addon-cart-info {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.meshut-addon-cart-title {
	font-weight: 600;
	color: var(--mzr-secondary-color, #0F1E2E);
	font-size: 0.9375rem;
	line-height: 1.3;
}

.meshut-addon-cart-sku {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.8125rem;
	color: #6b7280;
}

/* qty pill — mirrors widget */
.meshut-addon-cart-qty {
	display: inline-flex !important;
	align-items: stretch !important;
	height: 32px !important;
	min-height: 0 !important;
	border: 1px solid var(--mzr-divider-color, #d1d5db) !important;
	border-radius: 999px !important;
	background: #fff !important;
	overflow: hidden !important;
	box-sizing: border-box !important;
}

.meshut-addon-cart-qty .meshut-addon-cart-qty-btn {
	width: 30px !important;
	height: 30px !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: var(--mzr-secondary-color, #0F1E2E) !important;
	font-size: 1.125rem !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	cursor: pointer;
	box-shadow: none !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
}

.meshut-addon-cart-qty .meshut-addon-cart-qty-btn:hover:not(:disabled) {
	background: var(--mzr-grey-color, #f5f5f5) !important;
}

.meshut-addon-cart-qty .meshut-addon-cart-qty-input {
	width: 40px !important;
	height: 30px !important;
	min-height: 0 !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;
	box-shadow: none !important;
	outline: none !important;
	text-align: center !important;
	font-size: 0.9375rem !important;
	line-height: 30px !important;
	color: var(--mzr-secondary-color, #0F1E2E) !important;
	-moz-appearance: textfield !important;
	-webkit-appearance: none !important;
	appearance: textfield !important;
}

.meshut-addon-cart-qty .meshut-addon-cart-qty-input::-webkit-outer-spin-button,
.meshut-addon-cart-qty .meshut-addon-cart-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none !important;
	margin: 0 !important;
	display: none !important;
}

.meshut-addon-cart-line-price {
	font-weight: 600;
	color: var(--mzr-primary-color, #B8952A);
	white-space: nowrap;
	min-width: 80px;
	text-align: right;
}

.meshut-addon-cart-remove {
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 999px;
	background: var(--mzr-grey-color, #f5f5f5);
	color: #6b7280;
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.meshut-addon-cart-remove:hover {
	background: #fee2e2;
	color: #b91c1c;
}

/* Busy state */
.meshut-addon-cart-row--busy {
	opacity: 0.5;
	pointer-events: none;
}

/* ----- Mini-cart slide-out ----- */

.meshut-addon-mini-list {
	margin: 0.75rem 0;
	padding: 0.75rem 0;
	border-top: 1px solid var(--mzr-divider-color, #e5e5e5);
	border-bottom: 1px solid var(--mzr-divider-color, #e5e5e5);
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
}

.meshut-addon-mini-row {
	display: grid;
	grid-template-columns: 40px 1fr auto;
	gap: 0.5rem;
	align-items: center;
}

.meshut-addon-mini-thumb {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 6px;
	background: var(--mzr-grey-color, #f5f5f5);
	border: 1px solid var(--mzr-divider-color, #e5e5e5);
	display: block;
}

.meshut-addon-mini-meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.meshut-addon-mini-title {
	font-weight: 600;
	font-size: 0.875rem;
	color: var(--mzr-secondary-color, #0F1E2E);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.meshut-addon-mini-line {
	font-size: 0.8125rem;
	color: #6b7280;
}

.meshut-addon-mini-qty {
	margin-right: 0.25rem;
}

.meshut-addon-mini-remove {
	width: 24px;
	height: 24px;
	border-radius: 999px;
	background: var(--mzr-grey-color, #f5f5f5);
	color: #6b7280;
	font-size: 0.875rem;
	line-height: 1;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, color 0.15s ease;
}

.meshut-addon-mini-remove:hover {
	background: #fee2e2;
	color: #b91c1c;
	text-decoration: none;
}

.meshut-addon-mini-total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 0.75rem;
	padding-top: 0.625rem;
	border-top: 1px solid var(--mzr-divider-color, #e5e5e5);
	font-weight: 600;
	color: var(--mzr-secondary-color, #0F1E2E);
}

.meshut-addon-mini-total-label {
	font-size: 0.9375rem;
}

.meshut-addon-mini-total-value {
	color: var(--mzr-primary-color, #B8952A);
	font-size: 1rem;
}

/* Empty placeholders should not occupy space */
.meshut-addon-mini-list--empty,
.meshut-addon-cart-section--empty {
	display: none;
}

/* ----- Responsive ----- */

@media (max-width: 600px) {
	.meshut-addon-cart-row {
		grid-template-columns: 56px 1fr auto;
		grid-template-rows: auto auto;
		row-gap: 0.5rem;
	}
	.meshut-addon-cart-thumb {
		width: 56px;
		height: 56px;
	}
	.meshut-addon-cart-qty,
	.meshut-addon-cart-line-price,
	.meshut-addon-cart-remove {
		grid-row: 2;
	}
	.meshut-addon-cart-info {
		grid-column: 2 / -1;
	}
}
