/* ==========================================================================
   MEGATECH — shared components (COMPONENT-SPECS §8, §10–18, §20, §22)
   ========================================================================== */

.mt-icon {
	flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Buttons (C§13)
   ----------------------------------------------------------------------- */

.mt-btn {
	--_bg: transparent;
	--_fg: var(--mt-text-heading);
	--_bd: transparent;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--mt-btn-icon-gap);
	min-height: var(--mt-btn-h-md);
	padding: 0 var(--mt-btn-px-md);
	border: 1.5px solid var(--_bd);
	border-radius: var(--mt-radius-md);
	background: var(--_bg);
	color: var(--_fg);
	font-family: var(--mt-font-body);
	font-size: var(--mt-fs-md);
	font-weight: var(--mt-fw-semibold);
	line-height: 1.1;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition:
		background-color var(--mt-dur-fast) var(--mt-ease-standard),
		border-color var(--mt-dur-fast) var(--mt-ease-standard),
		color var(--mt-dur-fast) var(--mt-ease-standard),
		box-shadow var(--mt-dur-fast) var(--mt-ease-standard),
		transform var(--mt-dur-fast) var(--mt-ease-standard);
}

.mt-btn:hover {
	color: var(--_fg);
}

.mt-btn:active {
	transform: translateY(1px);
}

.mt-btn:focus-visible {
	outline: none;
	box-shadow: var(--mt-focus-ring);
}

.mt-btn--primary {
	--_bg: var(--mt-btn-primary-bg);
	--_fg: var(--mt-btn-primary-text);
}

.mt-btn--primary:hover {
	--_bg: var(--mt-btn-primary-bg-hover);
	box-shadow: var(--mt-shadow-green);
}

.mt-btn--primary:active {
	--_bg: var(--mt-btn-primary-bg-active);
}

.mt-btn--outline {
	--_bg: var(--mt-bg-surface);
	--_fg: var(--mt-btn-outline-text);
	--_bd: var(--mt-btn-outline-border);
}

.mt-btn--outline:hover {
	--_bg: var(--mt-color-primary-soft);
	--_fg: var(--mt-color-primary-strong-hover);
}

.mt-btn--dark {
	--_bg: var(--mt-ink-900);
	--_fg: var(--mt-text-on-dark);
}

.mt-btn--dark:hover {
	--_bg: var(--mt-ink-700);
}

.mt-btn--ghost-light {
	--_fg: var(--mt-text-on-dark);
	--_bd: rgba(255, 255, 255, 0.7);
	border-width: 1px;
}

.mt-btn--ghost-light:hover {
	--_bg: rgba(255, 255, 255, 0.12);
	--_bd: var(--mt-white);
}

.mt-btn--secondary {
	--_bg: var(--mt-bg-surface);
	--_fg: var(--mt-text-heading);
	--_bd: var(--mt-border-default);
	border-width: 1px;
}

.mt-btn--secondary:hover {
	--_bd: var(--mt-border-strong);
	--_bg: var(--mt-bg-subtle);
}

.mt-btn--link {
	--_fg: var(--mt-color-primary-strong);
	min-height: auto;
	padding: 0;
	border: 0;
	font-size: var(--mt-fs-sm);
}

.mt-btn--link:hover {
	--_fg: var(--mt-color-primary-strong-hover);
	text-decoration: underline;
}

.mt-btn--link .mt-icon {
	transition: transform var(--mt-dur-fast) var(--mt-ease-standard);
}

.mt-btn--link:hover .mt-icon {
	transform: translateX(3px);
}

.mt-btn--pill {
	border-radius: var(--mt-radius-pill);
}

.mt-btn--sm {
	min-height: var(--mt-btn-h-sm);
	padding: 0 var(--mt-btn-px-sm);
	font-size: var(--mt-fs-sm);
}

.mt-btn--lg {
	min-height: var(--mt-btn-h-lg);
	padding: 0 var(--mt-btn-px-lg);
	border-radius: 10px;
	font-size: var(--mt-fs-lg);
	font-weight: var(--mt-fw-bold);
}

.mt-btn--xl {
	min-height: var(--mt-btn-h-xl);
	padding: 0 var(--mt-space-8);
	border-radius: 10px;
	font-size: 1.0625rem;
	font-weight: var(--mt-fw-bold);
}

