/**
 * Price List for Divi 5: base styles.
 *
 * Everything here is a default. Module settings print per-instance CSS with
 * the module's order class, which is more specific and overrides these.
 */

/* ---------- List ---------- */

.dpl-list {
	--dpl-cols: 4;
	--dpl-gap: 12px;
	--dpl-ratio: 3/2;
	--dpl-leader-style: dotted;
	--dpl-leader-color: rgba(0, 0, 0, .35);
	--dpl-leader-width: 2px;
	display: flex;
	flex-direction: column;
	row-gap: 40px;
}

/* ---------- Section heading ---------- */

:where(.dpl-list) .dpl-heading {
	margin: 0;
	padding: 0;
	font-size: 22px;
	line-height: 1.3;
}

:where(.dpl-list) .dpl-heading:where(:not(:first-child)) {
	margin-top: 16px;
}

/* ---------- Service ---------- */

.dpl-item {
	box-sizing: border-box;
}

.dpl-item__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 12px;
	row-gap: 4px;
}

.dpl-item__name {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
	min-width: 0;
}

:where(.dpl-list) .dpl-item__title {
	margin: 0;
	padding: 0;
	font-size: 20px;
	line-height: 1.3;
}

/* The flexible space between name and price. "Price Position" makes it grow
   (price on the right edge) or disappear (price next to the name). */
.dpl-item__leader {
	flex: 1 1 auto;
	align-self: baseline;
	min-width: 20px;
	height: 0;
	border: 0;
}

.dpl-leader-on .dpl-item__leader {
	border-bottom: var(--dpl-leader-width) var(--dpl-leader-style) var(--dpl-leader-color);
	transform: translateY(-.3em);
}

.dpl-item__prices {
	display: flex;
	align-items: baseline;
	gap: 8px;
	white-space: nowrap;
}

.dpl-item__price {
	font-size: 20px;
	line-height: 1.3;
}

.dpl-item__old-price {
	opacity: .55;
	font-size: 16px;
	text-decoration: line-through;
}

.dpl-item__badge {
	display: inline-block;
	align-self: center;
	padding: 2px 8px;
	border-radius: 999px;
	background-color: #2ea3f2;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	text-transform: uppercase;
	letter-spacing: .04em;
}

:where(.dpl-list) .dpl-item__desc {
	margin: 6px 0 0;
	padding: 0;
	font-size: 15px;
	line-height: 1.5;
	opacity: .8;
}

/* ---------- Example images ---------- */

.dpl-item__thumbs {
	display: grid;
	grid-template-columns: repeat(var(--dpl-cols), minmax(0, 1fr));
	gap: var(--dpl-gap);
	margin-top: 12px;
}

/* Defaults use single classes or :where() so every Design setting of the
   module (order class + element, two classes) always wins. */
.dpl-thumb {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: var(--dpl-ratio);
	line-height: 0;
	transition: transform .35s ease, box-shadow .35s ease, opacity .35s ease;
}

a.dpl-thumb {
	cursor: zoom-in;
}

.dpl-thumb__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform .5s ease, filter .5s ease;
}

.dpl-hover-zoom-in .dpl-thumb:hover .dpl-thumb__img,
.dpl-hover-zoom-in .dpl-thumb:focus-visible .dpl-thumb__img {
	transform: scale(1.1);
}

/* Keeps the lift motion when a hover shadow (which sets its own transition) is set. */
.dpl-list.dpl-hover-lift .dpl-thumb {
	transition: transform .35s ease, box-shadow .35s ease;
}

.dpl-hover-lift .dpl-thumb:hover,
.dpl-hover-lift .dpl-thumb:focus-visible {
	transform: translateY(-4px);
}

:where(.dpl-hover-lift .dpl-thumb:hover, .dpl-hover-lift .dpl-thumb:focus-visible) {
	box-shadow: 0 10px 20px rgba(0, 0, 0, .18);
}

