/**
 * Hairtec — Voor & Na Cases widget stilleri.
 *
 * Tasarım token'ları fallback değer olarak gömülüdür; Elementor stil
 * kontrolleri bu kuralları daha yüksek özgüllükle override eder.
 * Kırılımlar: <768 mobil · 768–1023 tablet · ≥1024 masaüstü.
 */

/* ── Bölüm yerleşimi ───────────────────────────────────────────── */

.hbac {
	--hbac-grid-gap: 20px;
	/* Görünen kart sayısı: PHP inline style ile --hbac-spv-d/t/m basar. */
	--hbac-spv: var(--hbac-spv-m, 1);
	/* Shrink-to-fit ebeveynlerde (ör. Elementor flex container'ları)
	   genişlik içerikten türemesin — aksi halde Swiper'ın px slayt
	   genişlikleri ResizeObserver ile sonsuz büyüme döngüsü kurar. */
	width: 100%;
	box-sizing: border-box;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "head" "carousel" "nav" "btn";
	row-gap: 20px;
	/* Arka plan ve iç boşluk bilinçli olarak yok: widget, içine konduğu
	   Elementor section/container'ın genişliğine ve zeminine uyar.
	   İsteyen Stil sekmesinden ekleyebilir. */
}

@media (min-width: 768px) {
	.hbac {
		--hbac-spv: var(--hbac-spv-t, 2);
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: "head btn" "carousel carousel" "nav nav";
		row-gap: 28px;
		column-gap: 32px;
	}
}

@media (min-width: 1024px) {
	.hbac { --hbac-spv: var(--hbac-spv-d, 3); }
}

/* ── Başlık ────────────────────────────────────────────────────── */