.mt-btn--lg.mt-btn--pill,
.mt-btn--xl.mt-btn--pill {
	border-radius: var(--mt-radius-pill);
}

.mt-btn--block {
	display: flex;
	width: 100%;
}

.mt-btn:disabled,
.mt-btn[aria-disabled="true"] {
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

.mt-btn--primary:disabled,
.mt-btn--primary[aria-disabled="true"] {
	--_bg: var(--mt-green-300);
	--_fg: var(--mt-green-850);
}

/* Loading: label hidden, fixed width, spinner centred. */
.mt-btn.is-loading {
	color: transparent !important;
	pointer-events: none;
}

.mt-btn.is-loading > * {
	visibility: hidden;
}

.mt-btn.is-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	width: 18px;
	height: 18px;
	margin: auto;
	border: 2px solid currentColor;
	border-color: var(--_fg) var(--_fg) var(--_fg) transparent;
	border-radius: 50%;
	animation: mt-spin 0.8s linear infinite;
}

@media (max-width: 767.98px) {
	.mt-btn--block-mobile {
		display: flex;
		width: 100%;
		min-height: 48px;
	}
}

/* Icon-only buttons (≥44px touch target). */
.mt-icon-btn {
	display: inline-grid;
	place-items: center;
	width: var(--mt-touch-min);
	height: var(--mt-touch-min);
	padding: 0;
	border: 0;
	border-radius: var(--mt-radius-md);
	background: transparent;
	color: var(--mt-text-heading);
	transition: background-color var(--mt-dur-fast) var(--mt-ease-standard);
}

.mt-icon-btn:hover {
	background: var(--mt-bg-muted);
}

@keyframes mt-spin {
	to {
		transform: rotate(360deg);
	}
}

/* --------------------------------------------------------------------------
   Forms (C§14) — also applied to WooCommerce/WordPress form controls
   ----------------------------------------------------------------------- */

.mt-label {
	display: block;
	margin-bottom: var(--mt-space-2);
	color: var(--mt-text-heading);
	font-size: var(--mt-fs-base);
	font-weight: var(--mt-fw-bold);
}

.mt-field {
	position: relative;
	margin-bottom: var(--mt-space-5);
}

.mt-input,
.mt-field input[type="text"],
.mt-field input[type="email"],
.mt-field input[type="password"],
.mt-field input[type="tel"],
.mt-field input[type="search"],
.mt-field input[type="number"],
.mt-field select,
.mt-field textarea {
	width: 100%;
	min-height: var(--mt-input-h);
	padding: 0 var(--mt-space-4);
	border: 1px solid var(--mt-border-default);
	border-radius: var(--mt-radius-md);
	background: var(--mt-bg-surface);
	color: var(--mt-text-body);
	font-size: 1rem; /* ≥16px: no iOS zoom */
	transition:
		border-color var(--mt-dur-fast) var(--mt-ease-standard),
		box-shadow var(--mt-dur-fast) var(--mt-ease-standard);
}

.mt-field textarea {
	min-height: 120px;
	padding-block: var(--mt-space-3);
}

.mt-field--icon .mt-input {
	padding-left: var(--mt-space-12);
}

.mt-field__icon {
	position: absolute;
	top: calc(var(--mt-input-h) / 2);
	left: var(--mt-space-4);
	color: var(--mt-text-secondary);
	transform: translateY(-50%);
	pointer-events: none;
}

.mt-input::placeholder,
.mt-field input::placeholder,
.mt-field textarea::placeholder {
	color: var(--mt-text-muted);
}

.mt-input:hover,
.mt-field input:hover,
.mt-field select:hover,
.mt-field textarea:hover {
	border-color: var(--mt-border-strong);
}

.mt-input:focus,
.mt-field input:focus,
.mt-field select:focus,
.mt-field textarea:focus {
	outline: none;
	border-color: var(--mt-border-focus);
	box-shadow: var(--mt-focus-ring);
}

.mt-field.is-invalid .mt-input,
.mt-input[aria-invalid="true"],
.mt-field input[aria-invalid="true"] {
	border-color: var(--mt-danger);
}

.mt-field.is-valid .mt-input {
	border-color: var(--mt-success);
}

.mt-field__error {
	display: flex;
	align-items: flex-start;
	gap: var(--mt-space-1);
	margin: var(--mt-space-2) 0 0;
	color: var(--mt-danger);
	font-size: var(--mt-fs-sm);
	font-weight: var(--mt-fw-medium);
}

