/**
 * Cookie consent banner + modal — Riwaq theme (navy / gold).
 * Version: 1.0.0
 */

.bayyinah-cookie-banner {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 10000;
	padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0));
	background: rgba(10, 21, 32, 0.97);
	border-top: 1px solid rgba(212, 175, 55, 0.35);
	box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
	transform: translateY(110%);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	color: #f5f0e8;
	font-family: 'DM Sans', sans-serif;
}

.bayyinah-cookie-banner.is-visible {
	transform: translateY(0);
}

.bayyinah-cookie-banner__inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem 1.5rem;
}

.bayyinah-cookie-banner__title {
	font-family: 'Cormorant Garamond', serif;
	font-size: 1.25rem;
	font-weight: 700;
	color: #d4af37;
	margin-bottom: 0.35rem;
}

.bayyinah-cookie-banner__desc {
	font-size: 0.92rem;
	line-height: 1.55;
	color: rgba(245, 240, 232, 0.82);
	max-width: 52rem;
}

.bayyinah-cookie-banner__desc a {
	color: #edd97a;
	text-decoration: underline;
}

.bayyinah-cookie-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.bayyinah-cookie-btn {
	font: inherit;
	font-size: 0.875rem;
	font-weight: 500;
	padding: 0.65rem 1rem;
	border-radius: 6px;
	cursor: pointer;
	border: 1px solid transparent;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
	white-space: nowrap;
}

.bayyinah-cookie-btn--primary {
	background: #10b981;
	color: #fff;
	border-color: #10b981;
}

.bayyinah-cookie-btn--primary:hover {
	background: #0ea271;
}

.bayyinah-cookie-btn--outline {
	background: transparent;
	color: #f5f0e8;
	border-color: rgba(212, 175, 55, 0.45);
}

.bayyinah-cookie-btn--outline:hover {
	border-color: #d4af37;
	color: #edd97a;
}

.bayyinah-cookie-btn--ghost {
	background: transparent;
	color: rgba(245, 240, 232, 0.75);
	border-color: transparent;
}

.bayyinah-cookie-btn--ghost:hover {
	color: #f5f0e8;
}

/* Modal */
.bayyinah-cookie-modal {
	position: fixed;
	inset: 0;
	z-index: 10001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.bayyinah-cookie-modal:not(.is-open) {
	pointer-events: none;
}

.bayyinah-cookie-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
	opacity: 0;
	transition: opacity 0.25s;
}

.bayyinah-cookie-modal.is-open .bayyinah-cookie-modal__overlay {
	opacity: 1;
}

.bayyinah-cookie-modal__panel {
	position: relative;
	width: min(100%, 520px);
	max-height: min(90vh, 640px);
	overflow: auto;
	background: #0f1e2e;
	border: 1px solid rgba(212, 175, 55, 0.3);
	border-radius: 10px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
	color: #f5f0e8;
	transform: translateY(12px) scale(0.98);
	opacity: 0;
	transition: transform 0.25s, opacity 0.25s;
}

.bayyinah-cookie-modal.is-open .bayyinah-cookie-modal__panel {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.bayyinah-cookie-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.1rem 1.25rem;
	border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.bayyinah-cookie-modal__header h2 {
	font-family: 'Cormorant Garamond', serif;
	font-size: 1.35rem;
	font-weight: 700;
	color: #d4af37;
	margin: 0;
}

.bayyinah-cookie-modal__close {
	background: none;
	border: none;
	color: rgba(245, 240, 232, 0.7);
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
}

.bayyinah-cookie-modal__close:hover {
	color: #f5f0e8;
}

.bayyinah-cookie-modal__body {
	padding: 1rem 1.25rem;
}

.bayyinah-cookie-pref {
	padding: 0.85rem 0;
	border-bottom: 1px solid rgba(245, 240, 232, 0.1);
}

.bayyinah-cookie-pref:last-of-type {
	border-bottom: none;
}

.bayyinah-cookie-pref h3 {
	font-size: 0.95rem;
	font-weight: 600;
	margin-bottom: 0.25rem;
}

.bayyinah-cookie-pref p {
	font-size: 0.85rem;
	line-height: 1.5;
	color: rgba(245, 240, 232, 0.72);
}

.bayyinah-cookie-pref__row {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	justify-content: space-between;
}

.bayyinah-cookie-pref__badge {
	flex-shrink: 0;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #10b981;
	padding: 0.35rem 0.55rem;
	border: 1px solid rgba(16, 185, 129, 0.4);
	border-radius: 4px;
}

.bayyinah-cookie-modal__legal {
	margin-top: 1rem;
	font-size: 0.8rem;
	line-height: 1.55;
	color: rgba(245, 240, 232, 0.65);
}

.bayyinah-cookie-modal__legal a {
	color: #edd97a;
}

.bayyinah-cookie-modal__footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.5rem;
	padding: 1rem 1.25rem;
	border-top: 1px solid rgba(212, 175, 55, 0.2);
}

/* Toggle switch */
.bayyinah-cookie-toggle {
	position: relative;
	flex-shrink: 0;
	width: 48px;
	height: 26px;
	cursor: pointer;
}

.bayyinah-cookie-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.bayyinah-cookie-toggle__slider {
	position: absolute;
	inset: 0;
	background: rgba(245, 240, 232, 0.2);
	border-radius: 999px;
	transition: background 0.2s;
}

.bayyinah-cookie-toggle__slider::before {
	content: '';
	position: absolute;
	width: 20px;
	height: 20px;
	left: 3px;
	top: 3px;
	background: #f5f0e8;
	border-radius: 50%;
	transition: transform 0.2s;
}

.bayyinah-cookie-toggle input:checked + .bayyinah-cookie-toggle__slider {
	background: #10b981;
}

.bayyinah-cookie-toggle input:checked + .bayyinah-cookie-toggle__slider::before {
	transform: translateX(22px);
}

.bayyinah-cookie-toggle input:focus-visible + .bayyinah-cookie-toggle__slider {
	outline: 2px solid #d4af37;
	outline-offset: 2px;
}

body.bayyinah-cookie-modal-open {
	overflow: hidden;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 640px) {
	.bayyinah-cookie-banner__actions {
		width: 100%;
		flex-direction: column;
		align-items: stretch;
	}

	.bayyinah-cookie-btn {
		width: 100%;
		text-align: center;
	}
}
