/* =================================================================
   ФБ — Слайдер товаров и быстрый просмотр
   Дизайн-система V12: золото #c9a44e, красный #e8183a,
   Cormorant Garamond + Montserrat, скругления 14–18px.
   v1.0.3 — динамический aspect-ratio из настроек темы,
   скругление карточки, защита от пользовательской анимации .fb-dot.
   ================================================================= */

/* === Слайдер изображений === */
.fb-slider {
	position: relative;
	width: 100%;
	aspect-ratio: var(--fb-aspect-ratio, 5 / 6);
	background: #f6f3ee;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	border-radius: inherit;
	/* overflow на viewport, чтобы бейджи на абсолютной позиции
	   могли вылезать наверх */
	overflow: visible;
}

.fb-slider__viewport {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: inherit;
	touch-action: pan-y;
}

.fb-slider__track {
	display: flex;
	width: 100%;
	height: 100%;
	transition: transform .42s cubic-bezier(.22,.9,.22,1);
	will-change: transform;
}

.fb-slide {
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	position: relative;
}

.fb-slide img,
.fb-slide .wp-post-image {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	display: block;
	-webkit-user-drag: none;
	user-drag: none;
	pointer-events: none;
}

/* =================================================================
   ТОЧКИ-ИНДИКАТОРЫ (защита от стилей <button> Flatsome)
   ================================================================= */
.fb-slider__dots {
	position: absolute;
	bottom: 8px;
	left: 0;
	right: 0;
	display: flex;
	gap: 5px;
	justify-content: center;
	z-index: 3;
	pointer-events: auto;
	padding: 0 12px;
}

.fb-slider .fb-dot {
	/* Жёсткие размеры, перебивают стили <button> темы */
	width: 6px !important;
	height: 6px !important;
	min-width: 6px !important;
	min-height: 6px !important;
	max-height: 6px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;
	line-height: 0 !important;
	font-size: 0 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	border-radius: 50% !important;
	box-sizing: border-box !important;
	flex-shrink: 0 !important;
	box-shadow: 0 0 0 1px rgba(0,0,0,.18), 0 1px 3px rgba(0,0,0,.2);
	background: rgba(255,255,255,.55) !important;
	color: transparent;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	/* Защита от пользовательской анимации .fb-dot (LIVE-точка в полосе доверия) */
	animation: none !important;
	transition:
		width .35s cubic-bezier(.22,.9,.22,1),
		background .25s ease,
		border-radius .35s cubic-bezier(.22,.9,.22,1);
}

.fb-slider .fb-dot.is-active {
	width: 18px !important;
	max-width: 18px !important;
	background: #fff !important;
	border-radius: 3px !important;
}

/* =================================================================
   СТРЕЛКИ (защита от стилей <button> Flatsome)
   ================================================================= */
.fb-slider .fb-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;

	/* Жёсткие размеры */
	width: 32px !important;
	height: 32px !important;
	min-width: 32px !important;
	min-height: 32px !important;
	max-width: 32px !important;
	max-height: 32px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;

	font-size: 22px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	border-radius: 50% !important;
	box-sizing: border-box !important;
	font-family: Arial, sans-serif !important;

	background: rgba(255,255,255,.92);
	color: #1a1a1a;
	cursor: pointer;
	opacity: 0;

	transition: opacity .25s ease, background .2s ease, transform .2s ease;
	box-shadow: 0 2px 10px rgba(0,0,0,.18);

	display: flex;
	align-items: center;
	justify-content: center;
}

.fb-slider:hover .fb-arrow { opacity: 1; }

.fb-slider .fb-arrow:hover {
	background: #fff !important;
	transform: translateY(-50%) scale(1.08);
}

.fb-slider .fb-arrow--prev { left: 8px; }
.fb-slider .fb-arrow--next { right: 8px; }

@media (hover: none), (max-width: 768px) {
	.fb-slider .fb-arrow { display: none !important; }
}

/* Один слайд — скрыть всё лишнее */
.fb-slider[data-count="1"] .fb-slider__dots,
.fb-slider[data-count="1"] .fb-arrow {
	display: none !important;
}

/* =================================================================
   КНОПКА БЫСТРОГО ПРОСМОТРА
   ================================================================= */
