/**
 * TES Bags — side cart drawer (Figma node 62:1071)
 */

/* Off-canvas panel width */

@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@200..800&display=swap');

.mfp-content.off-canvas-cart.tesbags-off-canvas-cart,
.mfp-content.off-canvas-cart .tesbags-cart-drawer {
	max-width: 574px;
	width: min(574px, 100vw);
}

.tesbags-cart-drawer,
.tesbags-cart-drawer__inner {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
	background: #fff;
	font-family: Assistant, "Assistant", Heebo, sans-serif;
	color: #0a0a0a;
	direction: rtl;
	text-align: right;
}

.tesbags-cart-drawer__inner {
	box-shadow: 0 10px 7.5px rgba(0, 0, 0, 0.1);
}

/* Header */
.tesbags-cart-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 24px 24px 21px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	flex-shrink: 0;
}

.tesbags-cart-drawer__close {
	position: static !important;
	width: 32px;
	height: 32px;
	padding: 6px;
	margin: 0;
	border: 0;
	background: transparent;
	color: #0a0a0a;
	cursor: pointer;
	opacity: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	z-index: 2;
}

/* Custom close in header — hide Magnific Popup default button */
.mfp-wrap:has(.tesbags-cart-drawer) .mfp-close {
	display: none !important;
}

.tesbags-cart-drawer__title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 32px;
	letter-spacing: -0.6px;
	font-family: Assistant, "Assistant", Heebo, sans-serif;
}

/* Scrollable body */
.tesbags-cart-drawer__scroll {
	flex: 1 1 auto;
	overflow-y: auto;
	min-height: 0;
}

.tesbags-cart-drawer__shipping--hidden {
	display: none;
}

.tesbags-cart-drawer__shipping-inner {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	padding: 16px 24px;
}

.tesbags-cart-drawer__shipping-text {
	font-size: 13px;
	line-height: 19.5px;
	color: rgba(10, 10, 10, 0.8);
}

.tesbags-cart-drawer__shipping-icon {
	display: flex;
	color: rgba(10, 10, 10, 0.8);
}

.tesbags-cart-drawer__items {
	padding: 0;
}

.tesbags-cart-drawer__items + .tesbags-cart-drawer__upsell,
.tesbags-cart-drawer__shipping + .tesbags-cart-drawer__items {
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Mini cart items */
.tesbags-mini-cart {
	list-style: none;
	margin: 0;
	padding: 24px;
}

.tesbags-mini-cart__item {
	display: grid;
	/* RTL: col 1 = right (thumb), col 3 = left (remove) */
	grid-template-columns: 112px minmax(0, 1fr) 28px;
	gap: 12px;
	align-items: start;
	position: relative;
	padding-bottom: 24px;
	margin-bottom: 24px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	direction: rtl;
}

.tesbags-mini-cart__item:last-child {
	border-bottom: 0;
	margin-bottom: 0;
	padding-bottom: 0;
}

.mini_cart_item a.tesbags-mini-cart__remove {
	grid-column: 3;
	grid-row: 1;
	align-self: start;
	justify-self: start;
	width: 16px;
	height: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	line-height: 1;
	color: #0a0a0a;
	text-decoration: none;
	opacity: 1;
	border:none;
}

.tesbags-mini-cart__body {
	grid-column: 2;
	grid-row: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: flex-end;
	min-height: 112px;
	text-align: right;
}

.tesbags-mini-cart__thumb {
	grid-column: 1;
	grid-row: 1;
	width: 112px;
	height: 112px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	overflow: hidden;
}

.tesbags-mini-cart__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tesbags-mini-cart__row--title {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
}

.tesbags-mini-cart__row--title .tesbags-mini-cart__name {
	flex: 1 1 auto;
	min-width: 0;
	text-align: right;
}

.tesbags-mini-cart__row--title .tesbags-mini-cart__price {
	flex: 0 0 auto;
	text-align: left;
}

.tesbags-mini-cart__name {
	font-size: 15px;
	font-weight: 600;
	line-height: 20.625px;
	color: #0a0a0a;
	text-decoration: none;
}

.tesbags-mini-cart__price {
	font-size: 15px;
	font-weight: 700;
	line-height: 22.5px;
	white-space: nowrap;
}

.tesbags-mini-cart__row--qty {
	margin-top: auto;
}

.tesbags-qty {
	display: inline-flex;
	align-items: center;
	position: relative;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 6px;
	height: 28px;
	overflow: hidden;
}

.tesbags-qty.is-loading {
	pointer-events: none;
}

.tesbags-qty.is-loading::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.72);
}