.hbac__head {
	grid-area: head;
	max-width: 600px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.hbac__title {
	margin: 0;
	font-size: 24px;
	line-height: 1.2;
	font-weight: 600;
	color: #223659;
}

.hbac__desc {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: #5c5c5c;
}

@media (min-width: 768px) {
	.hbac__head { gap: 12px; align-self: end; }
	.hbac__title { font-size: 36px; line-height: 1.15; }
	.hbac__desc { font-size: 16px; line-height: 1.65; }
}

/* ── Primary buton ─────────────────────────────────────────────── */

/* Tema/kit'in genel `a` kuralları (renk, font) butonu ezmesin diye
   seçici özgüllüğü bilinçli olarak yüksek tutulur (.hbac a.hbac__btn). */
.hbac .hbac__btn,
.hbac a.hbac__btn {
	grid-area: btn;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: #223659;
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 16px 24px;
	font-family: inherit;
	font-size: 12px;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: normal;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}

.hbac .hbac__btn:hover,
.hbac a.hbac__btn:hover,
.hbac a.hbac__btn:focus,
.hbac a.hbac__btn:visited:hover { background: #5c5c5c; color: #fff; }

.hbac a.hbac__btn:visited { color: #fff; }

.hbac .hbac__btn:focus-visible {
	outline: 2px solid #223659;
	outline-offset: 2px;
}

.hbac__btn svg { flex: none; }

@media (min-width: 768px) {
	.hbac .hbac__btn,
	.hbac a.hbac__btn { padding: 16px 28px; justify-self: end; align-self: end; }
}

/* ── Carousel iskeleti (Swiper core CSS'ine ihtiyaç bırakmaz) ──── */

.hbac__carousel {
	grid-area: carousel;
	min-width: 0;
	/* Carousel'in intrinsik genişliği slaytlardan bağımsız olsun:
	   içerik ne kadar genişlerse genişlesin konteyneri şişiremez.
	   width:100% şart — containment altında grid stretch'i tek başına
	   genişlik vermiyor (aksi halde 0px'e çöker). */
	contain: inline-size;
	width: 100%;
}

.hbac-swiper { position: relative; overflow: hidden; list-style: none; max-width: 100%; }

.hbac-swiper .swiper-wrapper {
	position: relative;
	display: flex;
	width: 100%;
	height: 100%;
	box-sizing: content-box;
	transition-property: transform;
}

.hbac-swiper .swiper-slide {
	flex-shrink: 0;
	width: 100%;
	position: relative;
	display: flex;
	height: auto;
	transition-property: transform;
	box-sizing: border-box;
}

.hbac-swiper .swiper-slide > .hbac-card { width: 100%; }

/*
 * CLS önleme: Swiper init olmadan önce slaytları nihai genişliğe yakın
 * boyutla — böylece init anında yerleşim sıçraması olmaz.
 * (Swiper 8 "swiper-initialized", Swiper 5 "swiper-container-initialized" ekler.)
 */
.hbac:not(.hbac--scroll) .hbac-swiper:not(.swiper-initialized):not(.swiper-container-initialized) .swiper-slide {
	width: calc((100% - (var(--hbac-spv) - 1) * var(--hbac-grid-gap, 20px)) / var(--hbac-spv));
	margin-right: var(--hbac-grid-gap, 20px);
}

/* Swiper yüklenemezse: yatay kaydırmalı (scroll-snap) fallback */

.hbac--scroll .swiper-wrapper {
	overflow-x: auto;
	gap: var(--hbac-grid-gap, 20px);
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.hbac--scroll .swiper-wrapper::-webkit-scrollbar { display: none; }

.hbac--scroll .swiper-slide {
	scroll-snap-align: start;
	width: calc((100% - (var(--hbac-spv) - 1) * var(--hbac-grid-gap, 20px)) / var(--hbac-spv));
}

/* ── Vaka kartı ────────────────────────────────────────────────── */

.hbac-card {
	background: #fff;
	border-radius: 20px;
	padding: 12px;
	box-shadow: 0 10px 30px rgba(34, 54, 89, .07);
	display: flex;
	flex-direction: column;
	gap: 10px;
	box-sizing: border-box;
}

@media (min-width: 768px) {
	.hbac-card { padding: 14px; }
}

/* ── Resultaat/Video toggle ────────────────────────────────────── */

.hbac-card__toggle { display: flex; justify-content: center; }

.hbac-toggle {
	display: flex;
	background: #eeeff2;
	border-radius: 999px;
	padding: 4px;
	gap: 4px;
}

/* .hbac ön eki: tema/kit'in global `button` stillerine karşı özgüllük. */
.hbac .hbac-toggle__btn {
	border: 0;
	cursor: pointer;
	background: transparent;
	color: #5c5c5c;
	border-radius: 999px;
	padding: 7px 16px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	min-height: 0;
	transition: background-color .15s ease, color .15s ease;
}

/* Pasif toggle hover'ı: temanın button:hover'ı sızmasın, görünüm değişmesin. */
.hbac .hbac-toggle__btn:hover,
.hbac .hbac-toggle__btn:focus,
.hbac .hbac-toggle__btn:active {
	background: transparent;
	color: #5c5c5c;
	border: 0;
	border-radius: 999px;
	padding: 7px 16px;
	box-shadow: none;
	transform: none;
}

.hbac-card[data-view="foto"] .hbac-toggle__btn--foto,
.hbac-card[data-view="video"] .hbac-toggle__btn--video,
.hbac-card[data-view="foto"] .hbac-toggle__btn--foto:hover,
.hbac-card[data-view="video"] .hbac-toggle__btn--video:hover,
.hbac-card[data-view="foto"] .hbac-toggle__btn--foto:focus,
.hbac-card[data-view="video"] .hbac-toggle__btn--video:focus {
	background: #223659;
	color: #fff;
}

.hbac-toggle__btn:focus-visible {
	outline: 2px solid #223659;
	outline-offset: 2px;
}

/* ── Medya alanı ───────────────────────────────────────────────── */

.hbac-card__media { position: relative; }

.hbac-card[data-view="video"] .hbac-ba { display: none; }
.hbac-card[data-view="foto"] .hbac-video { display: none; }

/* ── Before/After slider ───────────────────────────────────────── */

.hbac-ba {
	--hbac-pos: 50%;
	position: relative;
	border-radius: 14px;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background: #e8ebf1;
	touch-action: none;
	cursor: ew-resize;
	user-select: none;
	-webkit-user-select: none;
}

.hbac-ba__after,
.hbac-ba__before {
	position: absolute;
	inset: 0;
}

.hbac-ba__before {
	clip-path: inset(0 calc(100% - var(--hbac-pos)) 0 0);
}

/* !important: tema/Elementor'un global `img { height:auto }` kuralları
   tam-dolgu görselleri bozamasın (ör. .elementor img { height:auto }). */
.hbac .hbac-ba img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	object-fit: cover;
	display: block;
	margin: 0;
	border-radius: 0;
	-webkit-user-drag: none;
	pointer-events: none;
}

.hbac-ba__label {
	position: absolute;
	top: 10px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.4;
	border-radius: 999px;
	padding: 4px 10px;
	pointer-events: none;
	white-space: nowrap;
}

.hbac-ba__label--before {
	left: 10px;
	background: rgba(34, 54, 89, .8);
	color: #fff;
}

.hbac-ba__label--after {
	right: 10px;
	background: rgba(255, 255, 255, .85);
	color: #223659;
}

.hbac-ba__divider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--hbac-pos);
	width: 2px;
	margin-left: -1px;
	background: #fff;
	box-shadow: 0 0 8px rgba(0, 0, 0, .35);
	pointer-events: none;
}

.hbac-ba__handle {
	position: absolute;
	top: 50%;
	left: var(--hbac-pos);
	transform: translate(-50%, -50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #223659;
	cursor: ew-resize;
	padding: 0;
	border: 0;
}

@media (min-width: 768px) {
	.hbac-ba__handle { width: 38px; height: 38px; }
}

.hbac-ba__handle:focus-visible {
	outline: 2px solid #223659;
	outline-offset: 2px;
}

/* ── Video alanı (tıkla-yükle facade) ──────────────────────────── */

.hbac-video {
	position: relative;
	border-radius: 14px;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background: #1a2942;
}

.hbac .hbac-video__thumb {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	object-fit: cover;
	display: block;
	margin: 0;
	border-radius: 0;
}

.hbac .hbac-video__play {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	color: #fff;
}

/* Temanın global `button:hover` stili tüm alanı kaplayan oynat butonunu
   boyamasın — hover/focus/active durumlarında da tamamen şeffaf kal. */
.hbac .hbac-video__play:hover,
.hbac .hbac-video__play:focus,
.hbac .hbac-video__play:active {
	background: transparent;
	border: 0;
	border-radius: 0;
	padding: 0;
	box-shadow: none;
	transform: none;
	opacity: 1;
}

.hbac-video__play-ring {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .9);
	background: rgba(255, 255, 255, .16);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color .2s ease;
}

.hbac-video__play:hover .hbac-video__play-ring { background: rgba(255, 255, 255, .28); }

.hbac-video__play:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
	border-radius: 14px;
}

