.custom-gallery-grid {
	display: grid;
	gap: 12px;
	width: 100%;
	margin: 0 auto;
}

.gallery-layout-1 {
	grid-template-columns: 1fr;
}

.gallery-layout-1 .gallery-main {
	height: 620px;
}

.gallery-layout-2 {
	grid-template-columns: 2fr 1fr;
}

.gallery-layout-2 .gallery-main,
.gallery-layout-2 .gallery-side {
	height: 520px;
}

.gallery-layout-2 .gallery-side {
	display: grid;
	grid-template-rows: 1fr;
}

.gallery-layout-3 {
	grid-template-columns: 2fr 1fr;
}

.gallery-layout-3 .gallery-main {
	height: 520px;
}

.gallery-layout-3 .gallery-side {
	display: grid;
	grid-template-rows: 1fr 1fr;
	gap: 12px;
	height: 520px;
}

.gallery-main,
.gallery-side-top,
.gallery-side-bottom {
	position: relative;
	overflow: hidden;
	border-radius: 14px;
	background: #f5f5f5;
}

.custom-gallery-grid img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.custom-gallery-grid a {
	display: block;
	width: 100%;
	height: 100%;
}

.custom-gallery-grid a:hover img {
	transform: scale(1.04);
}

.gallery-count-overlay {
	position: absolute;
	bottom: 14px;
	right: 14px;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	border-radius: 999px;
	font-family: Montserrat, sans-serif;
	font-size: 15px;
	font-weight: 600;
	backdrop-filter: blur(6px);
	cursor: pointer;
	z-index: 5;
}

.gallery-icon {
	font-size: 14px;
	display: flex;
	align-items: center;
}

.custom-gallery--mobile {
	display: none;
}

.custom-gallery-mobile {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #eef2f7;
}

.custom-gallery-mobile__viewport {
	overflow: hidden;
	width: 100%;
	touch-action: pan-y pinch-zoom;
}

.custom-gallery-mobile__track {
	display: flex;
	width: 100%;
	will-change: transform;
	transition: transform 0.35s ease;
}

.custom-gallery-mobile__slide {
	flex: 0 0 100%;
	width: 100%;
	min-width: 100%;
}

.custom-gallery-mobile__slide a {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
}

.custom-gallery-mobile__slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.custom-gallery-mobile__nav {
	position: absolute;
	top: 50%;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: rgba(15, 23, 42, 0.38) !important;
	background-color: rgba(15, 23, 42, 0.38) !important;
	background-image: none !important;
	color: #fff !important;
	box-shadow: none !important;
	transform: translateY(-50%);
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.custom-gallery-mobile__nav svg {
	width: 20px;
	height: 20px;
	display: block;
	flex-shrink: 0;
}

.custom-gallery-mobile__nav--prev {
	left: 12px;
}

.custom-gallery-mobile__nav--next {
	right: 12px;
}

.custom-gallery-mobile__dots {
	position: absolute;
	left: 50%;
	bottom: 14px;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transform: translateX(-50%);
}

.custom-gallery-mobile__dot {
	width: 8px;
	height: 8px;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: rgba(255, 255, 255, 0.95) !important;
	background-color: rgba(255, 255, 255, 0.95) !important;
	background-image: none !important;
	box-shadow: none !important;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.custom-gallery-mobile__dot.is-active {
	background: #3b82f6 !important;
	background-color: #3b82f6 !important;
	transform: scale(1.1);
}

.custom-gallery-mobile__actions {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 5;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.custom-gallery-mobile__action {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-width: 40px;
	min-height: 40px;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: rgba(255, 255, 255, 0.96) !important;
	background-color: rgba(255, 255, 255, 0.96) !important;
	background-image: none !important;
	color: #6b7280 !important;
	box-shadow: 0 1px 6px rgba(15, 23, 42, 0.12) !important;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.custom-gallery-mobile__action svg {
	width: 18px;
	height: 18px;
	display: block;
	flex-shrink: 0;
}

.custom-gallery-mobile__action--wishlist {
	padding: 0;
	cursor: default;
}

.custom-gallery-mobile__action--wishlist .yith-wcwl-add-to-wishlist {
	margin: 0;
}

.custom-gallery-mobile__action--wishlist a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: #6b7280 !important;
	text-decoration: none !important;
}

.custom-gallery-mobile__action--wishlist .yith-wcwl-icon,
.custom-gallery-mobile__action--wishlist i {
	font-size: 18px;
	line-height: 1;
	color: #6b7280 !important;
}

/* Resets Elementor / tema sobre botones del carrusel móvil */
.custom-gallery-wrapper .custom-gallery-mobile button,
.custom-gallery-wrapper .custom-gallery-mobile__action button,
.custom-gallery-wrapper .custom-gallery-mobile__nav,
.custom-gallery-wrapper .custom-gallery-mobile__dot {
	font: inherit;
	line-height: 1;
	text-transform: none;
	letter-spacing: normal;
}

.custom-gallery-wrapper .custom-gallery-mobile__nav:hover,
.custom-gallery-wrapper .custom-gallery-mobile__nav:focus-visible,
.custom-gallery-wrapper .custom-gallery-mobile__action--share:hover,
.custom-gallery-wrapper .custom-gallery-mobile__action--share:focus-visible {
	background-color: rgba(15, 23, 42, 0.48) !important;
	color: #fff !important;
}

.custom-gallery-wrapper .custom-gallery-mobile__action--share:hover,
.custom-gallery-wrapper .custom-gallery-mobile__action--share:focus-visible {
	background-color: rgba(255, 255, 255, 1) !important;
	color: #374151 !important;
}

@media (max-width: 767px) {
	.custom-gallery--desktop {
		display: none !important;
	}

	.custom-gallery--mobile {
		display: block;
	}

	.custom-gallery-wrapper {
		margin-left: calc(50% - 50vw);
		margin-right: calc(50% - 50vw);
		width: 100vw;
		max-width: 100vw;
	}

	.custom-gallery-mobile {
		border-radius: 0;
	}
}
