/**
 * Optional native product cards, lightweight gallery and quick-add dialog.
 */

body.mylegs-native-product-cards ul.products li.product .woo-entry-inner {
	position: relative;
	height: 100%;
	background: #fff;
}

/* Remove OceanWP's legacy card-hover halo; the native gallery supplies its own controls. */
body.mylegs-native-product-cards ul.products li.product .product-inner::before,
body.mylegs-native-product-cards ul.products li.product .product-inner:hover::before {
	display: none !important;
	content: none !important;
	box-shadow: none !important;
}

body.mylegs-native-product-cards ul.products li.product .image-wrap {
	position: relative;
	margin: 0 0 10px !important;
	padding: 0 !important;
	overflow: hidden;
	background: #f2f2f2;
}

.mylegs-card-media {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: #f2f2f2;
	touch-action: pan-y;
}

.mylegs-card-media__link {
	display: block;
	width: 100%;
	height: 100%;
}

body.mylegs-native-product-gallery .mylegs-card-media__image {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	object-position: center;
	transition: opacity .18s ease;
}

/*
 * Product-page recommendations keep the lightweight image gallery, while
 * purchase and wishlist actions remain exclusive to catalogue archives.
 */
body.mylegs-native-product-single-recommendations .up-sells.products .woo-entry-buttons,
body.mylegs-native-product-single-recommendations .up-sells.products .mylegs-card-quick-add,
body.mylegs-native-product-single-recommendations .up-sells.products .btn-wrap,
body.mylegs-native-product-single-recommendations .up-sells.products .add_to_cart_button,
body.mylegs-native-product-single-recommendations .related.products .woo-entry-buttons,
body.mylegs-native-product-single-recommendations .related.products .mylegs-card-quick-add,
body.mylegs-native-product-single-recommendations .related.products .btn-wrap,
body.mylegs-native-product-single-recommendations .related.products .add_to_cart_button {
	display: none !important;
}

/* Match the four-column desktop catalogue scale inside product suggestions. */
@media (min-width: 1024px) {
	body.mylegs-native-product-single-recommendations .up-sells.products ul.products > li.product,
	body.mylegs-native-product-single-recommendations .related.products ul.products > li.product {
		width: 25% !important;
	}
}

/* Cart cross-sells: retain the two-column space but use the native card visual. */
body.mylegs-native-cart-cross-sells .cart-collaterals .cross-sells {
	padding: 0 !important;
	border: 0 !important;
	background: #fff;
}

body.mylegs-native-cart-cross-sells .cart-collaterals .cross-sells > h2 {
	margin: 0 0 20px !important;
	padding: 0 0 12px !important;
	border: 0 !important;
	border-bottom: 1px solid #e7e7e7 !important;
	background: transparent !important;
	color: #111 !important;
	font-family: inherit !important;
	font-size: 20px !important;
	font-weight: 300 !important;
	line-height: 1.3 !important;
	text-align: left !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
}

body.mylegs-native-cart-cross-sells .cart-collaterals .cross-sells ul.products {
	margin-right: -8px !important;
	margin-left: -8px !important;
}

body.mylegs-native-cart-cross-sells .cart-collaterals .cross-sells ul.products > li.product {
	padding-right: 8px !important;
	padding-left: 8px !important;
}

body.mylegs-native-cart-cross-sells .cart-collaterals .cross-sells ul.products li.product .image-wrap {
	margin-bottom: 10px !important;
}

body.mylegs-native-cart-cross-sells .cart-collaterals .cross-sells .woo-product-info,
body.mylegs-native-cart-cross-sells .cart-collaterals .cross-sells .title,
body.mylegs-native-cart-cross-sells .cart-collaterals .cross-sells .title h2,
body.mylegs-native-cart-cross-sells .cart-collaterals .cross-sells .title a {
	text-align: left !important;
}

@media (max-width: 767px) {
	body.mylegs-native-cart-cross-sells .cart-collaterals .cross-sells {
		display: block !important;
		width: 100% !important;
		margin: 0 0 30px !important;
	}
}

.mylegs-card-media__image.is-changing {
	opacity: .35;
}

.mylegs-card-gallery-arrow,
.mylegs-card-quick-add {
	position: absolute;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid rgba(17, 17, 17, .12);
	border-radius: 50%;
	background: rgba(255, 255, 255, .96);
	box-shadow: none;
	color: #111;
	cursor: pointer;
	transition: background-color .18s ease, color .18s ease, opacity .18s ease, transform .18s ease;
}

.mylegs-card-gallery-arrow {
	top: 50%;
	border-color: transparent;
	background: transparent;
	opacity: 0;
	transform: translateY(-50%);
}