.mt-field__error::before {
	content: "";
	flex: 0 0 14px;
	height: 14px;
	margin-top: 2px;
	background: currentColor;
	-webkit-mask: url("../icons/lucide/circle-alert.svg") center / contain no-repeat;
	mask: url("../icons/lucide/circle-alert.svg") center / contain no-repeat;
}

.mt-field__hint {
	margin: var(--mt-space-2) 0 0;
	color: var(--mt-text-secondary);
	font-size: var(--mt-fs-sm);
}

/* Checkbox (C§14) */
.mt-checkbox {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	border: 1.5px solid var(--mt-border-strong);
	border-radius: var(--mt-radius-xs);
	background: var(--mt-bg-surface);
	cursor: pointer;
	transition:
		background-color var(--mt-dur-fast) var(--mt-ease-standard),
		border-color var(--mt-dur-fast) var(--mt-ease-standard);
}

.mt-checkbox:hover {
	border-color: var(--mt-color-primary);
}

.mt-checkbox:checked {
	border-color: var(--mt-color-primary);
	background: var(--mt-color-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.mt-checkbox:focus-visible {
	outline: none;
	box-shadow: var(--mt-focus-ring);
}

.mt-checkbox[aria-invalid="true"] {
	border-color: var(--mt-danger);
	box-shadow: 0 0 0 1px var(--mt-danger);
}

/* Consent rows (C§22) — always separate, never pre-checked */
.mt-consent {
	display: flex;
	align-items: flex-start;
	gap: var(--mt-space-3);
	color: var(--mt-text-body);
	font-size: var(--mt-fs-base);
	line-height: 1.5;
}

.mt-consent + .mt-consent {
	margin-top: var(--mt-space-3);
}

.mt-consent label {
	cursor: pointer;
}

.mt-consent a {
	color: var(--mt-color-primary-strong);
	text-decoration: underline;
}

.mt-consent__optional {
	color: var(--mt-text-muted);
	font-size: var(--mt-fs-sm);
}

/* --------------------------------------------------------------------------
   Badges (C§15)
   ----------------------------------------------------------------------- */

.mt-badge {
	display: inline-flex;
	align-items: center;
	gap: var(--mt-space-1);
	height: 20px;
	padding: 0 var(--mt-space-2);
	border-radius: var(--mt-radius-sm);
	background: var(--mt-color-primary-strong);
	color: var(--mt-color-on-primary);
	font-size: var(--mt-fs-2xs);
	font-weight: var(--mt-fw-bold);
	line-height: 1;
	white-space: nowrap;
}

.mt-badge--sale {
	background: var(--mt-danger);
}

.mt-badge--soldout {
	background: var(--mt-gray-700);
}

.mt-badge--pill {
	height: 24px;
	padding: 0 var(--mt-space-3);
	border-radius: var(--mt-radius-pill);
	font-size: var(--mt-fs-xs);
	font-weight: var(--mt-fw-semibold);
}

.mt-badge--soft {
	background: var(--mt-color-primary-soft);
	color: var(--mt-color-primary-strong);
	font-size: var(--mt-fs-sm);
}

.mt-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 32px;
	padding: 0 var(--mt-space-3);
	border-radius: var(--mt-radius-pill);
	font-size: var(--mt-fs-sm);
	font-weight: var(--mt-fw-semibold);
}

.mt-status--success { background: var(--mt-success-bg); color: var(--mt-color-primary-strong); }
.mt-status--info { background: var(--mt-info-bg); color: var(--mt-info); }
.mt-status--neutral { background: var(--mt-neutral-status-bg); color: var(--mt-neutral-status); }
.mt-status--danger { background: var(--mt-danger-bg); color: var(--mt-danger); }
.mt-status--warning { background: var(--mt-warning-bg); color: var(--mt-warning); }

/* --------------------------------------------------------------------------
   Notices (C§16) + WooCommerce notice mapping
   ----------------------------------------------------------------------- */

.mt-notice,
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .woocommerce-error,
.mt-page .woocommerce-message,
.mt-page .woocommerce-info,
.mt-page .woocommerce-error {
	--_c: var(--mt-info);
	--_bg: var(--mt-info-bg);
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: var(--mt-space-3);
	margin: 0 0 var(--mt-space-4);
	padding: 14px var(--mt-space-4) 14px calc(var(--mt-space-4) + 4px);
	border: 0;
	border-radius: var(--mt-radius-md);
	background: var(--_bg);
	color: var(--mt-text-body);
	font-size: var(--mt-fs-base);
	line-height: 1.5;
	list-style: none;
}

.mt-notice::before,
.mt-page .woocommerce-message::before,
.mt-page .woocommerce-info::before,
.mt-page .woocommerce-error::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 4px;
	height: auto;
	border-radius: var(--mt-radius-md) 0 0 var(--mt-radius-md);
	background: var(--_c);
	font-family: inherit;
}

