/* Product page delivery badge — Smart Pricing Engine */

.ma-delivery-badge-wrap {
	position: relative;
	display: flex;
	justify-content: flex-start;
	align-items: center;
	width: 100%;
	margin: 0 0 10px;
	padding: 0 0 10px;
	border-bottom: 1px solid #eceff3;
	direction: rtl;
}

.ma-delivery-badge-wrap[hidden] {
	display: none !important;
}

.ma-delivery-badge-wrap--simple {
	margin-top: 2px;
}

form.variations_form > .ma-delivery-badge-wrap--variable {
	margin-top: 0;
}

.ma-delivery-badge {
	position: relative;
	display: inline-flex;
	flex-direction: row;
	align-items: center;
	gap: 6px;
	width: fit-content;
	max-width: 100%;
	padding: 4px 8px 4px 6px;
	border-radius: 5px;
	color: #fff;
	font-size: 10.5px;
	font-weight: 700;
	line-height: 1.3;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
	overflow: hidden;
	isolation: isolate;
	animation: maDeliveryBadgeIn 0.35s ease, maDeliveryBadgeGlow 2.2s ease-in-out infinite;
}

@keyframes maDeliveryBadgeIn {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes maDeliveryBadgeGlow {
	0%,
	100% {
		box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
	}
	50% {
		box-shadow: 0 4px 18px rgba(15, 23, 42, 0.2);
	}
}

.ma-delivery-badge__glow {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		105deg,
		transparent 30%,
		rgba(255, 255, 255, 0.45) 48%,
		transparent 66%
	);
	background-size: 220% 100%;
	pointer-events: none;
	animation: maDeliveryShimmer 2.4s ease-in-out infinite;
}

@keyframes maDeliveryShimmer {
	0% {
		background-position: 120% 0;
	}
	100% {
		background-position: -120% 0;
	}
}

