/**
 * Rehber ön yüzü: ilçe arşivi, firma sayfası, mesaj formu ve hesap kısa kodları (kayıt, giriş, hesabım, bayi paneli).
 * Renk sabitlenmez: vurgu Elementor global primary, metin global text rengidir; site özelinde ayar için
 * .cxdem-rehber üzerinde --cxdem-* değişkenlerini ezmek yeterli.
 * Kırılımlar Elementor ile aynı: mobil <= 767px, tablet 768-1024px, masaüstü >= 1025px.
 */
.cxdem-rehber {
	--cxdem-accent: var(--e-global-color-primary, currentColor);
	--cxdem-text: var(--e-global-color-text, currentColor);
	/* Vurgu zeminindeki yazı (buton, aktif sayfa). Varsayılan kitin secondary rengi (karstanal: #C8F9AB
	   zemin #19310B üzerinde yaklaşık 12:1). Secondary rengi koyu olan sitede WCAG AA (4.5:1) için
	   .cxdem-rehber { --cxdem-btn-text: #fff; } ile ezilmeli; kontrast her site için ayrıca ölçülür. */
	--cxdem-btn-text: var(--e-global-color-secondary, #fff);
	--cxdem-muted: color-mix(in srgb, var(--cxdem-text) 85%, transparent);
	--cxdem-border: color-mix(in srgb, var(--cxdem-accent) 14%, transparent);
	--cxdem-border-strong: color-mix(in srgb, var(--cxdem-accent) 40%, transparent);
	--cxdem-surface: color-mix(in srgb, var(--cxdem-accent) 4%, transparent);
	--cxdem-field-bg: color-mix(in srgb, var(--cxdem-accent) 5%, #fff);
	--cxdem-focus: var(--cxdem-accent);
	--cxdem-radius: 12px;
	--cxdem-gap: 24px;
	--cxdem-width: 1200px;
	--cxdem-heading-font: var(--e-global-typography-primary-font-family, inherit);
	--cxdem-heading-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem);
	--cxdem-ease: cubic-bezier(0.23, 1, 0.32, 1);
	color: var(--cxdem-text);
}

/* Sayfa kapsayıcısı (ilçe, firma). Panel kısa kodları Elementor sayfasının kendi genişliğinde kalır. */
main.cxdem-rehber {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--cxdem-width);
	margin-inline: auto;
	padding: 40px 20px 64px;
}

.cxdem-rehber *,
.cxdem-rehber *::before,
.cxdem-rehber *::after {
	box-sizing: border-box;
}

.cxdem-rehber a {
	color: var(--cxdem-accent);
	text-underline-offset: 0.2em;
}

.cxdem-rehber a:focus-visible,
.cxdem-rehber button:focus-visible,
.cxdem-rehber input:focus-visible,
.cxdem-rehber select:focus-visible,
.cxdem-rehber textarea:focus-visible,
.cxdem-rehber summary:focus-visible {
	outline: 2px solid var(--cxdem-focus);
	outline-offset: 2px;
}

.cxdem-rehber h1,
.cxdem-rehber h2 {
	font-family: var(--cxdem-heading-font);
	color: var(--cxdem-accent);
	text-wrap: balance;
}

.cxdem-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cxdem-baslik {
	margin: 0 0 8px;
	font-size: var(--cxdem-heading-size);
	line-height: 1.15;
}

.cxdem-rehber ul[role="list"] {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ---- İlçe arşivi ---- */

.cxdem-ilce__ust {
	margin-bottom: 32px;
}

.cxdem-ilce__sayi,
.cxdem-firma__ilce {
	margin: 0;
	color: var(--cxdem-muted);
}

.cxdem-ilce__aciklama {
	max-width: 70ch;
	margin-top: 12px;
}

.cxdem-kartlar {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--cxdem-gap);
}

.cxdem-kart {
	margin: 0;
}