.mt-notice--success,
.mt-page .woocommerce-message {
	--_c: var(--mt-success);
	--_bg: var(--mt-success-bg);
}

.mt-notice--warning {
	--_c: var(--mt-warning);
	--_bg: var(--mt-warning-bg);
}

.mt-notice--error,
.mt-page .woocommerce-error {
	--_c: var(--mt-danger);
	--_bg: var(--mt-danger-bg);
}

.mt-notice__icon {
	color: var(--_c);
	margin-top: 1px;
}

.mt-notice__body {
	flex: 1;
	min-width: 0;
}

.mt-notice__body > :last-child {
	margin-bottom: 0;
}

.mt-notice__close {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: -12px -12px -12px 0;
	border: 0;
	background: transparent;
	color: var(--mt-text-secondary);
}

.mt-page .woocommerce-message .button,
.mt-page .woocommerce-info .button,
.mt-page .woocommerce-error .button {
	order: 2;
	margin-left: auto;
}

/* --------------------------------------------------------------------------
   Breadcrumb (C§8 variant A)
   ----------------------------------------------------------------------- */

.mt-breadcrumb {
	font-size: var(--mt-fs-sm);
	color: var(--mt-text-secondary);
}

.mt-breadcrumb__list {
	display: flex;
	align-items: center;
	gap: var(--mt-space-2);
	overflow-x: auto;
	white-space: nowrap;
	scrollbar-width: none;
	-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
	mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
}

.mt-breadcrumb__list::-webkit-scrollbar {
	display: none;
}

.mt-breadcrumb__item {
	display: inline-flex;
	align-items: center;
	gap: var(--mt-space-2);
}

.mt-breadcrumb a {
	color: var(--mt-text-secondary);
	text-decoration: none;
}

.mt-breadcrumb a:hover {
	color: var(--mt-color-primary-strong);
	text-decoration: underline;
}

.mt-breadcrumb [aria-current="page"] {
	color: var(--mt-text-body);
}

.mt-breadcrumb__sep {
	color: var(--mt-text-muted);
}

@media (min-width: 768px) {
	.mt-breadcrumb__list {
		-webkit-mask-image: none;
		mask-image: none;
	}
}

/* --------------------------------------------------------------------------
   Section heading (C§20.2) — same pattern as footer column titles
   ----------------------------------------------------------------------- */

.mt-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--mt-space-4);
	margin-bottom: var(--mt-section-title-gap);
}

.mt-section-head__title {
	display: flex;
	align-items: center;
	gap: var(--mt-space-3);
	margin: 0;
	font-size: var(--mt-fs-2xl);
	font-weight: var(--mt-fw-extrabold);
}

.mt-section-head__title::before {
	content: "";
	flex: 0 0 4px;
	height: 20px;
	border-radius: 2px;
	background: var(--mt-color-primary);
}

/* --------------------------------------------------------------------------
   Product grid + card (C§10.1) — mobile always 2 columns
   ----------------------------------------------------------------------- */

ul.mt-products,
.woocommerce ul.mt-products {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--mt-card-gap);
	margin: 0 0 var(--mt-space-8);
	padding: 0;
	list-style: none;
}

.woocommerce ul.mt-products::before,
.woocommerce ul.mt-products::after {
	display: none;
}

/* WooCommerce's float grid (.columns-N li.product { width: 16.95% … }) has a
   higher specificity than ours; the grid owns sizing here. */
ul.mt-products > li,
ul.mt-products > li.product {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0;
	clear: none !important;
}

