/* ==========================================================================
 * Teknodayim - footer
 * ========================================================================== */

/* --------------------------------------------------------------------------
 * 1. Overflow fix for the "TD Global Minimal Footer" mu-plugin.
 *
 * The plugin footer uses the full-bleed trick
 *   left:50%; width:100vw; margin-left:-50vw
 * 100vw includes the vertical scrollbar, so on desktop the footer was
 * ~15-17px wider than the page -> the horizontal scrollbar visible on the
 * live site. The footer is printed directly inside <body> (wp_footer), so it
 * is already full width without the trick. `body .td-global-footer` is more
 * specific than the plugin's `.td-global-footer`, so this wins without
 * !important and without editing the plugin.
 * ----------------------------------------------------------------------- */
body .td-global-footer {
	right: auto;
	left: auto;
	width: auto;
	max-width: none;
	margin-right: 0;
	margin-left: 0;
}

/* The plugin's 3-column grid has hard minimums (260+420+260px + gaps +
 * padding = 1032px) but only collapses below 1021px, overflowing in between.
 * Same 1 : 1.35 : 1 proportions, but columns may shrink. */
@media (min-width: 1021px) {
	body .td-global-footer .td-global-footer-main {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr);
	}
}

/* --------------------------------------------------------------------------
 * 2. Theme fallback footer (only printed when the plugin is not active).
 * Same values as td-global-min-footer.php v1.2.0, scoped to .td-theme-footer
 * so they never touch the plugin's own footer.
 * ----------------------------------------------------------------------- */
.td-theme-footer {
	position: relative;
	margin-top: 22px;
	overflow: hidden;
	border-top: 1px solid var(--td-line-warm);
	background: linear-gradient(180deg, var(--td-cream-light), var(--td-cream));
	color: var(--td-dark);
	font-family: Arial, sans-serif;
}

.td-theme-footer * {
	box-sizing: border-box;
}

.td-theme-footer .td-global-footer-shell {
	width: 100%;
	margin: 0;
	padding: 16px 28px 11px;
}

.td-theme-footer .td-global-footer-main {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr);
	gap: 18px;
	align-items: center;
}

.td-theme-footer .td-global-footer-brand {
	display: flex;
	align-items: center;
	gap: 11px;
	min-width: 0;
}

.td-theme-footer .td-global-footer-logo {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	text-decoration: none;
}

.td-theme-footer .td-global-footer-logo img {
	display: block;
	width: auto;
	height: 34px;
	max-width: 108px;
	object-fit: contain;
}

.td-theme-footer .td-global-footer-badge {
	display: inline-flex;
	align-items: center;
	min-height: 23px;
	padding: 0 10px;
	border-radius: 999px;
	background: var(--td-orange-tint);
	color: var(--td-orange);
	font-size: 10px;
	font-weight: 900;
	text-transform: uppercase;
	white-space: nowrap;
}

.td-theme-footer .td-global-footer-text {
	max-width: 380px;
	margin: 4px 0 0;
	color: var(--td-muted);
	font-size: 12px;
	font-weight: 800;
	line-height: 1.35;
}

.td-theme-footer .td-global-footer-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.td-theme-footer .td-global-footer-links a,
.td-theme-footer .td-global-footer-phone {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 30px;
	padding: 0 11px;
	border: 1px solid var(--td-line-warm);
	border-radius: 999px;
	background: rgba(255, 255, 255, .86);
	color: #4b5563;
	font-size: 12px;
	font-weight: 900;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
}

.td-theme-footer .td-global-footer-links a:hover,
.td-theme-footer .td-global-footer-phone:hover {
	border-color: rgba(232, 80, 2, .24);
	background: var(--td-orange-tint);
	color: var(--td-orange);
}

.td-theme-footer .td-global-footer-contact {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	min-width: 0;
}

.td-theme-footer .td-global-footer-whatsapp {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 30px;
	padding: 0 13px;
	border-radius: 999px;
	background: var(--td-orange);
	color: #fff;
	font-size: 12px;
	font-weight: 900;
	text-decoration: none;
	white-space: nowrap;
}

.td-theme-footer .td-global-footer-whatsapp:hover {
	background: var(--td-orange-dark);
	color: #fff;
}

/* Row 2: legal / information pages + "Çerez Tercihleri" (ILM trigger). */
.td-theme-footer .td-footer-legal {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid var(--td-line-warm);
}

