/* =========================================================
   FRONTEND
========================================================= */

.jarritos-custom-thumb-gallery {
	width: 100%;
	position: relative;
}

/* MAIN IMAGE AREA */

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-main {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: 20px;
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-main-images {
	position: relative;
	width: 100%;
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-slide {
	display: none;
	width: 100%;
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-slide.is-active {
	display: block;
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-slide img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 20px;
}

/* THUMBNAILS */

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-thumbs {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 10px;
	margin-top: 10px;
	width: 100%;
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-thumb {
	display: block;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;

	opacity: 0.35;
	transition: opacity 0.3s ease-out;

	aspect-ratio: 800 / 1100;

	overflow: hidden;
	border-radius: 20px;
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-thumb.is-active,
.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-thumb:hover {
	opacity: 1;
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 20px;
}

/* ARROWS */

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-arrow {
	opacity: 1 !important;
	visibility: visible !important;

	position: absolute;
	top: 50%;
	z-index: 30;

	display: flex;
	align-items: center;
	justify-content: center;

	width: 54px;
	height: 54px;
	padding: 12px;

	border: none;
	border-radius: 50px;

	background: #ff5100;
	color: #fff;

	cursor: pointer;

	transform: translateY(-50%);
	overflow: visible;

	transition:
		color 0.2s ease-out,
		background-color 0.2s ease-out;
}

.jarritos-custom-thumb-gallery.is-animating .jarritos-thumb-gallery-arrow {
	pointer-events: none;
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-arrow--prev {
	left: 14px;
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-arrow--next {
	right: 14px;
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-arrow svg {
	display: block;
	width: 26px;
	height: 26px;

	fill: #fff;
	stroke: #fff;
	stroke-width: 2px;

	overflow: visible;
	will-change: transform;

	transition:
		transform 0.25s cubic-bezier(0.37, 0.08, 0.02, 0.93),
		background-color 0.2s ease-out,
		color 0.2s ease-out;
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-arrow:hover svg {
	transform: translateX(4px);
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-arrow--prev:hover svg {
	transform: translateX(-4px);
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-arrow line {
	stroke: currentColor;
	stroke-width: 2px;
	fill: none !important;
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-transition {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: var(--jarritos-transition-height);
	max-height: 0;
	z-index: 20;
	overflow: hidden;
	pointer-events: none;
	border-radius: 20px;
	transition: max-height 0.9s ease;

	-webkit-mask-image: linear-gradient(
		to bottom,
		#000 0%,
		#000 calc(100% - 128px),
		rgba(0, 0, 0, 0) 100%
	);
	mask-image: linear-gradient(
		to bottom,
		#000 0%,
		#000 calc(100% - 128px),
		rgba(0, 0, 0, 0) 100%
	);
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-transition.is-active {
	max-height: var(--jarritos-transition-height);
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-transition.is-complete {
	-webkit-mask-image: none;
	mask-image: none;
}

.jarritos-custom-thumb-gallery .jarritos-thumb-gallery-transition-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: var(--jarritos-transition-height);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	border-radius: inherit;
}

/* =========================================================
   ADMIN
========================================================= */

.jarritos-gallery-admin {
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 8px;
	padding: 16px;
	margin: 20px 0;
}

.jarritos-gallery-header {
	display: flex;
	align-items: center;
	gap: 8px;
	border-bottom: 1px solid #dcdcde;
	padding-bottom: 10px;
	margin-bottom: 12px;
}

.jarritos-gallery-order,
.jarritos-row-order {
	display: grid;
	grid-template-rows: 1fr 1fr;
	gap: 2px;
	align-self: stretch;
}

.jarritos-gallery-order {
	width: 32px;
	flex: 0 0 32px;
}

.jarritos-gallery-order .button,
.jarritos-row-order .button {
	min-width: 28px;
	width: 28px;
	height: 22px;
	min-height: 22px;
	line-height: 18px;
	padding: 0;
	text-align: center;
}

.jarritos-gallery-title-block {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 1 auto;
}

.jarritos-gallery-title,
.jarritos-gallery-slug {
	width: 220px;
	min-height: 30px;
}

.jarritos-shortcode-preview {
	white-space: nowrap;
	font-size: 12px;
}

.jarritos-gallery-header .jarritos-remove-gallery {
	margin-left: auto;
}

.jarritos-gallery-settings {
	display: grid;
	grid-template-columns: repeat(4, minmax(160px, 1fr));
	gap: 10px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 10px;
	margin-bottom: 12px;
}

.jarritos-gallery-settings label {
	display: grid;
	gap: 4px;
	align-items: center;
}

.jarritos-gallery-settings input[type="number"] {
	width: 100%;
}

.jarritos-gallery-item {
	display: grid;
	grid-template-columns: 32px 52px 2fr auto 2fr auto;
	gap: 8px;
	align-items: center;
	padding: 8px;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	margin-bottom: 8px;
	background: #f6f7f7;
}

.jarritos-gallery-item input {
	width: 100%;
	min-height: 32px;
}

.jarritos-preview {
	width: 44px;
	height: 44px;
	background: #fff;
	border: 1px solid #dcdcde;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 4px;
}

.jarritos-preview a,
.jarritos-preview img {
	width: 100%;
	height: 100%;
	display: block;
}

.jarritos-preview img {
	object-fit: cover;
}

.jarritos-danger-button {
	background: #b32d2e !important;
	border-color: #b32d2e !important;
	color: #fff !important;
}

.jarritos-danger-button:hover {
	background: #8a2424 !important;
	border-color: #8a2424 !important;
	color: #fff !important;
}

.jarritos-gallery-actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

.jarritos-gallery-global-count {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 14px;
}

.jarritos-gallery-meta {
	margin-left: auto;
	margin-right: 10px;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
}

.jarritos-gallery-body {
	margin-top: 12px;
}

.jarritos-gallery-header {
	cursor: pointer;
}

.jarritos-gallery-header button,
.jarritos-gallery-header input,
.jarritos-gallery-header code {
	cursor: auto;
}

.jarritos-gallery-actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

@media (max-width: 1200px) {
	.jarritos-gallery-header {
		display: grid;
		grid-template-columns: 32px 1fr;
		align-items: start;
	}

	.jarritos-gallery-title-block {
		display: grid;
		grid-template-columns: 1fr;
	}

	.jarritos-gallery-settings {
		grid-template-columns: 1fr 1fr;
	}

	.jarritos-gallery-item {
		grid-template-columns: 32px 52px 1fr;
	}
}