/**
 * FAZ 10A — global legal UI: cookie banner + preferences dialog, checkout pre-information
 * dialog (Ön Bilgilendirme) and the order document box (order received / Siparişim).
 * Token-based; loaded on every page (small).
 */

/* ==========================================================================
   Cookie banner (layer 1)
   ========================================================================== */

.mt-cc {
	position: fixed;
	right: var(--mt-space-4);
	bottom: var(--mt-space-4);
	left: var(--mt-space-4);
	z-index: var(--mt-z-toast);
	max-width: 1040px;
	margin: 0 auto;
	padding: var(--mt-space-5) var(--mt-space-6);
	border: 1px solid var(--mt-border-subtle);
	border-radius: var(--mt-radius-xl);
	background: var(--mt-bg-surface);
	box-shadow: var(--mt-shadow-xl);
	color: var(--mt-text-body);
}

.mt-cc[hidden] {
	display: none;
}

.mt-cc__inner {
	display: flex;
	align-items: center;
	gap: var(--mt-space-6);
}

.mt-cc__text {
	flex: 1 1 auto;
	min-width: 0;
	font-size: var(--mt-fs-base);
	line-height: var(--mt-lh-normal);
}

.mt-cc__text p {
	margin: 0;
}

.mt-cc__title {
	display: flex;
	align-items: center;
	gap: var(--mt-space-2);
	margin-bottom: var(--mt-space-1) !important;
	font-family: var(--mt-font-heading);
	font-size: var(--mt-fs-lg);
	font-weight: var(--mt-fw-bold);
	color: var(--mt-text-heading);
}

.mt-cc__title .mt-icon {
	color: var(--mt-color-primary);
}

.mt-cc__text a {
	color: var(--mt-text-link);
	font-weight: var(--mt-fw-semibold);
}

.mt-cc__actions {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--mt-space-2);
	flex: 0 0 auto;
	width: 460px;
	max-width: 100%;
}

/* All choices share ONE style (Çerez Rehberi s.30: equal colour, size, font). */
.mt-cc__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--mt-btn-h-md);
	padding: 0 var(--mt-space-4);
	border: 1.5px solid var(--mt-color-primary-strong);
	border-radius: var(--mt-radius-pill);
	background: var(--mt-bg-surface);
	color: var(--mt-color-primary-strong);
	font-family: var(--mt-font-body);
	font-size: var(--mt-fs-base);
	font-weight: var(--mt-fw-bold);
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
}

.mt-cc__btn:hover {
	background: var(--mt-color-primary-soft);
}

.mt-cc__btn:focus-visible,
.mt-cc-dialog__close:focus-visible,
.mt-cc-switch:focus-visible,
.mt-co-doc-button:focus-visible,
.mt-preinfo__close:focus-visible {
	outline: none;
	box-shadow: var(--mt-focus-ring);
}

@media (max-width: 767px) {
	.mt-cc {
		right: var(--mt-space-2);
		bottom: calc(var(--mt-space-2) + env(safe-area-inset-bottom, 0px));
		left: var(--mt-space-2);
		padding: var(--mt-space-4);
	}

	.mt-has-bottom-nav .mt-cc {
		bottom: calc(var(--mt-bottom-nav-h) + var(--mt-space-2) + env(safe-area-inset-bottom, 0px));
	}

	.mt-cc__inner {
		flex-direction: column;
		align-items: stretch;
		gap: var(--mt-space-3);
	}

	/* Equal size on mobile too (Çerez Rehberi s.30): one full-width row per choice. */
	.mt-cc__actions {
		width: auto;
		grid-template-columns: 1fr;
	}

	.mt-cc__text {
		font-size: var(--mt-fs-sm);
	}
}

/* ==========================================================================
   Preferences dialog (layer 2) + shared dialog look
   ========================================================================== */

.mt-cc-dialog,
.mt-preinfo {
	width: min(640px, calc(100vw - 2 * var(--mt-space-4)));
	max-height: calc(100dvh - 2 * var(--mt-space-6));
	padding: 0;
	border: 0;
	border-radius: var(--mt-radius-xl);
	background: var(--mt-bg-surface);
	box-shadow: var(--mt-shadow-xl);
	color: var(--mt-text-body);
}