.fb-qv-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;

	/* Жёсткие размеры */
	width: 38px !important;
	height: 38px !important;
	min-width: 38px !important;
	min-height: 38px !important;
	max-width: 38px !important;
	max-height: 38px !important;
	padding: 0 !important;
	margin: 0 0 6px 0 !important;

	border-radius: 50% !important;
	background: rgba(255,255,255,.95) !important;
	color: #1a1a1a !important;
	border: 1px solid rgba(0,0,0,.06) !important;
	box-shadow: 0 2px 10px rgba(0,0,0,.14) !important;
	box-sizing: border-box !important;

	font-size: 0 !important;
	line-height: 1 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;

	transition: all .2s cubic-bezier(.22,.9,.22,1);
	text-decoration: none !important;
}

.fb-qv-btn:hover,
.fb-qv-btn:focus {
	background: #c9a44e !important;
	color: #fff !important;
	transform: scale(1.08);
	border-color: rgba(0,0,0,.1) !important;
}

.fb-qv-btn svg {
	display: block;
	pointer-events: none;
	width: 18px;
	height: 18px;
}

@media (hover: none) {
	.product-small .image-tools.show-on-hover .fb-qv-btn {
		opacity: 1;
	}
	.product-small .image-tools.show-on-hover {
		opacity: 1 !important;
		visibility: visible !important;
		transform: none !important;
	}
}

/* =================================================================
   МОДАЛКА БЫСТРОГО ПРОСМОТРА — стиль V12 (тёмный)
   ================================================================= */
html.fb-qv-lock,
html.fb-qv-lock body {
	overflow: hidden !important;
}

.fb-qv-overlay {
	position: fixed;
	inset: 0;
	background: rgba(8, 8, 12, .82);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease, visibility .3s ease;
}

.fb-qv-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.fb-qv-content {
	/* V12 тёмная карточка */
	background: #181820;
	border: 1px solid rgba(201, 164, 78, .25);
	border-radius: 18px;
	max-width: 920px;
	width: 100%;
	max-height: 92vh;
	overflow: auto;
	position: relative;
	transform: scale(.96) translateY(20px);
	transition: transform .38s cubic-bezier(.34, 1.56, .64, 1);
	box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
	-webkit-overflow-scrolling: touch;
	color: #fff;
}

.fb-qv-overlay.is-open .fb-qv-content {
	transform: scale(1) translateY(0);
}

.fb-qv-loader {
	padding: 80px 30px;
	text-align: center;
	color: rgba(255,255,255,.55);
	font-size: 14px;
	font-family: 'Montserrat', system-ui, sans-serif;
}

.fb-qv {
	display: grid;
	grid-template-columns: 1.05fr 1fr;
	gap: 0;
	position: relative;
}

@media (max-width: 760px) {
	.fb-qv { grid-template-columns: 1fr; }
	.fb-qv-content {
		max-height: 96vh;
		border-radius: 14px;
	}
}

/* Крестик закрытия — защита от <button> темы */
#fbQuickView .fb-qv__close,
.fb-qv__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 5;

	width: 38px !important;
	height: 38px !important;
	min-width: 38px !important;
	min-height: 38px !important;
	max-width: 38px !important;
	max-height: 38px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;

	border-radius: 50% !important;
	background: rgba(0, 0, 0, .55) !important;
	color: #fff !important;
	cursor: pointer;
	font-size: 24px !important;
	line-height: 1 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	box-sizing: border-box !important;
	font-family: Arial, sans-serif !important;

	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .2s ease, transform .25s ease;
}

#fbQuickView .fb-qv__close:hover,
.fb-qv__close:hover {
	background: #e8183a !important;
	transform: rotate(90deg);
}

.fb-qv__media {
	background: #0a0a0c;
	overflow: hidden;
	aspect-ratio: var(--fb-aspect-ratio, 5 / 6);
	position: relative;
}

.fb-qv__media .fb-slider {
	aspect-ratio: var(--fb-aspect-ratio, 5 / 6);
	border-radius: 0;
	width: 100%;
	height: 100%;
	background: #0a0a0c;
}

.fb-qv__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.fb-qv__body {
	padding: 30px 28px 24px;
	display: flex;
	flex-direction: column;
	font-family: 'Montserrat', system-ui, sans-serif;
}

@media (max-width: 760px) {
	.fb-qv__body { padding: 22px 18px 20px; }
}

.fb-qv__title {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 28px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	margin: 0 0 8px;
}

@media (max-width: 760px) {
	.fb-qv__title { font-size: 22px; }
}

.fb-qv__sku {
	font-size: 12px;
	color: rgba(255,255,255,.5);
	margin-bottom: 12px;
	letter-spacing: .3px;
}

.fb-qv__price {
	font-size: 28px;
	font-weight: 700;
	color: #e8c97a;
	margin-bottom: 18px;
	line-height: 1;
}