@media (min-width: 768px) {
	ul.mt-products,
	.woocommerce ul.mt-products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	ul.mt-products.columns-4,
	ul.mt-products.columns-5 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	ul.mt-products.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	ul.mt-products.columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	ul.mt-products.columns-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.mt-product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: var(--mt-space-2);
	border: 1px solid var(--mt-border-subtle);
	border-radius: var(--mt-radius-lg);
	background: var(--mt-bg-surface);
	box-shadow: var(--mt-shadow-xs);
	transition:
		transform var(--mt-dur-base) var(--mt-ease-standard),
		border-color var(--mt-dur-base) var(--mt-ease-standard),
		box-shadow var(--mt-dur-base) var(--mt-ease-standard);
}

@media (min-width: 768px) {
	.mt-product-card {
		padding: var(--mt-space-3);
	}
}

.mt-product-card__media {
	position: relative;
	aspect-ratio: var(--mt-ratio-product);
	overflow: hidden;
	border-radius: var(--mt-radius-md);
	background: var(--mt-bg-muted);
}

.mt-product-card__media--white {
	background: var(--mt-bg-surface);
}

.mt-product-card__image-link {
	display: block;
	width: 100%;
	height: 100%;
}

.mt-product-card__img,
.mt-product-card .mt-product-card__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform var(--mt-dur-slow) var(--mt-ease-out);
}

.mt-product-card.is-out-of-stock .mt-product-card__img {
	opacity: 0.5;
}

.mt-product-card__badge {
	position: absolute;
	top: var(--mt-space-2);
	left: var(--mt-space-2);
	z-index: 1;
}

.mt-product-card__fav {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: var(--mt-text-heading);
	transition: color var(--mt-dur-fast) var(--mt-ease-standard), transform var(--mt-dur-base) var(--mt-ease-standard);
}

/* 44px touch target around the 32px visual. */
.mt-product-card__fav::before {
	content: "";
	position: absolute;
	inset: -6px;
}

.mt-product-card__fav:hover,
.mt-product-card__fav.is-active {
	color: var(--mt-color-primary-strong);
}

.mt-product-card__fav.is-active .mt-icon {
	fill: currentColor;
}

.mt-product-card__fav.is-bumping {
	transform: scale(1.15);
}

.mt-product-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: var(--mt-space-2);
	padding-top: var(--mt-space-3);
}

.mt-product-card__title {
	display: -webkit-box;
	min-height: calc(2 * var(--mt-lh-snug) * 1em);
	margin: 0;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	color: var(--mt-text-heading);
	font-family: var(--mt-font-body);
	font-size: var(--mt-fs-sm);
	font-weight: var(--mt-fw-semibold);
	line-height: var(--mt-lh-snug);
	letter-spacing: 0;
	overflow-wrap: anywhere;
}

@media (min-width: 768px) {
	.mt-product-card__title {
		font-size: var(--mt-fs-base);
	}
}

.mt-product-card__title a {
	color: inherit;
	text-decoration: none;
}

/* Whole card clickable through the title link; other controls sit above. */
.mt-product-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.mt-product-card__fav,
.mt-product-card__cart {
	z-index: 2;
}

.mt-product-card__rating {
	display: flex;
	align-items: center;
	gap: var(--mt-space-1);
	margin: 0;
	color: var(--mt-text-heading);
	font-size: var(--mt-fs-xs);
}

.mt-product-card__star {
	color: var(--mt-rating);
	fill: currentColor;
}

.mt-product-card__count {
	color: var(--mt-text-muted);
}

.mt-product-card__footer {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--mt-space-2);
	margin-top: auto;
}

.mt-product-card__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px var(--mt-space-2);
	color: var(--mt-text-price);
	font-size: var(--mt-fs-md);
	font-weight: var(--mt-fw-extrabold);
	line-height: 1.15;
}

@media (min-width: 768px) {
	.mt-product-card__price {
		font-size: var(--mt-fs-xl);
	}
}

.mt-product-card__price del {
	order: -1;
	color: var(--mt-text-muted);
	font-size: var(--mt-fs-sm);
	font-weight: var(--mt-fw-regular);
}

.mt-product-card__price ins {
	text-decoration: none;
}

.mt-product-card__cart {
	position: relative;
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: var(--mt-radius-sm);
	background: var(--mt-btn-primary-bg);
	color: var(--mt-btn-primary-text);
	text-decoration: none;
	transition: background-color var(--mt-dur-fast) var(--mt-ease-standard);
}

.mt-product-card__cart::before {
	content: "";
	position: absolute;
	inset: -4px;
}

.mt-product-card__cart:hover {
	background: var(--mt-btn-primary-bg-hover);
	color: var(--mt-btn-primary-text);
}