.cxdem-rehber .cxdem-kart__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: 1px solid var(--cxdem-border);
	border-radius: var(--cxdem-radius);
	color: inherit;
	text-decoration: none;
	background: var(--cxdem-surface);
	transition: border-color 200ms var(--cxdem-ease), transform 200ms var(--cxdem-ease);
}

.cxdem-kart__gorsel {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: color-mix(in srgb, var(--cxdem-accent) 10%, #fff);
}

.cxdem-kart__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cxdem-kart__yer-tutucu {
	display: grid;
	place-items: center;
	height: 100%;
	font-family: var(--cxdem-heading-font);
	font-size: 3.5rem;
	color: var(--cxdem-accent);
}

.cxdem-kart__govde {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 18px 20px 22px;
}

.cxdem-rehber .cxdem-kart__ad {
	margin: 0;
	font-size: 1.25rem;
	line-height: 1.3;
}

.cxdem-kart__ozet {
	color: var(--cxdem-muted);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.cxdem-bos {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding: 40px 24px;
	border: 1px dashed var(--cxdem-border-strong);
	border-radius: var(--cxdem-radius);
	background: var(--cxdem-surface);
	text-align: center;
}

.cxdem-bos__metin {
	margin: 0;
	color: var(--cxdem-muted);
}

/* Boş durumdaki tek eylem: form gönder butonuyla aynı birincil görünüm. */
.cxdem-rehber .cxdem-bos__eylem {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 28px;
	border-radius: var(--cxdem-radius);
	background: var(--cxdem-accent);
	color: var(--cxdem-btn-text);
	font-weight: 600;
	text-decoration: none;
	transition: transform 160ms var(--cxdem-ease), background-color 200ms var(--cxdem-ease);
}

.cxdem-rehber .cxdem-bos__eylem:active {
	transform: scale(0.97);
}

.cxdem-sayfalama {
	margin-top: 40px;
}

.cxdem-sayfalama ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cxdem-sayfalama li > .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--cxdem-border);
	border-radius: var(--cxdem-radius);
	text-decoration: none;
}

.cxdem-sayfalama li > .page-numbers.current {
	background: var(--cxdem-accent);
	border-color: var(--cxdem-accent);
	color: var(--cxdem-btn-text);
}

/* ---- Firma sayfası ---- */

.cxdem-firma__ust {
	margin-bottom: 28px;
}

.cxdem-firma__izgara {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--cxdem-gap);
}

.cxdem-firma__kapak img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 520px;
	object-fit: cover;
	border-radius: var(--cxdem-radius);
}

.cxdem-firma__yan,
.cxdem-firma__icerik {
	display: flex;
	flex-direction: column;
	gap: var(--cxdem-gap);
	min-width: 0;
}

.cxdem-kutu {
	padding: 24px;
	border: 1px solid var(--cxdem-border);
	border-radius: var(--cxdem-radius);
	background: var(--cxdem-surface);
}

.cxdem-rehber .cxdem-kutu__baslik,
.cxdem-rehber .cxdem-bolum__baslik {
	margin: 0 0 16px;
	font-size: 1.375rem;
	line-height: 1.25;
}

.cxdem-firma__adres {
	margin: 0 0 16px;
}

.cxdem-eylemler,
.cxdem-linkler {
	display: grid;
	gap: 10px;
}

.cxdem-rehber .cxdem-eylem,
.cxdem-rehber .cxdem-linkler__link {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 10px 18px;
	border: 1px solid var(--cxdem-border-strong);
	border-radius: var(--cxdem-radius);
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	overflow-wrap: anywhere;
	transition: background-color 200ms var(--cxdem-ease), color 200ms var(--cxdem-ease);
}

.cxdem-metin > :first-child {
	margin-top: 0;
}

.cxdem-metin > :last-child {
	margin-bottom: 0;
}

.cxdem-galeri {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.cxdem-galeri__link {
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: calc(var(--cxdem-radius) - 4px);
}

.cxdem-galeri__link img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 300ms var(--cxdem-ease);
}

#cxdem-mesaj {
	scroll-margin-top: 96px;
}