.td-theme-footer .td-footer-legal__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.td-theme-footer .td-footer-legal__list li {
	display: inline-flex;
	align-items: center;
}

.td-theme-footer .td-footer-legal__list li + li::before {
	content: "·";
	margin: 0 9px;
	color: #c9b8aa;
	font-weight: 900;
}

.td-theme-footer .td-footer-legal__list a,
.td-theme-footer .td-footer-legal__cookie {
	padding: 2px 0;
	border: 0;
	background: none;
	color: #4b5563;
	font: inherit;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.4;
	text-decoration: none;
	cursor: pointer;
}

.td-theme-footer .td-footer-legal__list a:hover,
.td-theme-footer .td-footer-legal__list a:focus,
.td-theme-footer .td-footer-legal__cookie:hover,
.td-theme-footer .td-footer-legal__cookie:focus {
	color: var(--td-orange);
	text-decoration: underline;
}

/* Row 3: copyright. */
.td-theme-footer .td-global-footer-bottom {
	margin-top: 10px;
	padding-top: 9px;
	border-top: 1px solid var(--td-line-warm);
	color: #6b7280;
	font-size: 11px;
	font-weight: 900;
	line-height: 1.2;
	text-align: center;
}

/* Full-width pages (front page hero, page builders): the last section sits
 * directly on the footer - no white strip in between. */
body.td-layout-full-page .td-theme-footer {
	margin-top: 0;
}

/* iyzico Legal Manager prints its own legal bar after the footer. Its links
 * and its "Çerez Tercihleri" trigger are in the theme footer above, so the
 * bar would be a second footer. Banner, modal and floating cookie button of
 * the plugin are separate elements and stay untouched. Better: switch the
 * bar off in the plugin settings - this rule then simply matches nothing. */
body.td-theme-footer-on .ilm-footer-bar {
	display: none !important;
}

@media (max-width: 1020px) {
	.td-theme-footer .td-global-footer-shell {
		padding-right: 18px;
		padding-left: 18px;
	}

	.td-theme-footer .td-global-footer-main {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.td-theme-footer .td-global-footer-brand,
	.td-theme-footer .td-global-footer-links,
	.td-theme-footer .td-global-footer-contact {
		justify-content: center;
		text-align: center;
	}

	.td-theme-footer .td-global-footer-text {
		max-width: none;
	}

}

@media (max-width: 640px) {
	.td-theme-footer {
		margin-top: 14px;
	}

	body.td-layout-full-page .td-theme-footer {
		margin-top: 0;
	}

	.td-theme-footer .td-global-footer-shell {
		padding: 10px 10px 9px;
	}

	.td-theme-footer .td-global-footer-main {
		gap: 8px;
	}

	.td-theme-footer .td-global-footer-brand {
		justify-content: flex-start;
		text-align: left;
	}

	.td-theme-footer .td-global-footer-logo img {
		height: 25px;
		max-width: 78px;
	}

	.td-theme-footer .td-global-footer-badge {
		min-height: 20px;
		padding: 0 7px;
		font-size: 9px;
	}

	.td-theme-footer .td-global-footer-text {
		display: none;
	}

	.td-theme-footer .td-global-footer-links {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 5px;
		width: 100%;
	}

	.td-theme-footer .td-global-footer-links a {
		min-height: 28px;
		padding: 0 5px;
		border-radius: 10px;
		font-size: 11px;
	}

	.td-theme-footer .td-global-footer-contact {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 5px;
		width: 100%;
	}

	.td-theme-footer .td-global-footer-phone,
	.td-theme-footer .td-global-footer-whatsapp {
		width: 100%;
		min-height: 30px;
		border-radius: 10px;
		font-size: 11px;
	}

	.td-theme-footer .td-footer-legal {
		margin-top: 10px;
		padding-top: 8px;
	}

	/* Phones: legal links in two tidy columns. */
	.td-theme-footer .td-footer-legal__list {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 2px 10px;
	}

	.td-theme-footer .td-footer-legal__list li + li::before {
		display: none;
	}

	.td-theme-footer .td-footer-legal__list a,
	.td-theme-footer .td-footer-legal__cookie {
		min-height: 30px;
		display: inline-flex;
		align-items: center;
		font-size: 11.5px;
		text-align: left;
	}

	.td-theme-footer .td-global-footer-bottom {
		margin-top: 8px;
		padding-top: 8px;
		font-size: 10px;
	}
}
