/**
 * ManBaskets Dynamic WooCommerce Product Gallery
 * File: /assets/css/product-gallery.css
 */

/* =========================================================
   ROOT
========================================================= */

.mb-product-gallery {
	--mb-red: #df163b;
	--mb-red-dark: #b90f2d;
	--mb-black: #0b0d10;
	--mb-white: #ffffff;
	--mb-light: #f5f6f7;
	--mb-border: #dfe2e5;

	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;

	/*
	 * Must remain visible so the thumbnail navigation buttons
	 * are not clipped by the outer gallery container.
	 */
	overflow: visible;
}

.mb-product-gallery *,
.mb-product-gallery *::before,
.mb-product-gallery *::after {
	box-sizing: border-box;
}

.mb-product-gallery .swiper {
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	overflow: hidden;
}

.mb-product-gallery .swiper-wrapper {
	position: relative;
	z-index: 1;
	display: flex;
	width: 100%;
	height: auto;
	margin: 0;
	padding: 0;
	transition-property: transform;
}

.mb-product-gallery .swiper-slide {
	position: relative;
	display: block;
	flex-shrink: 0;
	width: 100%;
	height: auto;
	margin: 0;
	transition-property: transform;
}


/* =========================================================
   MAIN GALLERY
========================================================= */

.mb-gallery-main {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--mb-border);
	border-radius: 9px;
	background: var(--mb-light);
}

.mb-gallery-main .swiper-wrapper {
	align-items: stretch;
}

.mb-gallery-main .swiper-slide {
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: var(--mb-light);
}

.mb-gallery-image-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	color: inherit;
	text-decoration: none;
	cursor: zoom-in;
}

.mb-gallery-main-image {
	display: block;
	width: 100%;
	height: clamp(440px, 46vw, 620px);
	max-width: 100%;
	margin: 0;
	padding: 0;
	object-fit: cover;
	object-position: center;
	background: var(--mb-light);
	border: 0;
}


/* =========================================================
   BUTTON RESET
========================================================= */

.mb-gallery-main-prev,
.mb-gallery-main-next,
.mb-gallery-thumbs-prev,
.mb-gallery-thumbs-next {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;

	margin: 0 !important;
	padding: 0 !important;

	font: inherit !important;
	font-size: 0 !important;
	line-height: 1 !important;

	color: var(--mb-white) !important;
	border: 0 !important;
	outline: 0;
	background: var(--mb-black) !important;
	box-shadow: none !important;

	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	-webkit-tap-highlight-color: transparent;

	transition:
		color 0.2s ease,
		background-color 0.2s ease,
		border-color 0.2s ease,
		opacity 0.2s ease,
		transform 0.2s ease;
}

.mb-gallery-main-prev:focus-visible,
.mb-gallery-main-next:focus-visible,
.mb-gallery-thumbs-prev:focus-visible,
.mb-gallery-thumbs-next:focus-visible {
	outline: 2px solid var(--mb-red);
	outline-offset: 3px;
}


/* =========================================================
   CUSTOM ARROWS
========================================================= */

.mb-gallery-main-prev::before,
.mb-gallery-main-next::before,
.mb-gallery-thumbs-prev::before,
.mb-gallery-thumbs-next::before {
	content: "" !important;
	position: absolute;
	top: 50%;
	left: 50%;
	display: block !important;
	width: 10px;
	height: 10px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
}

.mb-gallery-main-prev::after,
.mb-gallery-main-next::after,
.mb-gallery-thumbs-prev::after,
.mb-gallery-thumbs-next::after {
	display: none !important;
	content: none !important;
}

.mb-gallery-main-prev::before,
.mb-gallery-thumbs-prev::before {
	transform: translate(-35%, -50%) rotate(-135deg);
}

.mb-gallery-main-next::before,
.mb-gallery-thumbs-next::before {
	transform: translate(-65%, -50%) rotate(45deg);
}


/* =========================================================
   MAIN IMAGE NAVIGATION
========================================================= */