.dpl-hover-grayscale .dpl-thumb__img {
	filter: grayscale(1);
}

.dpl-hover-grayscale .dpl-thumb:hover .dpl-thumb__img,
.dpl-hover-grayscale .dpl-thumb:focus-visible .dpl-thumb__img {
	filter: grayscale(0);
}

.dpl-hover-dim .dpl-item__thumbs:hover .dpl-thumb:not(:hover) {
	opacity: .5;
}

.dpl-thumb:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---------- Builder hint ---------- */

.dpl-empty {
	padding: 30px;
	border: 2px dashed rgba(0, 0, 0, .2);
	text-align: center;
	color: #666;
}

/* ---------- Lightbox ---------- */

html.dpl-lightbox-active {
	overflow: hidden;
}

.dpl-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
}

.dpl-lightbox--open {
	display: flex;
	animation: dpl-fade-in .25s ease;
}

@keyframes dpl-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

.dpl-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: var(--dpl-lb-backdrop, rgba(0, 0, 0, .9));
}

.dpl-lightbox__stage {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	margin: 0;
	max-width: calc(100vw - 140px);
	max-height: calc(100vh - 80px);
}

.dpl-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 140px);
	width: auto;
	height: auto;
	object-fit: contain;
	transition: opacity .2s ease;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.dpl-lightbox--loading .dpl-lightbox__img {
	opacity: .3;
}

.dpl-lightbox__caption {
	margin-top: 12px;
	color: #eee;
	font-size: 14px;
	line-height: 1.5;
	text-align: center;
}

.dpl-lightbox__caption[hidden] {
	display: none;
}

.dpl-lightbox__title {
	display: block;
	color: #fff;
	font-size: 16px;
}

.dpl-lightbox__counter {
	position: absolute;
	top: 18px;
	left: 20px;
	color: #ccc;
	font-size: 14px;
}

/* Look set per gallery under Design > Lightbox Buttons (see applyStyle()). */
.dpl-lightbox__btn {
	position: absolute;
	width: var(--dpl-lb-btn-size, 48px);
	height: var(--dpl-lb-btn-size, 48px);
	padding: 0;
	border: 0;
	border-radius: var(--dpl-lb-btn-radius, 50%);
	background: var(--dpl-lb-btn-bg, rgba(255, 255, 255, .12));
	color: var(--dpl-lb-btn-color, #fff);
	cursor: pointer;
	transition: background-color .2s ease;
}

.dpl-lightbox__btn:hover,
.dpl-lightbox__btn:focus-visible {
	background: var(--dpl-lb-btn-bg-hover, rgba(255, 255, 255, .28));
	outline: none;
}

.dpl-lightbox__btn:focus-visible {
	box-shadow: 0 0 0 2px var(--dpl-lb-btn-color, #fff);
}

.dpl-lightbox__btn::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 14px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
}

.dpl-lightbox__close {
	top: 12px;
	right: 12px;
}

.dpl-lightbox__close::before,
.dpl-lightbox__close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 2px;
	border: 0;
	background: currentColor;
	transform: translate(-50%, -50%) rotate(45deg);
}

.dpl-lightbox__close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.dpl-lightbox__prev {
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.dpl-lightbox__prev::before {
	transform: translate(-30%, -50%) rotate(-135deg);
}

.dpl-lightbox__next {
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.dpl-lightbox__next::before {
	transform: translate(-70%, -50%) rotate(45deg);
}

.dpl-lightbox--single .dpl-lightbox__prev,
.dpl-lightbox--single .dpl-lightbox__next {
	display: none;
}

@media (max-width: 767px) {
	.dpl-lightbox__stage {
		max-width: calc(100vw - 24px);
	}

	.dpl-lightbox__prev,
	.dpl-lightbox__next {
		top: auto;
		bottom: 16px;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dpl-thumb,
	.dpl-thumb__img,
	.dpl-lightbox--open {
		transition: none !important;
		animation: none !important;
	}
}