#cxdem-mesaj:focus {
	outline: none;
}

/* ---- Formlar (mesaj, kayıt, giriş, hesabım, bayi paneli) ---- */

.cxdem-rehber form {
	max-width: 640px;
}

.cxdem-rehber form p {
	margin: 0 0 16px;
}

/* Kit etiket stili (.elementor-kit-N label) başlık fontunu ve büyük boyutu getiriyordu; form etiketi gövde fontunda. */
.cxdem-rehber label {
	font-weight: 500;
	line-height: 1.4;
}

.cxdem-rehber form label {
	font-family: var(--e-global-typography-text-font-family, inherit);
	font-size: 0.9375rem;
}

.cxdem-rehber form label:has(> input:not([type="checkbox"]):not([type="radio"])),
.cxdem-rehber form label:has(> select),
.cxdem-rehber form label:has(> textarea),
.cxdem-rehber .cxdem-mesaj-form label[for] {
	display: block;
	margin-bottom: 6px;
}

/* Kit form alanı stili (.elementor-kit-N input/textarea) kenarlığı kaldırır, zemini boyar; burada açıkça verilir. */
.cxdem-rehber input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
.cxdem-rehber.cxdem-rehber select,
.cxdem-rehber.cxdem-rehber textarea {
	display: block;
	width: 100%;
	min-height: 48px;
	margin-top: 6px;
	padding: 12px 16px;
	border: 1px solid var(--cxdem-border-strong);
	border-radius: var(--cxdem-radius);
	background-color: var(--cxdem-field-bg);
	color: var(--cxdem-text);
	font: inherit;
	font-size: max(16px, 1rem); /* iOS odakta yakınlaştırmasın */
	line-height: 1.4;
}

.cxdem-rehber input[type="file"] {
	min-height: 0;
	padding: 10px;
}

.cxdem-rehber.cxdem-rehber textarea {
	min-height: 120px;
	resize: vertical;
}

.cxdem-rehber input[type="checkbox"],
.cxdem-rehber input[type="radio"] {
	width: 20px;
	height: 20px;
	margin: 0 8px 0 0;
	vertical-align: -4px;
	accent-color: var(--cxdem-accent);
}

.cxdem-rehber button[type="submit"],
.cxdem-rehber input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 28px;
	border: 1px solid var(--cxdem-accent);
	border-radius: var(--cxdem-radius);
	background: var(--cxdem-accent);
	color: var(--cxdem-btn-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: transform 160ms var(--cxdem-ease), background-color 200ms var(--cxdem-ease);
}

.cxdem-rehber button[type="submit"]:active,
.cxdem-rehber input[type="submit"]:active {
	transform: scale(0.97);
}

.cxdem-istege-bagli,
.cxdem-rehber .cxdem-not {
	color: var(--cxdem-muted);
	font-size: 0.9375rem;
	font-weight: 400;
}

.cxdem-rehber .cxdem-alan-hata {
	display: block;
	margin-top: 6px;
	color: #b42318;
	font-size: 0.9375rem;
}