.mt-preinfo {
	width: min(820px, calc(100vw - 2 * var(--mt-space-4)));
}

.mt-cc-dialog::backdrop,
.mt-preinfo::backdrop {
	background: rgba(14, 19, 25, 0.55);
}

.mt-cc-dialog__form {
	display: flex;
	flex-direction: column;
	gap: var(--mt-space-4);
	margin: 0;
	padding: var(--mt-space-6);
}

.mt-cc-dialog__head,
.mt-preinfo__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--mt-space-3);
}

.mt-cc-dialog__head h2,
.mt-preinfo__head h2 {
	margin: 0;
	font-family: var(--mt-font-heading);
	font-size: var(--mt-fs-2xl);
	color: var(--mt-text-heading);
}

.mt-cc-dialog__close,
.mt-preinfo__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--mt-border-default);
	border-radius: var(--mt-radius-round);
	background: var(--mt-bg-surface);
	color: var(--mt-text-heading);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.mt-cc-dialog__intro {
	margin: 0;
	color: var(--mt-text-secondary);
	font-size: var(--mt-fs-base);
}

.mt-cc-dialog__list {
	display: grid;
	gap: var(--mt-space-3);
	margin: 0;
	padding: 0;
	list-style: none;
}

.mt-cc-cat {
	padding: var(--mt-space-4);
	border: 1px solid var(--mt-border-subtle);
	border-radius: var(--mt-radius-lg);
}

.mt-cc-cat__row {
	display: flex;
	align-items: center;
	gap: var(--mt-space-3);
}

.mt-cc-cat__label {
	flex: 1 1 auto;
	font-weight: var(--mt-fw-bold);
	color: var(--mt-text-heading);
}

.mt-cc-cat__always {
	font-size: var(--mt-fs-xs);
	font-weight: var(--mt-fw-semibold);
	color: var(--mt-success);
}

.mt-cc-cat__desc,
.mt-cc-cat__cookies {
	margin: var(--mt-space-2) 0 0;
	font-size: var(--mt-fs-sm);
	color: var(--mt-text-secondary);
}

.mt-cc-cat__cookies code {
	font-size: var(--mt-fs-xs);
	word-break: break-word;
}

/* Switch */
.mt-cc-switch {
	appearance: none;
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 24px;
	margin: 0;
	border-radius: var(--mt-radius-pill);
	background: var(--mt-gray-300);
	cursor: pointer;
	transition: background var(--mt-dur-fast);
}

.mt-cc-switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: var(--mt-radius-round);
	background: var(--mt-white);
	box-shadow: var(--mt-shadow-sm);
	transition: transform var(--mt-dur-fast);
}

.mt-cc-switch:checked {
	background: var(--mt-color-primary-strong);
}

.mt-cc-switch:checked::after {
	transform: translateX(20px);
}

.mt-cc-switch:disabled {
	cursor: not-allowed;
	opacity: 0.65;
}

.mt-cc-dialog__actions {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--mt-space-2);
}

.mt-cc-dialog__policy {
	margin: 0;
	font-size: var(--mt-fs-sm);
}

.mt-cc-dialog__policy a {
	color: var(--mt-text-link);
}