.mt-product-card__cart.loading .mt-icon {
	visibility: hidden;
}

.mt-product-card__cart.loading::after {
	content: "";
	position: absolute;
	width: 16px;
	height: 16px;
	border: 2px solid var(--mt-white);
	border-right-color: transparent;
	border-radius: 50%;
	animation: mt-spin 0.8s linear infinite;
}

.mt-product-card__cart.added::after {
	display: none;
}

/* WooCommerce appends a "Sepeti görüntüle" link after AJAX add; the toast covers it. */
.mt-product-card .added_to_cart,
.mt-product-card__footer a.added_to_cart {
	display: none !important;
}

/* Neutralise WooCommerce loop typography inside our card (padding would expose a 3rd title line). */
ul.mt-products .mt-product-card__title,
.mt-product-card .mt-product-card__title {
	padding: 0 !important;
	font-size: var(--mt-fs-sm);
}

@media (min-width: 768px) {
	ul.mt-products .mt-product-card__title,
	.mt-product-card .mt-product-card__title {
		font-size: var(--mt-fs-base);
	}
}

ul.mt-products .mt-product-card img {
	margin: 0 !important;
	box-shadow: none !important;
}

@media (hover: hover) and (pointer: fine) {
	.mt-product-card:hover {
		transform: translateY(-2px);
		border-color: var(--mt-border-default);
		box-shadow: var(--mt-shadow-md);
	}
	.mt-product-card:hover .mt-product-card__img {
		transform: scale(1.04);
	}
}

/* --------------------------------------------------------------------------
   Category card (C§11)
   ----------------------------------------------------------------------- */

ul.mt-cat-grid,
.woocommerce ul.products:has(> .mt-cat-grid__item) {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--mt-space-3);
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce ul.products:has(> .mt-cat-grid__item)::before,
.woocommerce ul.products:has(> .mt-cat-grid__item)::after {
	display: none;
}

.woocommerce ul.products li.mt-cat-grid__item {
	float: none;
	width: auto;
	margin: 0;
}

@media (min-width: 768px) {
	ul.mt-cat-grid,
	.woocommerce ul.products:has(> .mt-cat-grid__item) {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	ul.mt-cat-grid,
	.woocommerce ul.products:has(> .mt-cat-grid__item) {
		grid-template-columns: repeat(9, minmax(0, 1fr));
	}
}

.mt-cat-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--mt-space-2);
	aspect-ratio: 1 / 1.05;
	padding: var(--mt-space-3) var(--mt-space-2);
	border-radius: var(--mt-radius-lg);
	background: var(--mt-bg-muted);
	color: var(--mt-text-heading);
	text-align: center;
	text-decoration: none;
	transition: background-color var(--mt-dur-base) var(--mt-ease-standard);
}

.mt-cat-card__media {
	display: grid;
	place-items: center;
	width: 72px;
	height: 72px;
	transition: transform var(--mt-dur-base) var(--mt-ease-standard);
}

.mt-cat-card .mt-cat-card__media img {
	width: 72px;
	height: 72px;
	object-fit: contain;
}

.mt-cat-card__fallback {
	color: var(--mt-color-primary);
}

.mt-cat-card__name {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	font-size: var(--mt-fs-xs);
	font-weight: var(--mt-fw-semibold);
	line-height: var(--mt-lh-snug);
}

@media (min-width: 1024px) {
	.mt-cat-card__name {
		font-size: var(--mt-fs-sm);
	}
}

.mt-cat-card:hover {
	background: var(--mt-green-50);
	color: var(--mt-text-heading);
}

@media (hover: hover) and (pointer: fine) {
	.mt-cat-card:hover .mt-cat-card__media {
		transform: translateY(-3px);
	}
}

/* --------------------------------------------------------------------------
   Promo / campaign card (C§12)
   ----------------------------------------------------------------------- */

.mt-promo {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 200px;
	overflow: hidden;
	border-radius: var(--mt-radius-xl);
	background: var(--mt-ink-950);
	color: var(--mt-text-on-dark);
	isolation: isolate;
}

.mt-promo--sm {
	min-height: 120px;
}

.mt-promo__img {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--mt-dur-slow) var(--mt-ease-out);
}

.mt-promo::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(90deg, rgba(14, 19, 25, 0.85) 0%, transparent 65%);
}

.mt-promo__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--mt-space-2);
	max-width: 70%;
	padding: var(--mt-space-6);
}