.mylegs-card-gallery-arrow span {
	position: relative;
	top: -1px;
	font-family: Arial, sans-serif;
	font-size: 31px;
	font-weight: 300;
	line-height: 1;
}

.mylegs-card-gallery-arrow--previous {
	left: 12px;
}

.mylegs-card-gallery-arrow--next {
	right: 12px;
}

.mylegs-card-media:hover .mylegs-card-gallery-arrow,
.mylegs-card-gallery-arrow:focus-visible {
	opacity: 1;
}

.mylegs-card-quick-add:hover,
.mylegs-card-quick-add:focus-visible {
	border-color: #111;
	background: #111;
	color: #fff;
}

.mylegs-card-gallery-arrow:hover,
.mylegs-card-gallery-arrow:focus-visible {
	border-color: rgba(17, 17, 17, .28);
	background: #fff;
	color: #111;
}

/* Translucent product actions, with a solid-white interactive state. */
.mylegs-card-quick-add {
	background-color: #ffffff78 !important;
}

.mylegs-card-quick-add:hover,
.mylegs-card-quick-add:focus-visible {
	background-color: #fff !important;
	color: #111;
}

/* The native mini-cart opens after add-to-cart, so WooCommerce's duplicate link is unnecessary. */
body.mylegs-native-product-cards ul.products li.product .added_to_cart.wc-forward {
	display: none !important;
}

.mylegs-card-gallery-arrow:focus-visible,
.mylegs-card-quick-add:focus-visible {
	outline: 2px solid #111;
	outline-offset: 3px;
}

.mylegs-card-gallery-dots {
	position: absolute;
	z-index: 3;
	right: 62px;
	bottom: 17px;
	left: 62px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	pointer-events: none;
}

.mylegs-card-gallery-dot {
	width: 5px;
	height: 5px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .58);
	box-shadow: 0 0 0 1px rgba(17, 17, 17, .1);
	pointer-events: auto;
	cursor: pointer;
}

.mylegs-card-gallery-dot.is-active {
	width: 7px;
	height: 7px;
	background: #fff;
}

.mylegs-card-quick-add {
	right: 14px;
	bottom: 14px;
}

.mylegs-card-quick-add svg {
	display: block;
	width: 20px;
	height: 20px;
	overflow: visible;
}

.mylegs-card-quick-add path {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.35;
	stroke-linecap: square;
	vector-effect: non-scaling-stroke;
}

body.mylegs-native-product-cards ul.products li.product .title,
body.mylegs-native-product-cards ul.products li.product .price-wrap,
body.mylegs-native-product-cards ul.products li.product .category,
body.mylegs-native-product-cards ul.products li.product .rating {
	padding-right: 8px;
	padding-left: 8px;
	text-align: left;
}

body.mylegs-native-product-cards ul.products li.product .category {
	display: block;
	margin: 10px 0 0 !important;
	padding: 0;
	color: #353535;
	font-family: inherit !important;
	font-size: 15px !important;
	font-style: normal !important;
	font-weight: 300 !important;
	line-height: 1 !important;
}

body.mylegs-native-product-cards ul.products li.product .category a {
	color: inherit;
	font: inherit;
	text-decoration: none;
}

body.mylegs-native-product-cards ul.products li.product .mylegs-card-meta-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	margin: 10px 0 0 !important;
	padding: 0 !important;
	text-align: left;
}

body.mylegs-native-product-cards ul.products li.product .mylegs-card-meta-row .category {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0 !important;
}

body.mylegs-native-product-cards ul.products li.product .woo-product-info {
	margin: 0;
	padding: 0 !important;
	text-align: left;
}

body.mylegs-native-product-cards ul.products li.product .title.mylegs-card-title-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	min-height: 0;
	margin: 0;
	padding: 0 !important;
}

body.mylegs-native-product-cards ul.products li.product .title.mylegs-card-title-row h2 {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0 !important;
}

body.mylegs-native-product-cards ul.products li.product .title h2,
body.mylegs-native-product-cards ul.products li.product .title a {
	color: #111;
	font-family: inherit !important;
	font-size: 18px !important;
	font-style: normal;
	font-weight: 300 !important;
	line-height: 1.32 !important;
	letter-spacing: 0;
	text-transform: none;
}

body.mylegs-native-product-cards ul.products li.product .mylegs-card-rating {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: baseline;
	gap: 4px;
	margin-left: auto;
	margin-right: 5%;
	color: inherit;
	font-family: inherit;
	font-size: 16px;
	font-style: normal;
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
}

/* Product-card gutter tuning; scoped to the catalogue to protect other OceanWP rows. */
body.mylegs-native-product-cards .mylegs-native-catalog-shell .oceanwp-row .col {
	margin: 0 0 3rem !important;
	padding: 0 .9rem !important;
}

