/* ============================================================
   KK Popups — Frontend Styles
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────────── */
.kk-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 999990;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	pointer-events: none;
}
.kk-popup-overlay.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* ── Base Popup ──────────────────────────────────────────────── */
.kk-popup {
	position: fixed;
	z-index: 999991;
	background: var(--kk-pu-bg, #fff);
	color: var(--kk-pu-text, #3a3a3a);
	border-radius: var(--kk-pu-radius, 12px);
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s ease;
	pointer-events: none;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	box-sizing: border-box;
}
.kk-popup.kk-popup--visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.kk-popup__inner {
	position: relative;
	padding: 24px 28px;
}

/* ── Close Button ────────────────────────────────────────────── */
.kk-popup__close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	font-size: 22px;
	line-height: 1;
	color: var(--kk-pu-text, #3a3a3a);
	opacity: 0.5;
	cursor: pointer;
	border-radius: 50%;
	transition: opacity 0.2s, background 0.2s;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.kk-popup__close:hover {
	opacity: 1;
	background: rgba(0, 0, 0, 0.06);
}

/* ── Content ─────────────────────────────────────────────────── */
.kk-popup__content {
	line-height: 1.6;
	font-size: 15px;
}
.kk-popup__content p:last-child {
	margin-bottom: 0;
}
.kk-popup__content h1,
.kk-popup__content h2,
.kk-popup__content h3 {
	margin-top: 0;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.kk-popup__buttons {
	display: flex;
	gap: 10px;
	margin-top: 18px;
	flex-wrap: wrap;
}
.kk-popup__btn {
	padding: 10px 22px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s, transform 0.1s;
	white-space: nowrap;
	line-height: 1.3;
}
.kk-popup__btn:active {
	transform: scale(0.97);
}

/* Primary */
.kk-popup__btn--primary {
	background: var(--kk-pu-btn-bg, #5a4630);
	color: var(--kk-pu-btn-text, #fff);
	border: 2px solid var(--kk-pu-btn-bg, #5a4630);
}
.kk-popup__btn--primary:hover {
	opacity: 0.9;
}

/* Secondary */
.kk-popup__btn--secondary {
	background: transparent;
	color: var(--kk-pu-btn-bg, #5a4630);
	border: 2px solid var(--kk-pu-btn-bg, #5a4630);
}
.kk-popup__btn--secondary:hover {
	background: var(--kk-pu-btn-bg, #5a4630);
	color: var(--kk-pu-btn-text, #fff);
}

/* Link */
.kk-popup__btn--link {
	background: none;
	border: none;
	color: var(--kk-pu-btn-bg, #5a4630);
	padding: 10px 8px;
	text-decoration: underline;
}
.kk-popup__btn--link:hover {
	opacity: 0.7;
}

/* =============================================================
   Position Variants
   ============================================================= */

/* ── Center Modal ────────────────────────────────────────────── */
.kk-popup--center-modal {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.94);
	max-width: var(--kk-pu-max-w, 600px);
	width: 92%;
}
.kk-popup--center-modal.kk-popup--visible {
	transform: translate(-50%, -50%) scale(1);
}

/* ── Bottom Bar ──────────────────────────────────────────────── */
.kk-popup--bottom-bar {
	bottom: 0;
	left: 0;
	right: 0;
	border-radius: 0;
	transform: translateY(100%);
}
.kk-popup--bottom-bar.kk-popup--visible {
	transform: translateY(0);
}
.kk-popup--bottom-bar .kk-popup__inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 24px;
}
.kk-popup--bottom-bar .kk-popup__content {
	flex: 1;
}
.kk-popup--bottom-bar .kk-popup__buttons {
	margin-top: 0;
	flex-shrink: 0;
}

/* ── Top Bar ─────────────────────────────────────────────────── */
.kk-popup--top-bar {
	top: 0;
	left: 0;
	right: 0;
	border-radius: 0;
	transform: translateY(-100%);
}
.kk-popup--top-bar.kk-popup--visible {
	transform: translateY(0);
}
.kk-popup--top-bar .kk-popup__inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 24px;
}
.kk-popup--top-bar .kk-popup__content {
	flex: 1;
}
.kk-popup--top-bar .kk-popup__buttons {
	margin-top: 0;
	flex-shrink: 0;
}

/* ── Bottom Left ─────────────────────────────────────────────── */
.kk-popup--bottom-left {
	bottom: 20px;
	left: 20px;
	max-width: var(--kk-pu-max-w, 420px);
	width: 92%;
	transform: translateY(20px);
}
.kk-popup--bottom-left.kk-popup--visible {
	transform: translateY(0);
}

/* ── Bottom Right ────────────────────────────────────────────── */
.kk-popup--bottom-right {
	bottom: 20px;
	right: 20px;
	max-width: var(--kk-pu-max-w, 420px);
	width: 92%;
	transform: translateY(20px);
}
.kk-popup--bottom-right.kk-popup--visible {
	transform: translateY(0);
}

/* ── Slide-in Right ──────────────────────────────────────────── */
.kk-popup--slide-in-right {
	top: 0;
	right: 0;
	bottom: 0;
	max-width: var(--kk-pu-max-w, 420px);
	width: 92%;
	border-radius: 0;
	transform: translateX(100%);
}
.kk-popup--slide-in-right.kk-popup--visible {
	transform: translateX(0);
}
.kk-popup--slide-in-right .kk-popup__inner {
	height: 100%;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}
.kk-popup--slide-in-right .kk-popup__content {
	flex: 1;
}

/* =============================================================
   Cookie Consent — branded card layout
   ============================================================= */

/* Header: text + icon side by side */
.kk-popup__cookie-header {
	display: flex;
	align-items: flex-start;
	gap: 16px;
}
.kk-popup__cookie-text {
	flex: 1;
	min-width: 0;
}
.kk-popup__cookie-title {
	font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 8px 0;
	color: var(--kk-pu-text, #3a3a3a);
	line-height: 1.3;
}
.kk-popup__cookie-icon {
	flex-shrink: 0;
	color: var(--kk-pu-btn-bg, #5a4630);
	margin-top: 2px;
}

/* Cookie consent content — slightly smaller, muted */
.kk-popup--cookie-consent .kk-popup__content {
	font-size: 14px;
	line-height: 1.55;
	color: var(--kk-pu-text, #444);
}
.kk-popup--cookie-consent .kk-popup__content p {
	margin: 0;
}
.kk-popup--cookie-consent .kk-popup__content a {
	color: var(--kk-pu-btn-bg, #5a4630);
	text-decoration: underline;
}
.kk-popup--cookie-consent .kk-popup__content a:hover {
	opacity: 0.7;
}

/* Cookie consent buttons — all equal width outline style matching screenshot */
.kk-popup--cookie-consent .kk-popup__buttons {
	gap: 10px;
}
.kk-popup--cookie-consent .kk-popup__btn {
	flex: 1;
	text-align: center;
	padding: 11px 20px;
	border-radius: 6px;
	font-size: 14px;
}

/* Bottom-left card position (matching screenshot) */
.kk-popup--cookie-consent.kk-popup--bottom-left {
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.14);
	border: 1px solid rgba(0, 0, 0, 0.08);
}

/* When cookie consent is a bar, keep horizontal layout */
.kk-popup--cookie-consent.kk-popup--bottom-bar .kk-popup__inner,
.kk-popup--cookie-consent.kk-popup--top-bar .kk-popup__inner {
	display: flex;
	align-items: center;
	gap: 24px;
}
.kk-popup--cookie-consent.kk-popup--bottom-bar .kk-popup__cookie-header,
.kk-popup--cookie-consent.kk-popup--top-bar .kk-popup__cookie-header {
	flex: 1;
}
.kk-popup--cookie-consent.kk-popup--bottom-bar .kk-popup__buttons,
.kk-popup--cookie-consent.kk-popup--top-bar .kk-popup__buttons {
	margin-top: 0;
	flex-shrink: 0;
}

/* ── Body scroll lock ────────────────────────────────────────── */
body.kk-popup-open {
	overflow: hidden;
}

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 768px) {
	/* Corner popups become full-width bottom bars */
	.kk-popup--bottom-left,
	.kk-popup--bottom-right {
		left: 0;
		right: 0;
		bottom: 0;
		max-width: none;
		width: 100%;
		border-radius: 12px 12px 0 0;
		transform: translateY(100%);
	}
	.kk-popup--bottom-left.kk-popup--visible,
	.kk-popup--bottom-right.kk-popup--visible {
		transform: translateY(0);
	}

	/* Slide-in becomes bottom panel */
	.kk-popup--slide-in-right {
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		max-width: none;
		width: 100%;
		max-height: 80vh;
		border-radius: 12px 12px 0 0;
		transform: translateY(100%);
	}
	.kk-popup--slide-in-right.kk-popup--visible {
		transform: translateY(0);
	}

	/* Center modal gets wider */
	.kk-popup--center-modal {
		width: 95%;
	}

	/* Bars stack vertically */
	.kk-popup--bottom-bar .kk-popup__inner,
	.kk-popup--top-bar .kk-popup__inner {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
	}
	.kk-popup--bottom-bar .kk-popup__buttons,
	.kk-popup--top-bar .kk-popup__buttons {
		justify-content: stretch;
	}
	.kk-popup--bottom-bar .kk-popup__btn,
	.kk-popup--top-bar .kk-popup__btn {
		flex: 1;
		text-align: center;
	}

	.kk-popup__inner {
		padding: 18px 20px;
	}

	/* Cookie consent: stack vertically on mobile */
	.kk-popup--cookie-consent.kk-popup--bottom-bar .kk-popup__inner,
	.kk-popup--cookie-consent.kk-popup--top-bar .kk-popup__inner {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
	}
	.kk-popup--cookie-consent.kk-popup--bottom-bar .kk-popup__buttons,
	.kk-popup--cookie-consent.kk-popup--top-bar .kk-popup__buttons {
		margin-top: 0;
	}
	.kk-popup__cookie-icon svg {
		width: 36px;
		height: 36px;
	}

	/* Prefs modal responsive */
	.kk-cookie-prefs__panel {
		width: 95% !important;
		max-height: 90vh;
		margin: 5vh auto;
	}
}

/* =============================================================
   Cookie Preferences Modal
   ============================================================= */
.kk-cookie-prefs {
	position: fixed;
	inset: 0;
	z-index: 999995;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}
.kk-cookie-prefs.is-open {
	opacity: 1;
	visibility: visible;
}

.kk-cookie-prefs__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

.kk-cookie-prefs__panel {
	position: relative;
	background: #fff;
	border-radius: 14px;
	width: 540px;
	max-width: 92vw;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	transform: translateY(20px) scale(0.96);
	transition: transform 0.3s ease;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	overflow: hidden;
}
.kk-cookie-prefs.is-open .kk-cookie-prefs__panel {
	transform: translateY(0) scale(1);
}

/* Header */
.kk-cookie-prefs__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 28px 18px;
	border-bottom: 1px solid #eee;
	flex-shrink: 0;
}
.kk-cookie-prefs__title {
	font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
	font-size: 20px;
	font-weight: 700;
	color: #3a3a3a;
	margin: 0;
}
.kk-cookie-prefs__close {
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	font-size: 22px;
	color: #666;
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
	padding: 0;
	flex-shrink: 0;
}
.kk-cookie-prefs__close:hover {
	background: rgba(0, 0, 0, 0.06);
	color: #333;
}

/* Body */
.kk-cookie-prefs__body {
	padding: 20px 28px;
	overflow-y: auto;
	flex: 1;
}
.kk-cookie-prefs__intro {
	font-size: 14px;
	line-height: 1.6;
	color: #555;
	margin: 0 0 20px 0;
}
.kk-cookie-prefs__intro a {
	color: #5a4630;
	text-decoration: underline;
}

/* Category rows */
.kk-cookie-prefs__category {
	border: 1px solid #eee;
	border-radius: 10px;
	padding: 16px 20px;
	margin-bottom: 12px;
	transition: border-color 0.2s;
}
.kk-cookie-prefs__category:hover {
	border-color: #ddd;
}
.kk-cookie-prefs__category:last-child {
	margin-bottom: 0;
}
.kk-cookie-prefs__cat-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}
.kk-cookie-prefs__cat-info {
	flex: 1;
	min-width: 0;
}
.kk-cookie-prefs__cat-title {
	font-size: 15px;
	font-weight: 700;
	color: #3a3a3a;
	margin: 0 0 4px 0;
}
.kk-cookie-prefs__cat-desc {
	font-size: 13px;
	line-height: 1.5;
	color: #777;
	margin: 0;
}

/* Toggle */
.kk-cookie-prefs__toggle {
	flex-shrink: 0;
	padding-top: 2px;
}
.kk-cookie-prefs__always-on {
	font-size: 12px;
	font-weight: 600;
	color: #2e7d32;
	background: #e8f5e9;
	padding: 4px 10px;
	border-radius: 12px;
	white-space: nowrap;
}

/* Toggle switch */
.kk-cookie-prefs__switch {
	position: relative;
	display: inline-block;
	width: 48px;
	height: 26px;
	cursor: pointer;
}
.kk-cookie-prefs__switch input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}
.kk-cookie-prefs__slider {
	position: absolute;
	inset: 0;
	background: #ccc;
	border-radius: 26px;
	transition: background 0.25s ease;
}
.kk-cookie-prefs__slider::before {
	content: '';
	position: absolute;
	width: 20px;
	height: 20px;
	left: 3px;
	bottom: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.25s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.kk-cookie-prefs__switch input:checked + .kk-cookie-prefs__slider {
	background: #5a4630;
}
.kk-cookie-prefs__switch input:checked + .kk-cookie-prefs__slider::before {
	transform: translateX(22px);
}

/* Footer */
.kk-cookie-prefs__footer {
	display: flex;
	gap: 10px;
	padding: 18px 28px;
	border-top: 1px solid #eee;
	flex-shrink: 0;
}
.kk-cookie-prefs__btn {
	flex: 1;
	padding: 11px 20px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s, transform 0.1s;
	text-align: center;
	line-height: 1.3;
}
.kk-cookie-prefs__btn:active {
	transform: scale(0.97);
}
.kk-cookie-prefs__btn--primary {
	background: #5a4630;
	color: #fff;
	border: 2px solid #5a4630;
}
.kk-cookie-prefs__btn--primary:hover {
	opacity: 0.9;
}
.kk-cookie-prefs__btn--secondary {
	background: transparent;
	color: #5a4630;
	border: 2px solid #5a4630;
}
.kk-cookie-prefs__btn--secondary:hover {
	background: #5a4630;
	color: #fff;
}