.fb-qv__price del {
	color: rgba(255,255,255,.4);
	font-weight: 400;
	margin-right: 10px;
	font-size: 16px;
}

.fb-qv__price ins {
	text-decoration: none;
	color: #e8c97a;
}

.fb-qv__price .woocommerce-Price-amount {
	font-weight: 700;
}

.fb-qv__desc {
	font-size: 14px;
	line-height: 1.6;
	color: rgba(255,255,255,.78);
	margin-bottom: 20px;
	max-height: 180px;
	overflow: auto;
}

.fb-qv__desc p { margin: 0 0 8px; color: rgba(255,255,255,.78); }
.fb-qv__desc p:last-child { margin-bottom: 0; }
.fb-qv__desc a { color: #e8c97a; }

.fb-qv__meta { margin-bottom: 22px; }

.fb-qv__stock {
	font-size: 13px;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 999px;
	display: inline-block;
	letter-spacing: .2px;
}

.fb-qv__stock--in {
	background: rgba(34, 197, 94, .18);
	color: #4ade80;
}

.fb-qv__stock--out {
	background: rgba(232, 24, 58, .18);
	color: #ff7088;
}

.fb-qv__actions {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

#fbQuickView .fb-qv__buy,
.fb-qv__buy {
	display: block !important;
	width: 100% !important;
	text-align: center !important;
	padding: 15px 20px !important;
	background: linear-gradient(135deg, #e8183a 0%, #ff4060 100%) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 12px !important;
	font-weight: 700 !important;
	font-size: 14px !important;
	text-transform: uppercase !important;
	letter-spacing: .5px !important;
	cursor: pointer;
	transition: transform .2s ease, box-shadow .25s ease !important;
	text-decoration: none !important;
	font-family: 'Montserrat', system-ui, sans-serif !important;
	box-shadow: 0 4px 14px rgba(232, 24, 58, .35) !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	line-height: 1.2 !important;
	box-sizing: border-box !important;
}

.fb-qv__buy:hover,
.fb-qv__buy:focus {
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(232, 24, 58, .45) !important;
	color: #fff !important;
}

.fb-qv__buy.added::after {
	content: ' ✓';
}

.fb-qv__more {
	display: block;
	text-align: center;
	padding: 10px;
	font-size: 13px;
	color: rgba(255,255,255,.5);
	text-decoration: none;
	border-radius: 8px;
	transition: color .2s ease, background .2s ease;
	font-weight: 500;
}

.fb-qv__more:hover {
	color: #e8c97a;
	background: rgba(201, 164, 78, .08);
}

/* =================================================================
   Совместимость с Flatsome
   ================================================================= */
.product-small .box-image {
	position: relative;
}

.product-small .box-image .fb-slider {
	display: block;
}

/* Перебиваем стандартный hover-эффект Flatsome */
.product-small .box-image .image-fade_in_back img,
.product-small .box-image .image-zoom img {
	transition: none !important;
	transform: none !important;
	opacity: 1 !important;
}

/* Иконки Flatsome не должны конфликтовать со слайдером */
.product-small .image-tools {
	z-index: 4;
}

/* =================================================================
   Совместимость с пользовательскими бейджами .pb-wrap
   (если они вставлены внутри .box-image)
   ================================================================= */
.product-small .box-image .pb-wrap,
.pb-wrap {
	z-index: 10 !important; /* поверх слайдера */
}

/* =================================================================
   Защита: автоматическая подсветка цифр (Edge/Yandex Browser)
   В Quick View не нужны "копируемые цифры" в цене.
   ================================================================= */
.fb-qv__price {
	-webkit-user-modify: read-only;
}
.fb-qv__price * {
	pointer-events: none;
}

/* =================================================================
   СКРУГЛЕНИЕ КАРТОЧЕК ТОВАРА
   Синхронизирует все углы карточки с радиусом изображения.
   Чтобы отключить — в Custom CSS пропиши:
   :root { --fb-card-radius: 0 !important; }
   ================================================================= */
.product-small.box,
.product-small .box-image {
	border-radius: var(--fb-card-radius, 14px);
	overflow: hidden;
}

.product-small.box {
	/* Чтобы золотая обводка следовала за скруглением */
	overflow: hidden;
}

/* Если у карточки есть рамка и box-shadow — пусть тоже скругляются */
.product-small.box.box-vertical,
.product-small.box.box-text-bg {
	border-radius: var(--fb-card-radius, 14px);
}