.cxdem-rehber .cxdem-uyari:focus,
.cxdem-rehber .cxdem-bilgi:focus {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.cxdem-rehber .cxdem-uyari,
.cxdem-rehber .cxdem-bilgi {
	margin: 0 0 20px;
	padding: 14px 18px;
	border-radius: var(--cxdem-radius);
	border: 1px solid;
}

.cxdem-rehber .cxdem-uyari {
	border-color: #b42318;
	background: #fef3f2;
	color: #7a271a;
}

.cxdem-rehber .cxdem-bilgi {
	border-color: var(--cxdem-border-strong);
	background: color-mix(in srgb, var(--cxdem-accent) 8%, #fff);
	color: var(--cxdem-accent);
}

.cxdem-rehber .cxdem-uyari ul,
.cxdem-rehber .cxdem-uyari p,
.cxdem-rehber .cxdem-bilgi ul,
.cxdem-rehber .cxdem-bilgi p {
	margin: 0;
}

.cxdem-rehber .cxdem-uyari ul {
	padding-left: 1.2em;
}

/* Hesabım ve bayi paneli */
.cxdem-panel .cxdem-firma-panel,
.cxdem-panel .cxdem-bayi-panel {
	margin-bottom: 32px;
	padding: 24px;
	border: 1px solid var(--cxdem-border);
	border-radius: var(--cxdem-radius);
	background: var(--cxdem-surface);
}

.cxdem-panel h2 {
	margin: 0 0 12px;
	font-size: 1.5rem;
	line-height: 1.25;
}

.cxdem-panel h3 {
	margin: 24px 0 12px;
}

.cxdem-panel details {
	margin-top: 16px;
}

.cxdem-panel summary {
	display: flex;
	align-items: center;
	min-height: 48px;
	padding: 10px 16px;
	border: 1px solid var(--cxdem-border-strong);
	border-radius: var(--cxdem-radius);
	font-weight: 600;
	cursor: pointer;
}

.cxdem-panel details[open] summary {
	margin-bottom: 16px;
}

.cxdem-panel table {
	width: 100%;
	margin: 0 0 16px;
	border-collapse: collapse;
}

.cxdem-panel th,
.cxdem-panel td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--cxdem-border);
	text-align: left;
	vertical-align: top;
}

.cxdem-panel .cxdem-galeri-oge {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	margin: 0 8px 8px 0;
	font-weight: 400;
}

.cxdem-panel .cxdem-galeri-oge img {
	border-radius: 8px;
}

.cxdem-panel .login-remember label {
	font-weight: 400;
}

@media (hover: hover) and (pointer: fine) {
	.cxdem-rehber .cxdem-kart__link:hover {
		border-color: var(--cxdem-border-strong);
		transform: translateY(-2px);
	}

	.cxdem-rehber .cxdem-eylem:hover,
	.cxdem-rehber .cxdem-linkler__link:hover {
		background: var(--cxdem-accent);
		color: var(--cxdem-btn-text);
	}

	.cxdem-galeri__link:hover img {
		transform: scale(1.04);
	}

	.cxdem-rehber button[type="submit"]:hover,
	.cxdem-rehber input[type="submit"]:hover,
	.cxdem-rehber .cxdem-bos__eylem:hover {
		background: color-mix(in srgb, var(--cxdem-accent) 85%, #000);
		color: var(--cxdem-btn-text);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cxdem-rehber *,
	.cxdem-rehber *::before,
	.cxdem-rehber *::after {
		transition: none !important;
	}
}

/* Mobil: tablolar yatay kayar, sayfa taşmaz. */
@media (max-width: 767px) {
	main.cxdem-rehber {
		padding: 28px 16px 48px;
	}

	.cxdem-kutu,
	.cxdem-panel .cxdem-firma-panel,
	.cxdem-panel .cxdem-bayi-panel {
		padding: 18px;
	}

	.cxdem-panel table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}

	.cxdem-rehber button[type="submit"],
	.cxdem-rehber input[type="submit"] {
		width: 100%;
	}
}

/* Tablet: 2 sütun */
@media (min-width: 768px) {
	.cxdem-kartlar {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cxdem-galeri {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Masaüstü: 3 sütun; firma sayfasında iletişim sağda sabit */
@media (min-width: 1025px) {
	.cxdem-kartlar {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.cxdem-firma__izgara {
		grid-template-columns: minmax(0, 1fr) 360px;
		grid-template-areas: "kapak yan" "icerik yan";
		align-items: start;
		column-gap: 40px;
	}

	.cxdem-firma__izgara:not(:has(.cxdem-firma__kapak)) {
		grid-template-areas: "icerik yan";
	}

	.cxdem-firma__kapak {
		grid-area: kapak;
	}

	.cxdem-firma__icerik {
		grid-area: icerik;
	}

	.cxdem-firma__yan {
		grid-area: yan;
		position: sticky;
		top: 24px;
	}
}