.tesbags-qty.is-loading::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 14px;
	margin: -7px 0 0 -7px;
	border: 2px solid rgba(10, 10, 10, 0.15);
	border-top-color: #0a0a0a;
	border-radius: 50%;
	animation: tesbags-spin 0.65s linear infinite;
	z-index: 1;
}

.tesbags-mini-cart__item.is-loading {
	opacity: 0.72;
}

.tesbags-qty__btn {
	width: 26px;
	height: 26px;
	border: 0;
	background: #fff;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	color: #0a0a0a;
	padding: 0;
    margin: 0;
    min-height: auto;
}

.tesbags-qty__value {
	min-width: 24px;
	text-align: center;
	font-size: 14px;
	line-height: 21px;
}

.tesbags-mini-cart__empty {
	padding: 24px;
	text-align: center;
	margin: 0;
}

/* Upsell */
.tesbags-cart-drawer__upsell {
	padding: 24px 24px 40px;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.tesbags-cart-drawer__upsell:empty {
	display: none;
}

.tesbags-upsell__title {
	margin: 0 0 16px;
	font-size: 16px;
	font-weight: 700;
	line-height: 22px;
	letter-spacing: -0.375px;
}

.tesbags-cart-drawer__upsell {
	position: relative;
}

.tesbags-cart-drawer__upsell.is-loading {
	min-height: 180px;
}

.tesbags-cart-drawer__upsell.is-loading::before {
	content: '';
	position: absolute;
	inset: 56px 24px 40px;
	background: rgba(255, 255, 255, 0.72);
	z-index: 2;
	pointer-events: none;
}

.tesbags-cart-drawer__upsell.is-loading::after {
	content: '';
	position: absolute;
	top: calc(56px + 72px);
	left: 50%;
	width: 24px;
	height: 24px;
	margin-left: -12px;
	border: 2px solid rgba(10, 10, 10, 0.15);
	border-top-color: #0a0a0a;
	border-radius: 50%;
	animation: tesbags-spin 0.7s linear infinite;
	z-index: 3;
	pointer-events: none;
}

.tesbags-upsell__slider {
	margin: 0 -8px;
	position: relative;
}

.tesbags-upsell__slider.is-loading {
	min-height: 140px;
}

.tesbags-upsell__slider .flickity-viewport {
	overflow: hidden;
}

.tesbags-upsell__slider::after {
	content: '';
	display: block;
	clear: both;
}

.tesbags-upsell .flickity-slider > .tesbags-upsell__cell {
	width: 33.333% !important;
	padding: 0 8px;
	box-sizing: border-box;
}

.tesbags-upsell__slider[data-upsell-count='1'] .tesbags-upsell__cell {
	width: 100%;
}

.tesbags-upsell__slider[data-upsell-count='2'] .tesbags-upsell__cell {
	width: 50%;
}

.tesbags-upsell__card {
	display: block;
	text-decoration: none;
	color: inherit;
}

.tesbags-upsell__image {
	border: 1px solid rgba(0, 0, 0, 0.06);
	aspect-ratio: 1;
	overflow: hidden;
	margin-bottom: 8px;
}

.tesbags-upsell__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tesbags-upsell__meta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	font-size: 13px;
	font-weight: 600;
	line-height: 18px;
}

.tesbags-upsell__name {
	color: #0a0a0a;
	text-align: right;
}