.mt-promo__title {
	margin: 0;
	color: var(--mt-text-on-dark);
	font-family: var(--mt-font-heading);
	font-size: var(--mt-fs-3xl);
	font-weight: var(--mt-fw-extrabold);
	line-height: var(--mt-lh-tight);
}

.mt-promo--sm .mt-promo__title {
	font-size: var(--mt-fs-xl);
}

.mt-promo__text {
	margin: 0;
	color: var(--mt-text-on-dark-muted);
	font-size: var(--mt-fs-base);
}

/* Stretched link: whole card clickable, one focus stop. */
.mt-promo__cta::after {
	content: "";
	position: absolute;
	inset: 0;
}

@media (hover: hover) and (pointer: fine) {
	.mt-promo:hover .mt-promo__img {
		transform: scale(1.03);
	}
	.mt-promo:hover .mt-promo__cta .mt-icon {
		transform: translateX(3px);
	}
}

.mt-promo__cta .mt-icon {
	transition: transform var(--mt-dur-fast) var(--mt-ease-standard);
}

.mt-promo--category {
	background: linear-gradient(90deg, var(--mt-gray-100), var(--mt-green-100));
	color: var(--mt-text-heading);
}

.mt-promo--category::before {
	display: none;
}

.mt-promo--category .mt-promo__title {
	color: var(--mt-text-heading);
}

/* --------------------------------------------------------------------------
   Empty state, spinner, skeleton
   ----------------------------------------------------------------------- */

.mt-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 520px;
	margin: var(--mt-space-8) auto;
	padding: var(--mt-space-10) var(--mt-space-6);
	border: 1px dashed var(--mt-border-default);
	border-radius: var(--mt-radius-xl);
	text-align: center;
}

.mt-empty__icon {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	margin-bottom: var(--mt-space-4);
	border-radius: 50%;
	background: var(--mt-color-primary-tint);
	color: var(--mt-color-primary);
}

.mt-empty__title {
	margin: 0 0 var(--mt-space-2);
	color: var(--mt-text-heading);
	font-family: var(--mt-font-heading);
	font-size: var(--mt-fs-xl);
	font-weight: var(--mt-fw-bold);
}

.mt-empty__text {
	margin: 0;
	color: var(--mt-text-secondary);
}

.mt-empty__actions {
	margin: var(--mt-space-6) 0 0;
}

.mt-empty--error .mt-empty__title {
	color: var(--mt-danger);
}

.mt-spinner {
	display: inline-flex;
	align-items: center;
	gap: var(--mt-space-2);
	color: var(--mt-text-secondary);
	font-size: var(--mt-fs-sm);
}

.mt-spinner__ring {
	width: 18px;
	height: 18px;
	border: 2px solid var(--mt-color-primary);
	border-right-color: transparent;
	border-radius: 50%;
	animation: mt-spin 0.8s linear infinite;
}

.mt-spinner__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
	.mt-spinner__ring {
		display: none;
	}
	.mt-spinner__label {
		position: static;
		width: auto;
		height: auto;
		clip: auto;
	}
}

.mt-skeleton {
	display: block;
	border-radius: var(--mt-radius-md);
	background: var(--mt-bg-muted);
}

.mt-skeleton--text {
	height: 0.9em;
	margin-bottom: var(--mt-space-2);
}

.mt-skeleton--card {
	aspect-ratio: 3 / 4;
	border-radius: var(--mt-radius-lg);
}