.mb-gallery-main-prev,
.mb-gallery-main-next {
	position: absolute !important;
	top: 50%;
	z-index: 10;

	width: 44px !important;
	min-width: 44px !important;
	max-width: 44px !important;

	height: 44px !important;
	min-height: 44px !important;
	max-height: 44px !important;

	color: var(--mb-white) !important;
	border: 1px solid rgba(255, 255, 255, 0.35) !important;
	border-radius: 5px !important;
	background: rgba(11, 13, 16, 0.82) !important;

	transform: translateY(-50%);
}

.mb-gallery-main-prev {
	left: 14px;
}

.mb-gallery-main-next {
	right: 14px;
}

.mb-gallery-main-prev:hover,
.mb-gallery-main-next:hover {
	color: var(--mb-white) !important;
	border-color: var(--mb-red) !important;
	background: var(--mb-red) !important;
}

.mb-gallery-main-prev:active,
.mb-gallery-main-next:active {
	transform: translateY(-50%) scale(0.94);
}


/* =========================================================
   THUMBNAIL ROW
========================================================= */

.mb-gallery-thumbs-row {
	position: relative;
	display: grid;
	grid-template-columns: 42px calc(100% - 104px) 42px;
	align-items: stretch;
	column-gap: 10px;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin-top: 12px;
	padding: 0;
	overflow: hidden;
}

.mb-gallery-thumbs {
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	overflow: hidden !important;
}

.mb-gallery-thumbs .swiper-wrapper {
	align-items: stretch;
}

.mb-gallery-thumbs .swiper-slide {
	position: relative;
	overflow: hidden;
	width: auto;
	min-width: 0;

	border: 1px solid var(--mb-border);
	border-radius: 6px;
	background: var(--mb-light);

	cursor: pointer;
	opacity: 0.7;

	transition:
		opacity 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		transform 0.2s ease;
}

.mb-gallery-thumbs .swiper-slide:hover {
	border-color: #aeb3b8;
	opacity: 1;
	transform: translateY(-1px);
}

.mb-gallery-thumbs .swiper-slide:focus-visible {
	outline: 2px solid var(--mb-red);
	outline-offset: 2px;
}

.mb-gallery-thumbs .swiper-slide-thumb-active {
	border: 2px solid var(--mb-red);
	box-shadow: 0 0 0 1px rgba(223, 22, 59, 0.08);
	opacity: 1;
}

.mb-gallery-thumb-image {
	display: block;
	width: 100%;
	height: 90px;
	max-width: 100%;

	margin: 0;
	padding: 0;

	object-fit: cover;
	object-position: center;

	background: var(--mb-light);
	border: 0;

	pointer-events: none;
	user-select: none;
}


/* =========================================================
   THUMBNAIL NAVIGATION
========================================================= */

.mb-gallery-thumbs-prev,
.mb-gallery-thumbs-next {
	position: relative !important;
	inset: auto !important;

	align-self: stretch;

	width: 42px !important;
	min-width: 42px !important;
	max-width: 42px !important;

	height: 100% !important;
	min-height: 100% !important;
	max-height: 100% !important;

	color: var(--mb-white) !important;
	border: 0 !important;
	border-radius: 5px !important;
	background: var(--mb-red) !important;

	transform: none;
	overflow: hidden;
}

.mb-gallery-thumbs-prev:hover,
.mb-gallery-thumbs-next:hover {
	color: var(--mb-white) !important;
	background: var(--mb-black) !important;
}

.mb-gallery-thumbs-prev:active,
.mb-gallery-thumbs-next:active {
	transform: scale(0.94);
}
.mb-gallery-thumbs-prev {
	grid-column: 1;
}

.mb-gallery-thumbs {
	grid-column: 2;
}

.mb-gallery-thumbs-next {
	grid-column: 3;
}

/* =========================================================
   DISABLED BUTTONS
========================================================= */

.mb-product-gallery .swiper-button-disabled,
.mb-product-gallery button:disabled {
	color: #777 !important;
	border-color: #d6d6d6 !important;
	background: #eeeeee !important;
	cursor: default;
	opacity: 0.75;
	pointer-events: none;
}

.mb-product-gallery .swiper-button-disabled:hover,
.mb-product-gallery button:disabled:hover {
	color: #777 !important;
	border-color: #d6d6d6 !important;
	background: #eeeeee !important;
	transform: none;
}


/* =========================================================
   IMAGE EFFECTS
========================================================= */