.hbac-video__badge {
	position: absolute;
	left: 10px;
	bottom: 10px;
	background: rgba(34, 54, 89, .8);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.4;
	border-radius: 999px;
	padding: 4px 10px;
	pointer-events: none;
}

.hbac-video__frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	object-fit: cover;
}

.hbac-video--playing .hbac-video__thumb,
.hbac-video--playing .hbac-video__play,
.hbac-video--playing .hbac-video__badge { display: none; }

/* ── Bilgi chip'leri ───────────────────────────────────────────── */

.hbac-card__chips {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	padding: 0 2px 2px;
	margin-top: auto;
}

.hbac-chip {
	background: #eeeff2;
	color: #223659;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	border-radius: 999px;
	padding: 6px 12px;
}

/* ── Navigasyon ────────────────────────────────────────────────── */

.hbac__nav {
	grid-area: nav;
	display: flex;
	align-items: center;
	gap: 10px;
}

.hbac__dots {
	display: flex;
	gap: 8px;
	order: -1;
	margin-right: auto;
}

@media (min-width: 768px) {
	.hbac__nav { justify-content: center; gap: 18px; }
	.hbac__dots { order: 0; margin-right: 0; }
}

.hbac .hbac__arrow {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex: none;
	padding: 0;
	min-height: 0;
	box-shadow: none;
	transition: background-color .2s ease;
}

.hbac .hbac__arrow--prev {
	background: #fff;
	border: 1px solid #d7dce6;
	color: #223659;
}

.hbac .hbac__arrow--prev:hover,
.hbac .hbac__arrow--prev:focus {
	background: #eeeff2;
	color: #223659;
	border: 1px solid #d7dce6;
	border-radius: 50%;
	padding: 0;
	box-shadow: none;
	transform: none;
}

.hbac .hbac__arrow--next {
	background: #223659;
	border: 0;
	color: #fff;
}

.hbac .hbac__arrow--next:hover,
.hbac .hbac__arrow--next:focus {
	background: #5c5c5c;
	color: #fff;
	border: 0;
	border-radius: 50%;
	padding: 0;
	box-shadow: none;
	transform: none;
}

.hbac .hbac__arrow:focus-visible {
	outline: 2px solid #223659;
	outline-offset: 2px;
}

.hbac .hbac__arrow.swiper-button-disabled {
	opacity: .4;
	cursor: default;
	pointer-events: none;
}

/* Kartlar zaten sığıyorsa navigasyon gereksizdir: Swiper "lock" durumunda
   oklar/noktalar her koşulda gizli kalır (görünürlük kontrolünden bağımsız). */
.hbac .hbac__arrow.swiper-button-lock,
.hbac .hbac__dots.swiper-pagination-lock { display: none !important; }

.hbac__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #c9d0dc;
	cursor: pointer;
	display: block;
	transition: background-color .2s ease;
}

@media (min-width: 768px) {
	.hbac__dot { width: 9px; height: 9px; }
}

.hbac__dot--active { background: #223659; }

/* ── Hareket azaltma tercihi ───────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.hbac-swiper .swiper-wrapper,
	.hbac-swiper .swiper-slide { transition-duration: 1ms !important; }
}