body.mylegs-native-product-cards ul.products li.product .mylegs-card-rating__star {
	color: #d92b81;
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1;
}

body.mylegs-native-product-cards ul.products li.product .image-wrap > .woo-entry-buttons {
	position: absolute !important;
	z-index: 5;
	top: auto !important;
	right: 14px;
	bottom: 66px;
	display: block !important;
	width: 42px !important;
	height: 42px !important;
	margin: 0 !important;
	padding: 0 !important;
	opacity: 1 !important;
	transform: none !important;
}

body.mylegs-native-product-cards ul.products li.product .image-wrap .woo-wishlist-btn,
body.mylegs-native-product-cards ul.products li.product .image-wrap .tinv-wraper {
	position: static !important;
	display: block !important;
	width: 42px !important;
	height: 42px !important;
	margin: 0 !important;
	padding: 0 !important;
	opacity: 1 !important;
	transform: none !important;
}

body.mylegs-native-product-cards ul.products li.product .image-wrap .tinvwl_add_to_wishlist_button {
	display: block !important;
	width: 42px !important;
	height: 42px !important;
	min-width: 42px !important;
	min-height: 42px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 1px solid rgba(17, 17, 17, .12) !important;
	border-radius: 50% !important;
	background-color: #ffffff78 !important;
	box-shadow: none !important;
	color: #111 !important;
}

body.mylegs-native-product-cards ul.products li.product .image-wrap .tinvwl_add_to_wishlist_button:hover,
body.mylegs-native-product-cards ul.products li.product .image-wrap .tinvwl_add_to_wishlist_button:focus-visible {
	border-color: #111 !important;
	background-color: #fff !important;
	color: #111 !important;
}

body.mylegs-native-product-cards ul.products li.product .price-wrap {
	margin-top: 10px !important;
	padding-right: 0;
	padding-left: 0;
}

body.mylegs-native-product-cards ul.products li.product .price {
	font-size: 16px;
	font-weight: 600;
}

body.mylegs-native-product-cards ul.products li.product .mylegs-card-swatches {
	margin: 0;
	padding: 0;
}

body.mylegs-native-product-cards ul.products li.product .mylegs-card-swatches .mylegs-archive-swatches {
	justify-content: flex-start;
	gap: 6px;
	margin: 10px 0 0;
	padding: 0;
	text-align: left;
}

body.mylegs-native-quick-add ul.products li.product .btn-wrap {
	display: none;
}

body.mylegs-quick-add-open {
	overflow: hidden;
}

.mylegs-quick-add[hidden] {
	display: none !important;
}

.mylegs-quick-add {
	position: fixed;
	z-index: 1000000;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.mylegs-quick-add__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(238, 238, 238, .76);
	backdrop-filter: blur(5px);
}

.mylegs-quick-add__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(448px, 100%);
	max-height: min(680px, calc(100vh - 48px));
	overflow: hidden;
	background: #fff;
	box-shadow: 0 14px 48px rgba(0, 0, 0, .14);
	color: #111;
}

.mylegs-quick-add__header {
	position: relative;
	flex: 0 0 auto;
	min-height: 76px;
	padding: 28px 64px 20px;
	border-bottom: 1px solid #ececec;
	text-align: center;
}

.mylegs-quick-add__header h2 {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
}

.mylegs-quick-add__close {
	position: absolute;
	top: 22px;
	right: 22px;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #111;
	cursor: pointer;
}

.mylegs-quick-add__close span,
.mylegs-quick-add__close span::after {
	position: absolute;
	top: 16px;
	left: 9px;
	width: 16px;
	height: 1px;
	background: currentColor;
	content: '';
	transform: rotate(45deg);
}

.mylegs-quick-add__close span::after {
	top: 0;
	left: 0;
	transform: rotate(90deg);
}

.mylegs-quick-add__close:focus-visible {
	outline: 2px solid #111;
	outline-offset: 2px;
}