.ma-delivery-badge__text {
	position: relative;
	z-index: 1;
	white-space: nowrap;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

.ma-delivery-badge__icon {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 5px;
	background: rgba(255, 255, 255, 0.22);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
	flex-shrink: 0;
}

.ma-delivery-badge__icon svg {
	display: block;
	width: 15px;
	height: 15px;
}

.ma-delivery-badge--express {
	background: linear-gradient(135deg, #168a3f 0%, #2ecc71 60%, #27ae60 100%);
	animation: maDeliveryBadgeIn 0.35s ease, maExpressBadgePulse 1.6s ease-in-out infinite;
}

@keyframes maExpressBadgePulse {
	0%,
	100% {
		transform: scale(1);
		box-shadow: 0 4px 14px rgba(22, 138, 63, 0.25);
	}
	50% {
		transform: scale(1.03);
		box-shadow: 0 6px 22px rgba(46, 204, 113, 0.45);
	}
}

.ma-delivery-badge--express .ma-delivery-badge__icon {
	animation: maExpressIconPop 1.1s ease-in-out infinite;
}

.ma-delivery-badge--express .ma-express-body {
	animation: maExpressRide 1.1s ease-in-out infinite;
	transform-origin: center;
}

.ma-delivery-badge--express .ma-express-wheel {
	animation: maWheelSpin 0.55s linear infinite;
	transform-origin: center;
}

@keyframes maExpressIconPop {
	0%,
	100% {
		transform: scale(1) rotate(0deg);
	}
	25% {
		transform: scale(1.14) rotate(-6deg);
	}
	50% {
		transform: scale(1.08) rotate(0deg);
	}
	75% {
		transform: scale(1.14) rotate(6deg);
	}
}

@keyframes maExpressRide {
	0%,
	100% {
		transform: translateX(0) translateY(0);
	}
	35% {
		transform: translateX(-3px) translateY(-1px);
	}
	70% {
		transform: translateX(3px) translateY(0);
	}
}

@keyframes maWheelSpin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

.ma-delivery-badge--standard {
	background: linear-gradient(135deg, #c62828 0%, #ef5350 55%, #e53935 100%);
	animation: maDeliveryBadgeIn 0.35s ease, maStandardBadgePulse 2s ease-in-out infinite;
}

@keyframes maStandardBadgePulse {
	0%,
	100% {
		box-shadow: 0 4px 14px rgba(198, 40, 40, 0.22);
	}
	50% {
		box-shadow: 0 6px 20px rgba(239, 83, 80, 0.42);
	}
}

.ma-delivery-badge--standard .ma-delivery-badge__icon {
	animation: maTruckIconShake 1.4s ease-in-out infinite;
}

.ma-delivery-badge--standard .ma-truck-body {
	animation: maTruckDrive 1.2s ease-in-out infinite;
	transform-origin: center;
}

@keyframes maTruckIconShake {
	0%,
	100% {
		transform: translateX(0) scale(1);
	}
	20% {
		transform: translateX(-2px) scale(1.08);
	}
	40% {
		transform: translateX(2px) scale(1.12);
	}
	60% {
		transform: translateX(-2px) scale(1.08);
	}
	80% {
		transform: translateX(2px) scale(1.05);
	}
}

@keyframes maTruckDrive {
	0%,
	100% {
		transform: translateX(0);
	}
	50% {
		transform: translateX(4px);
	}
}

@media (max-width: 767px) {
	.ma-delivery-badge {
		font-size: 10px;
		padding: 3px 7px 3px 5px;
		gap: 5px;
	}

	.ma-delivery-badge__icon {
		width: 22px;
		height: 22px;
	}

	.ma-delivery-badge__icon svg {
		width: 14px;
		height: 14px;
	}
}

/* Archive / home — match Moboniaz theme .product-rate badge (style.css) */
.ma-delivery-badge-wrap--loop > i {
	color: #ffffff;
}

/* Standard delivery — muted variant (express uses theme red #EB5757) */
.ma-delivery-badge-wrap--loop.ma-delivery-badge-wrap--standard > span {
	color: #64748b;
}

.ma-delivery-badge-wrap--loop.ma-delivery-badge-wrap--standard > i {
	background: #64748b;
}

/*
 * Same line as rating / review — badge must not shrink; link truncates if tight.
 */
.product-item .product-rate:has(.ma-delivery-badge-wrap--loop) {
	flex-wrap: nowrap;
	justify-content: space-between;
	align-items: center;
	gap: 6px;
	overflow: hidden;
}

.product-item .product-rate:has(.ma-delivery-badge-wrap--loop) > a {
	flex: 0 1 auto;
	width: auto;
	min-width: 0;
	max-width: calc(100% - 110px);
	overflow: hidden;
	justify-content: flex-start;
}

.product-item .product-rate:has(.ma-delivery-badge-wrap--loop) > a span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex-shrink: 1;
	min-width: 0;
}

.product-item .product-rate:has(.ma-delivery-badge-wrap--loop) > a img {
	flex-shrink: 0;
}

.product-item .product-rate:has(.ma-delivery-badge-wrap--loop) .ma-delivery-badge-wrap--loop {
	flex: 0 0 auto;
	flex-shrink: 0;
	max-width: none;
	width: auto;
}

/* Compact badge on cards */
.product-item .product-rate .ma-delivery-badge-wrap--loop > span {
	font-size: 10px;
	padding-right: 4px;
	white-space: nowrap;
}

.product-item .product-rate .ma-delivery-badge-wrap--loop > i {
	font-size: 10px;
	padding: 2px 7px;
	border-top-right-radius: 4px;
	border-bottom-right-radius: 4px;
}

@media (max-width: 767px) {
	.product-item .product-rate:has(.ma-delivery-badge-wrap--loop) {
		gap: 4px;
		padding-left: 8px;
		padding-right: 8px;
	}

	.product-item .product-rate .ma-delivery-badge-wrap--loop > span {
		font-size: 9px;
	}

	.product-item .product-rate .ma-delivery-badge-wrap--loop > i {
		font-size: 9px;
		padding: 2px 6px;
	}
}

/* Equal-height product cards — archive grid + home swipers */
.product-archive-wrapper .container-fluid .product-archive-wrapper-content div.products,
.product-archive-wrapper .product-archive-wrapper-content .products,
.product-archive-wrapper .product-archive-wrapper-content ul.products {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
}

.product-archive-wrapper .container-fluid .product-archive-wrapper-content div.products .product-item,
.product-archive-wrapper .product-archive-wrapper-content .products .product-item,
.product-archive-wrapper .product-archive-wrapper-content ul.products .product-item {
	display: flex;
	flex-direction: column;
	align-self: stretch;
	height: auto;
}

.product-archive-wrapper .container-fluid .product-archive-wrapper-content div.products .product-item .product-image-wrapper,
.product-archive-wrapper .product-archive-wrapper-content .products .product-item .product-image-wrapper {
	flex-shrink: 0;
}

.product-archive-wrapper .container-fluid .product-archive-wrapper-content div.products .product-item .product-info-wrapper,
.product-archive-wrapper .product-archive-wrapper-content .products .product-item .product-info-wrapper,
.product-archive-wrapper .product-archive-wrapper-content ul.products .product-item .product-info-wrapper {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

.product-archive-wrapper .container-fluid .product-archive-wrapper-content div.products .product-item .product-info-wrapper .product-price,
.product-archive-wrapper .product-archive-wrapper-content .products .product-item .product-info-wrapper .product-price,
.product-archive-wrapper .product-archive-wrapper-content ul.products .product-item .product-info-wrapper .product-price {
	margin-top: auto;
	min-height: 44px;
}

.product-archive-wrapper .container-fluid .product-archive-wrapper-content div.products .product-item .product-info-wrapper .product-not-in-stock,
.product-archive-wrapper .product-archive-wrapper-content .products .product-item .product-info-wrapper .product-not-in-stock {
	margin-top: auto;
	min-height: 44px;
	margin-bottom: 14px;
}

/* Footer specs — always same block height (even when product has no attributes) */
.product-archive-wrapper .container-fluid .product-archive-wrapper-content div.products .product-item .product-cart-attr,
.product-archive-wrapper .product-archive-wrapper-content .products .product-item .product-cart-attr {
	flex-shrink: 0;
	margin-top: auto;
	min-height: 175px;
	background: #f1f1f1;
	border-bottom-left-radius: 5px;
	border-bottom-right-radius: 5px;
	box-sizing: border-box;
}

.product-archive-wrapper .container-fluid .product-archive-wrapper-content div.products .product-item .product-cart-attr > ul,
.product-archive-wrapper .product-archive-wrapper-content .products .product-item .product-cart-attr > ul {
	min-height: 175px;
}

.home-section-product-list .swiper-wrapper {
	align-items: stretch;
}

.home-section-product-list .swiper-slide {
	display: flex;
	height: auto;
}

.home-section-product-list .swiper-slide .product-item,
#main-content #home-offer .swiper-slide .product-item {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	width: 100%;
}

.home-section-product-list .swiper-slide .product-item .product-price,
#main-content #home-offer .swiper-slide .product-item .product-price {
	margin-top: auto;
}

/* Title: 2 lines visible, min-height for card alignment (no clipping) */
.product-item .product-title {
	min-height: 74px;
	height: auto;
	max-height: none;
	overflow: visible;
	box-sizing: border-box;
}

.product-item .product-title h3 {
	height: auto;
	margin: 0;
}

.product-item .product-title h3 a {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	line-height: 30px;
	max-height: 60px;
}

/* Rate row: same height with or without express badge */
.product-item .product-rate {
	min-height: 28px;
	box-sizing: border-box;
}

@media (max-width: 767px) {
	.product-item .product-title {
		min-height: 56px;
		max-height: none;
	}

	.product-item .product-title h3 a {
		line-height: 26px;
		max-height: 52px;
	}

	.product-item .product-rate {
		min-height: 22px;
	}

	.product-archive-wrapper .product-archive-wrapper-content .products .product-item .product-info-wrapper .product-title,
	.product-archive-wrapper .product-archive-wrapper-content ul.products .product-item .product-info-wrapper .product-title {
		min-height: 56px;
		max-height: none;
		height: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ma-delivery-badge,
	.ma-delivery-badge--express,
	.ma-delivery-badge--standard,
	.ma-delivery-badge__glow,
	.ma-delivery-badge__icon,
	.ma-express-body,
	.ma-express-wheel,
	.ma-truck-body,
	.ma-delivery-badge-wrap--loop > i {
		animation: none !important;
	}
}