.mb-gallery-main-image,
.mb-gallery-thumb-image {
	transition:
		opacity 0.25s ease,
		transform 0.25s ease;
}

.mb-gallery-image-link:hover .mb-gallery-main-image {
	transform: scale(1.005);
}


/* =========================================================
   ELEMENTOR / WOOCOMMERCE CONFLICT PROTECTION
========================================================= */

.mb-product-gallery button {
	text-transform: none !important;
	letter-spacing: normal !important;
}

.mb-product-gallery button span {
	display: none !important;
}

.mb-product-gallery img {
	box-shadow: none !important;
}

.mb-product-gallery figure {
	margin: 0 !important;
}

.mb-product-gallery .woocommerce-product-gallery__trigger {
	display: none !important;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1024px) {
	.mb-gallery-main-image {
		height: clamp(400px, 58vw, 560px);
	}

	.mb-gallery-main-prev,
	.mb-gallery-main-next {
		width: 42px !important;
		min-width: 42px !important;
		max-width: 42px !important;

		height: 42px !important;
		min-height: 42px !important;
		max-height: 42px !important;
	}

	.mb-gallery-main-prev {
		left: 10px;
	}

	.mb-gallery-main-next {
		right: 10px;
	}

	.mb-gallery-thumbs-row {
		grid-template-columns: 38px minmax(0, 1fr) 38px;
		gap: 9px;
	}

	.mb-gallery-thumbs-prev,
	.mb-gallery-thumbs-next {
		width: 38px !important;
		min-width: 38px !important;
		max-width: 38px !important;

		height: 82px !important;
		min-height: 82px !important;
		max-height: 82px !important;
	}

	.mb-gallery-thumb-image {
		height: 82px;
	}
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {
	.mb-gallery-main {
		border-radius: 7px;
	}

	.mb-gallery-main-image {
		height: min(78vw, 420px);
		min-height: 280px;
		object-fit: cover;
	}

	.mb-gallery-main-prev,
	.mb-gallery-main-next {
		width: 36px !important;
		min-width: 36px !important;
		max-width: 36px !important;

		height: 36px !important;
		min-height: 36px !important;
		max-height: 36px !important;

		border-radius: 4px !important;
	}

	.mb-gallery-main-prev {
		left: 8px;
	}

	.mb-gallery-main-next {
		right: 8px;
	}

	.mb-gallery-main-prev::before,
	.mb-gallery-main-next::before,
	.mb-gallery-thumbs-prev::before,
	.mb-gallery-thumbs-next::before {
		width: 8px;
		height: 8px;
	}

	.mb-gallery-thumbs-row {
		grid-template-columns: 34px calc(100% - 82px) 34px;
		gap: 7px;
		margin-top: 8px;
		padding: 0 1px;
	}

	.mb-gallery-thumbs-prev,
	.mb-gallery-thumbs-next {
		width: 34px !important;
		min-width: 34px !important;
		max-width: 34px !important;

		height: 66px !important;
		min-height: 66px !important;
		max-height: 66px !important;

		border-radius: 4px !important;
	}

	.mb-gallery-thumb-image {
		height: 66px;
	}

	.mb-gallery-thumbs .swiper-slide {
		border-radius: 4px;
	}

	.mb-gallery-image-link:hover .mb-gallery-main-image {
		transform: none;
	}
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {
	.mb-gallery-main-image {
		height: 76vw;
		min-height: 245px;
	}

	.mb-gallery-main-prev,
	.mb-gallery-main-next {
		width: 34px !important;
		min-width: 34px !important;
		max-width: 34px !important;

		height: 34px !important;
		min-height: 34px !important;
		max-height: 34px !important;
	}

	.mb-gallery-thumbs-row {
		grid-template-columns: 32px minmax(0, 1fr) 32px;
		gap: 6px;
	}

	.mb-gallery-thumbs-prev,
	.mb-gallery-thumbs-next {
		width: 32px !important;
		min-width: 32px !important;
		max-width: 32px !important;

		height: 60px !important;
		min-height: 60px !important;
		max-height: 60px !important;
	}

	.mb-gallery-thumb-image {
		height: 60px;
	}
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
	.mb-product-gallery *,
	.mb-product-gallery *::before,
	.mb-product-gallery *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}