.is-busy {
	opacity: 0.5;
	transition: opacity var(--mt-dur-fast) var(--mt-ease-standard);
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   Toast (C§16) — top right on desktop, above the bottom nav on mobile
   ----------------------------------------------------------------------- */

.mt-toasts {
	position: fixed;
	right: var(--mt-space-3);
	bottom: calc(var(--mt-bottom-nav-total) + var(--mt-space-3));
	left: var(--mt-space-3);
	z-index: var(--mt-z-toast);
	display: flex;
	flex-direction: column-reverse;
	gap: var(--mt-space-2);
	pointer-events: none;
}

@media (min-width: 768px) {
	.mt-toasts {
		top: var(--mt-space-4);
		right: var(--mt-space-4);
		bottom: auto;
		left: auto;
		flex-direction: column;
		width: 360px;
	}
}

.mt-toast {
	display: flex;
	align-items: center;
	gap: var(--mt-space-3);
	padding: var(--mt-space-3) var(--mt-space-4);
	border: 1px solid var(--mt-border-subtle);
	border-radius: var(--mt-radius-lg);
	background: var(--mt-bg-surface);
	box-shadow: var(--mt-shadow-lg);
	color: var(--mt-text-body);
	font-size: var(--mt-fs-base);
	pointer-events: auto;
	animation: mt-toast-in var(--mt-dur-base) var(--mt-ease-out);
}

.mt-toast.is-leaving {
	opacity: 0;
	transition: opacity var(--mt-dur-fast) var(--mt-ease-in);
}

.mt-toast__icon {
	color: var(--mt-color-primary);
}

.mt-toast--error .mt-toast__icon {
	color: var(--mt-danger);
}

.mt-toast__body {
	flex: 1;
	min-width: 0;
}

.mt-toast__title {
	margin: 0;
	color: var(--mt-text-heading);
	font-weight: var(--mt-fw-semibold);
}

.mt-toast__link {
	font-size: var(--mt-fs-sm);
	font-weight: var(--mt-fw-semibold);
}

@keyframes mt-toast-in {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
}

@media (min-width: 768px) {
	@keyframes mt-toast-in {
		from {
			opacity: 0;
			transform: translateX(16px);
		}
	}
}

/* --------------------------------------------------------------------------
   WooCommerce generic buttons → MEGATECH primary (full page styling in later phases)
   ----------------------------------------------------------------------- */

body .woocommerce a.button,
body .woocommerce button.button,
body .woocommerce input.button,
body .woocommerce a.button.alt,
body .woocommerce button.button.alt,
body .woocommerce-page a.button,
body .woocommerce-page button.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--mt-btn-h-md);
	padding: 0 var(--mt-btn-px-md);
	border: 0;
	border-radius: var(--mt-radius-md);
	background: var(--mt-btn-primary-bg);
	color: var(--mt-btn-primary-text);
	font-family: var(--mt-font-body);
	font-size: var(--mt-fs-md);
	font-weight: var(--mt-fw-semibold);
	line-height: 1.1;
	text-decoration: none;
	transition: background-color var(--mt-dur-fast) var(--mt-ease-standard);
}

body .woocommerce a.button:hover,
body .woocommerce button.button:hover,
body .woocommerce input.button:hover,
body .woocommerce a.button.alt:hover,
body .woocommerce button.button.alt:hover,
body .woocommerce-page a.button:hover,
body .woocommerce-page button.button:hover {
	background: var(--mt-btn-primary-bg-hover);
	color: var(--mt-btn-primary-text);
}

.mt-landing {
	padding-block: var(--mt-section-gap);
}

/* --------------------------------------------------------------------------
   Elementor (Free) Button widget default = MEGATECH primary.
   Elementor 4 no longer derives the default button colour from the Accent
   global. Kept here (not in Kit Theme Style, which targets every <button> on
   the page). Per-widget colours set in Elementor still win (higher specificity).
   ----------------------------------------------------------------------- */

.elementor-widget-button .elementor-button {
	border-radius: var(--mt-radius-md);
	background-color: var(--mt-btn-primary-bg);
	color: var(--mt-btn-primary-text);
	font-family: var(--mt-font-body);
	font-weight: var(--mt-fw-semibold);
	transition: background-color var(--mt-dur-fast) var(--mt-ease-standard);
}

.elementor-widget-button .elementor-button:hover,
.elementor-widget-button .elementor-button:focus-visible {
	background-color: var(--mt-btn-primary-bg-hover);
	color: var(--mt-btn-primary-text);
}

/* Internal component library page (private, editors only) */
.mt-library__section {
	margin-bottom: var(--mt-section-gap);
}

.mt-library__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--mt-space-3);
	margin-bottom: var(--mt-space-4);
}

.mt-library__dark {
	display: inline-flex;
	padding: var(--mt-space-3);
	border-radius: var(--mt-radius-md);
	background: var(--mt-ink-950);
}

.mt-library__form {
	max-width: 480px;
}

.mt-library__label {
	color: var(--mt-text-secondary);
	font-size: var(--mt-fs-sm);
}

.mt-library__promos {
	display: grid;
	gap: var(--mt-space-4);
}

@media (min-width: 768px) {
	.mt-library__promos {
		grid-template-columns: 1.25fr 1fr;
	}
}