.tesbags-upsell__price {
	color: #717182;
}

.tesbags-upsell__price .amount,
.tesbags-upsell__price bdi {
	color: #717182;
	font-weight: 600;
}

.tesbags-upsell__add {
	display: inline-block;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: #0a0a0a;
	text-align: right;
	font-family: Assistant, sans-serif;
	font-size: 14px;
	font-style: normal;
	font-weight: 600;
	line-height: 18px;
	text-decoration-line: underline;
	text-decoration-style: solid;
	text-underline-offset: auto;
	cursor: pointer;
}

.tesbags-upsell__add:hover,
.tesbags-upsell__add:focus {
	color: #0a0a0a;
	text-decoration-line: underline;
}

.tesbags-upsell__add.loading {
	opacity: 0.5;
	pointer-events: none;
}

.tesbags-upsell__card--ajax {
	cursor: pointer;
}

.tesbags-upsell .flickity-page-dots {
	bottom: -28px;
}

.tesbags-upsell .flickity-page-dots .dot {
	width: 8px;
	height: 8px;
	margin: 0 4px;
	border: 1px solid #0a0a0a;
	background: transparent;
	opacity: 1;
}

.tesbags-upsell .flickity-page-dots .dot.is-selected {
	background: #0a0a0a;
}

/* Footer */
.tesbags-cart-drawer__footer {
	flex-shrink: 0;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	background: #fff;
}

.tesbags-cart-footer {
	padding: 24px;
}

.tesbags-cart-footer__subtotal {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.tesbags-cart-footer__label {
	font-size: 15px;
	font-weight: 600;
	line-height: 22.5px;
}

.tesbags-cart-footer__subtotal-left {
	display: flex;
	align-items: center;
	gap: 24px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.tesbags-cart-footer__amount {
	font-size: 16px;
	font-weight: 700;
	line-height: 22px;
}

.tesbags-cart-footer__amount .amount,
.tesbags-cart-footer__amount bdi {
	color: #0a0a0a;
	font-weight: 700;
}

.tesbags-cart-footer__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 2px 8px 4px;
	background: rgba(204, 251, 239, 0.5);
	color: #125d56;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
}

.tesbags-cart-footer__badge-icon {
	flex-shrink: 0;
}

.tesbags-cart-footer__checkout {
	display: block;
	width: 100%;
	height: 48px;
	line-height: 48px;
	padding: 0 16px;
	margin: 0 0 20px;
	border: 0;
	border-radius: 6px;
	background: #030213 !important;
	color: #fff !important;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
}

.tesbags-cart-footer__checkout:hover {
	opacity: 0.92;
	color: #fff !important;
}

.tesbags-cart-footer__trust {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 20px;
}

.tesbags-cart-footer__trust li {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 4px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	color: rgba(10, 10, 10, 0.6);
	
}

.tesbags-cart-footer__trust svg {
	opacity: 0.9;
}

/* Hide default mini-cart totals/buttons if any leak through */
.tesbags-cart-drawer .woocommerce-mini-cart__total,
.tesbags-cart-drawer .woocommerce-mini-cart__buttons {
	display: none !important;
}

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

@media (max-width: 549px) {
	.off-canvas-right .mfp-content{
		width: 100vw;
	}
	.mfp-content.off-canvas-cart.tesbags-off-canvas-cart,
	.mfp-content.off-canvas-cart .tesbags-cart-drawer {
		max-width: 100vw;
		width: 100vw;
	}

	.tesbags-upsell__cell {
		width: 45%;
	}
	.tesbags-cart-drawer__upsell{
		padding: 20px 20px 40px 20px;
	}
	.tesbags-cart-footer,
	.tesbags-mini-cart,
	.tesbags-cart-drawer__header{
		padding: 20px;
	}
	.tesbags-cart-drawer__shipping-inner{
		padding: 16px 20px;
	}
	.tesbags-mini-cart__body{
		align-items: flex-start !important;
	}
}