.mylegs-quick-add__content {
	flex: 1 1 auto;
	padding: 22px 24px 8px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.mylegs-quick-add__loading,
.mylegs-quick-add__error {
	margin: 22px 0;
	text-align: center;
}

.mylegs-quick-add__summary {
	display: grid;
	grid-template-columns: 68px minmax(0, 1fr);
	gap: 14px;
	align-items: center;
	margin-bottom: 22px;
}

.mylegs-quick-add__product-image {
	width: 68px;
	height: 88px;
	object-fit: cover;
	background: #f3f3f3;
}

.mylegs-quick-add__product-name {
	margin: 0 0 5px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.35;
}

.mylegs-quick-add__price {
	font-size: 15px;
	font-weight: 600;
}

.mylegs-quick-add__attribute {
	margin: 0 0 22px;
	padding: 0;
	border: 0;
}

.mylegs-quick-add__attribute legend,
.mylegs-quick-add__quantity-title {
	display: block;
	width: 100%;
	margin: 0 0 12px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

.mylegs-quick-add__options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
}

.mylegs-quick-add__attribute--color .mylegs-quick-add__options {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mylegs-quick-add__option {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 0;
	background: #fff !important;
	color: #111 !important;
	font: inherit;
	cursor: pointer;
}

.mylegs-quick-add__option:hover,
.mylegs-quick-add__option:focus-visible {
	border-color: #111;
	background: #fff !important;
}

.mylegs-quick-add__option[aria-pressed="true"] {
	border-color: #111;
	background: #f3f3f3 !important;
}

.mylegs-quick-add__option[aria-pressed="true"] {
	box-shadow: inset 0 0 0 1px #111;
}

.mylegs-quick-add__option:disabled {
	border-color: #eee;
	color: #aaa;
	text-decoration: line-through;
	cursor: not-allowed;
	opacity: .62;
}

.mylegs-quick-add__swatch {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	border: 1px solid rgba(17, 17, 17, .28);
	border-radius: 50%;
	background: var(--mylegs-swatch-primary, #eee);
}

.mylegs-quick-add__swatch.is-dual {
	background: linear-gradient(135deg, var(--mylegs-swatch-primary, #eee) 0 50%, var(--mylegs-swatch-secondary, #fff) 50% 100%);
}

.mylegs-quick-add__quantity {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin: 6px 0 14px;
}

.mylegs-quick-add__quantity button {
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid #111;
	border-radius: 50%;
	background: #fff;
	color: #111;
	font-size: 22px;
	font-weight: 300;
	line-height: 32px;
	cursor: pointer;
}

.mylegs-quick-add__quantity button:disabled {
	border-color: #e7e7e7;
	color: #ccc;
	cursor: not-allowed;
}

.mylegs-quick-add__quantity-value {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #f7f7f7;
	font-size: 18px;
}

.mylegs-quick-add__footer {
	flex: 0 0 auto;
	padding: 8px 24px 24px;
	background: #fff;
}

.mylegs-quick-add__status {
	min-height: 20px;
	margin: 0 0 8px;
	font-size: 13px;
	text-align: center;
}

.mylegs-quick-add__status.is-error {
	color: #b42318;
}

.mylegs-quick-add__status.is-success {
	color: #18733a;
}

.mylegs-quick-add__confirm {
	width: 100%;
	min-height: 44px;
	padding: 11px 18px;
	border: 1px solid #111;
	border-radius: 0;
	background: #111;
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	text-transform: uppercase;
	cursor: pointer;
}

.mylegs-quick-add__confirm:disabled {
	border-color: #ddd;
	background: #ddd;
	color: #999;
	cursor: not-allowed;
}

@media (max-width: 767px) {
	.mylegs-card-gallery-arrow {
		display: none;
	}

	.mylegs-card-gallery-dots {
		right: 52px;
		bottom: 13px;
		left: 12px;
		justify-content: flex-start;
	}

	.mylegs-card-quick-add {
		right: 10px;
		bottom: 10px;
		width: 38px;
		height: 38px;
	}

	body.mylegs-native-product-cards ul.products li.product .image-wrap > .woo-entry-buttons {
		top: auto !important;
		right: 10px;
		bottom: 58px;
		width: 38px !important;
		height: 38px !important;
	}

	body.mylegs-native-product-cards ul.products li.product .image-wrap .woo-wishlist-btn,
	body.mylegs-native-product-cards ul.products li.product .image-wrap .tinv-wraper,
	body.mylegs-native-product-cards ul.products li.product .image-wrap .tinvwl_add_to_wishlist_button {
		width: 38px !important;
		height: 38px !important;
		min-width: 38px !important;
		min-height: 38px !important;
	}

	body.mylegs-native-product-cards ul.products li.product .price {
		font-size: 14px;
	}

	.mylegs-quick-add {
		align-items: flex-end;
		padding: 0;
	}

	.mylegs-quick-add__dialog {
		width: 100%;
		max-height: min(760px, calc(100dvh - 24px));
		border-radius: 0;
	}

	.mylegs-quick-add__header {
		min-height: 68px;
		padding: 23px 54px 17px;
	}

	.mylegs-quick-add__content {
		padding: 18px 18px 8px;
	}

	.mylegs-quick-add__footer {
		padding: 8px 18px calc(18px + env(safe-area-inset-bottom));
	}

	.mylegs-quick-add__attribute--color .mylegs-quick-add__options {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.mylegs-card-media__image,
	.mylegs-card-gallery-arrow,
	.mylegs-card-quick-add {
		transition: none;
	}
}