@media (max-width: 599px) {
	.mt-cc-dialog__form {
		padding: var(--mt-space-4);
	}

	.mt-cc-dialog__actions {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Checkout: Ön Bilgilendirme dialog + document button in the consent label
   ========================================================================== */

.mt-co-doc-button {
	display: inline;
	padding: 0;
	border: 0;
	background: none;
	color: var(--mt-text-link);
	font: inherit;
	font-weight: var(--mt-fw-semibold);
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.mt-co-obligation {
	margin: 0;
	padding-top: var(--mt-space-2);
	color: var(--mt-text-heading);
	font-size: var(--mt-fs-sm);
	font-weight: var(--mt-fw-semibold);
}

.mt-preinfo {
	display: none;
}

.mt-preinfo[open] {
	display: flex;
	flex-direction: column;
}

.mt-preinfo__head {
	padding: var(--mt-space-5) var(--mt-space-6);
	border-bottom: 1px solid var(--mt-border-subtle);
}

.mt-preinfo__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: var(--mt-space-4) var(--mt-space-6);
	font-size: var(--mt-fs-md);
	line-height: var(--mt-lh-relaxed);
}

.mt-preinfo__body h3 {
	margin: var(--mt-space-5) 0 var(--mt-space-2);
	padding-left: var(--mt-space-3);
	border-left: 4px solid var(--mt-color-primary);
	font-family: var(--mt-font-heading);
	font-size: var(--mt-fs-lg);
	color: var(--mt-text-heading);
}

.mt-preinfo__lead {
	margin: 0;
	color: var(--mt-text-secondary);
}

.mt-preinfo__foot {
	display: flex;
	justify-content: flex-end;
	padding: var(--mt-space-4) var(--mt-space-6);
	border-top: 1px solid var(--mt-border-subtle);
}

.mt-preinfo__foot .mt-btn {
	border-radius: var(--mt-radius-pill);
}

/* Shared document tables (dialog, order box, e-mail attachment uses its own CSS) */
.mt-ol-table {
	width: 100%;
	margin: var(--mt-space-2) 0;
	border-collapse: collapse;
	font-size: var(--mt-fs-base);
}

.mt-ol-table th,
.mt-ol-table td {
	padding: var(--mt-space-2) var(--mt-space-3);
	border: 1px solid var(--mt-border-subtle);
	text-align: left;
	vertical-align: top;
}

.mt-ol-table th {
	width: 34%;
	background: var(--mt-bg-subtle);
	color: var(--mt-text-heading);
	font-weight: var(--mt-fw-semibold);
}

.mt-ol-table thead th {
	width: auto;
}

.mt-ol-table small {
	color: var(--mt-text-secondary);
}

@media (max-width: 599px) {
	.mt-preinfo__head,
	.mt-preinfo__body,
	.mt-preinfo__foot {
		padding-inline: var(--mt-space-4);
	}

	.mt-ol-table th,
	.mt-ol-table td {
		padding: var(--mt-space-2);
		font-size: var(--mt-fs-sm);
	}
}

/* ==========================================================================
   Order received / Siparişim: siparişe özel belge
   ========================================================================== */

.mt-order-legal-box {
	margin-top: var(--mt-space-6);
	border: 1px solid var(--mt-border-subtle);
	border-radius: var(--mt-radius-xl);
	background: var(--mt-bg-surface);
}

.mt-order-legal-box > summary {
	padding: var(--mt-space-4) var(--mt-space-5);
	font-family: var(--mt-font-heading);
	font-weight: var(--mt-fw-bold);
	color: var(--mt-text-heading);
	cursor: pointer;
}

.mt-order-legal-box__body {
	max-height: 70vh;
	overflow-y: auto;
	padding: 0 var(--mt-space-5) var(--mt-space-5);
	font-size: var(--mt-fs-base);
	line-height: var(--mt-lh-relaxed);
}

.mt-order-legal-box__body h1 {
	font-size: var(--mt-fs-xl);
}

.mt-order-legal-box__body h2 {
	margin-top: var(--mt-space-5);
	padding-left: var(--mt-space-3);
	border-left: 4px solid var(--mt-color-primary);
	font-size: var(--mt-fs-lg);
}

@media print {
	.mt-cc,
	.mt-cc-dialog {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mt-cc-switch,
	.mt-cc-switch::after {
		transition: none;
	}
}

/* Checkout: always-visible pre-contract summary (Yön. m.6/2-a) */
.mt-co-presum {
	padding: var(--mt-space-3) var(--mt-space-4);
	border: 1px solid var(--mt-green-200);
	border-radius: var(--mt-radius-lg);
	background: var(--mt-bg-soft-green);
	font-size: var(--mt-fs-sm);
	color: var(--mt-text-body);
}

.mt-co-presum__title {
	margin: 0 0 var(--mt-space-1);
	font-weight: var(--mt-fw-bold);
	color: var(--mt-text-heading);
}

.mt-co-presum ul {
	margin: 0 0 var(--mt-space-2);
	padding-left: 1.1em;
}

.mt-co-presum li {
	margin-bottom: 2px;
}

.mt-co-presum strong {
	color: var(--mt-text-heading);
}
