/* ============================================================
   FreeDev Popup Carousel
   ============================================================ */

.fdpc {
	position: relative;
}

.fdpc-empty {
	padding: 24px;
	text-align: center;
	border: 1px dashed #c9c9c9;
	color: #888;
	border-radius: 8px;
}

/* -------- Главная карусель -------- */
.fdpc-main {
	position: relative;
	padding: 0 4px;
}

.fdpc-item {
	position: relative;
	cursor: pointer;
	display: block;
	background: #111;
	outline: none;
}

.fdpc-item:focus-visible {
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4), 0 0 0 5px rgba(0, 0, 0, 0.4);
}

.fdpc-item__img {
	position: relative;
	width: 100%;
	height: 320px;
	overflow: hidden;
}

.fdpc-item__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.45s ease;
}

.fdpc-item:hover .fdpc-item__img img {
	transform: scale(1.06);
}

.fdpc-item__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	background: rgba(0, 0, 0, 0.55);
	z-index: 2;
}

.fdpc-item__caption-title {
	font-size: 16px;
	line-height: 1.3;
	font-weight: 600;
	color: #fff;
}

.fdpc-item__caption-desc {
	font-size: 13px;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.85);
}

/* Иконка "лупа/плюс" в углу — сигнал, что откроется попап */
.fdpc-item__icon {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: #fff;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity 0.25s ease, transform 0.25s ease;
	z-index: 3;
	pointer-events: none;
}

.fdpc-item:hover .fdpc-item__icon,
.fdpc-item:focus-visible .fdpc-item__icon {
	opacity: 1;
	transform: translateY(0);
}

/* -------- Стрелки -------- */
.fdpc-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 46px;
	height: 46px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	color: #fff;
	background: rgba(0, 0, 0, 0.5);
	cursor: pointer;
	z-index: 10;
	transition: background 0.2s ease, opacity 0.2s ease;
	padding: 0;
}

.fdpc-arrow:hover {
	background: rgba(0, 0, 0, 0.8);
}

.fdpc-main .fdpc-arrow--prev {
	left: 8px;
}

.fdpc-main .fdpc-arrow--next {
	right: 8px;
}

.fdpc-arrow.swiper-button-disabled {
	opacity: 0.35;
	cursor: default;
}

/* -------- Точки -------- */
.fdpc-main .swiper-pagination {
	position: static;
	margin-top: 16px;
}

.fdpc-main .swiper-pagination-bullet {
	width: 9px;
	height: 9px;
	background: #c9c9c9;
	opacity: 1;
	transition: transform 0.2s ease, background 0.2s ease;
}

.fdpc-main .swiper-pagination-bullet-active {
	background: #111;
	transform: scale(1.25);
}

/* ============================================================
   Попап / модальное окно
   ============================================================ */
.fdpc-no-scroll {
	overflow: hidden;
}

.fdpc-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.fdpc-modal.is-open {
	visibility: visible;
	opacity: 1;
}

.fdpc-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.8);
	cursor: pointer;
}

.fdpc-modal__box {
	position: relative;
	width: 100%;
	max-width: 1000px;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	background: #000;
	border-radius: 14px;
	z-index: 2;
	transform: translateY(16px) scale(0.98);
	transition: transform 0.3s ease;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.fdpc-modal.is-open .fdpc-modal__box {
	transform: translateY(0) scale(1);
}

.fdpc-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	color: #fff;
	background: rgba(0, 0, 0, 0.5);
	cursor: pointer;
	z-index: 20;
	transition: background 0.2s ease, transform 0.2s ease;
	padding: 0;
}

.fdpc-modal__close:hover {
	background: rgba(0, 0, 0, 0.85);
	transform: rotate(90deg);
}

/* Галерея в попапе */
.fdpc-modal__gallery {
	position: relative;
	width: 100%;
	background: #000;
	border-radius: 14px 14px 0 0;
	overflow: hidden;
}

.fdpc-modal__gallery .swiper-slide {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #000;
	height: auto;
}

/* Инстаграмный формат: обрезка по заданной пропорции (по умолчанию 16:9). */
.fdpc-modal__gallery .swiper-slide img {
	width: 100%;
	aspect-ratio: var(--fdpc-ratio, 16 / 9);
	object-fit: cover;
	display: block;
	border-radius: 8px;
}

/* Если выбран «Оригинал» — пропорция auto, ограничиваем высоту. */
.fdpc[style*="auto"] .fdpc-modal__gallery .swiper-slide img,
.fdpc-modal__gallery .swiper-slide img[data-ratio="auto"] {
	aspect-ratio: auto;
	max-height: 65vh;
	object-fit: contain;
}

.fdpc-modal__gallery .fdpc-modal__prev {
	left: 12px;
}

.fdpc-modal__gallery .fdpc-modal__next {
	right: 12px;
}

.fdpc-modal__pagination {
	bottom: 12px !important;
}

.fdpc-modal__pagination .swiper-pagination-bullet {
	background: #fff;
	opacity: 0.6;
	width: 9px;
	height: 9px;
}

.fdpc-modal__pagination .swiper-pagination-bullet-active {
	opacity: 1;
}

/* Одиночная картинка — прячем навигацию */
.fdpc-modal--single .fdpc-modal__prev,
.fdpc-modal--single .fdpc-modal__next,
.fdpc-modal--single .fdpc-modal__pagination {
	display: none;
}

/* Контент под галереей */
.fdpc-modal__content {
	padding: 24px 28px 30px;
}

.fdpc-modal__title {
	margin: 0 0 12px;
	font-size: 24px;
	line-height: 1.25;
	font-weight: 600;
	color: #fff;
	text-align: center;
}

.fdpc-modal__desc {
	font-size: 16px;
	line-height: 1.6;
	color: #e6e6e6;
	text-align: center;
}

.fdpc-modal__desc p {
	margin: 0 0 1em;
}

.fdpc-modal__desc p:last-child {
	margin-bottom: 0;
}

/* -------- Адаптив -------- */
@media (max-width: 767px) {
	.fdpc-modal {
		padding: 12px;
	}

	.fdpc-modal__box {
		max-height: calc(100vh - 24px);
	}

	.fdpc-modal__content {
		padding: 18px 18px 22px;
	}

	.fdpc-modal__title {
		font-size: 20px;
	}

	.fdpc-modal__desc {
		font-size: 15px;
	}

	.fdpc-modal__gallery .swiper-slide img {
		max-height: 50vh;
	}

	.fdpc-arrow {
		width: 40px;
		height: 40px;
	}
}
