/* =========================================================================
   TOUBKAL-MAROC — mobile UI
   Header menu, off-canvas nav, floating call/WhatsApp, sticky tour booking
   bar, touch-target + content polish. Site-wide; loaded after header.css.
   ========================================================================= */

/* Shared tokens (ink, line, accent, cream) are defined in style.css :root. */

/* ---- Header: hamburger + language ------------------------------------- */

.tbk-nav-toggle {
	display: none;
	order: 9;
	width: 44px;
	height: 44px;
	margin-left: 0.5rem;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	flex: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	-webkit-tap-highlight-color: transparent;
}

.tbk-nav-toggle span {
	display: block;
	width: 22px;
	height: 2px;
	border-radius: 2px;
	background: var(--tbk-ink);
	transition: background 0.2s ease;
}

.tbk-nav-toggle:hover span {
	background: var(--tbk-accent);
}

@media (max-width: 991px) {
	.tbk-nav-toggle {
		display: flex;
	}

	/* Currency + language live in the off-canvas menu on mobile. */
	#nav-menu > #nav-lang,
	#nav-menu > #currency-switch {
		display: none !important;
	}
}

@media (max-width: 767px) {
	#nav-menu > #nav-contact {
		display: none !important;
	}
}

/* ---- Off-canvas navigation -------------------------------------------- */

.tbk-nav {
	position: fixed;
	inset: 0;
	z-index: 3000;
	font-family: "Ubuntu", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.tbk-nav[hidden] {
	display: none;
}

.tbk-nav__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(var(--tbk-ink-rgb), 0.5);
	opacity: 0;
	animation: tbkFade 0.25s ease forwards;
}

@keyframes tbkFade {
	to { opacity: 1; }
}

.tbk-nav__panel {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: min(360px, 86vw);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 74px 24px calc(24px + env(safe-area-inset-bottom));
	background: #fff;
	box-shadow: -20px 0 50px rgba(0, 0, 0, 0.22);
	overflow-y: auto;
	transform: translateX(100%);
	animation: tbkNavIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes tbkNavIn {
	to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
	.tbk-nav__panel { animation: none; transform: none; }
	.tbk-nav__backdrop { animation: none; opacity: 1; }
}

.tbk-nav__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--tbk-ink);
	cursor: pointer;
}

.tbk-nav__close:hover {
	background: var(--tbk-cream);
}

.tbk-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.tbk-nav__list a {
	display: flex;
	align-items: center;
	min-height: 54px;
	padding: 0 2px;
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--tbk-ink);
	text-decoration: none;
	border-bottom: 1px solid var(--tbk-line);
	-webkit-tap-highlight-color: transparent;
}

.tbk-nav__list a:hover {
	color: var(--tbk-accent);
}

.tbk-nav__lang {
	display: flex;
	gap: 8px;
}

.tbk-nav__lang-link {
	flex: 1;
	text-align: center;
	min-height: 46px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--tbk-line);
	border-radius: 10px;
	font-weight: 700;
	color: var(--tbk-ink);
	text-decoration: none;
}

.tbk-nav__lang-link.is-current {
	background: var(--tbk-cream);
	color: var(--tbk-accent);
	border-color: transparent;
}

/* Currency accordion (off-canvas menu) */
.tbk-nav__acc {
	flex: 0 0 auto;
	border: 1px solid var(--tbk-line);
	border-radius: 12px;
	overflow: hidden;
}

.tbk-nav__acc-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 50px;
	padding: 0 16px;
	background: transparent;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	color: var(--tbk-ink);
	text-align: left;
}

.tbk-nav__acc-label {
	flex: 1;
}

.tbk-nav__acc-value {
	font-weight: 800;
	color: var(--tbk-accent);
}

.tbk-nav__acc-chev {
	flex: none;
	color: var(--tbk-ink-soft);
	transition: transform 0.2s ease;
}

.tbk-nav__acc.is-open .tbk-nav__acc-chev {
	transform: rotate(180deg);
}

.tbk-nav__acc-panel {
	display: flex;
	flex-direction: column;
	padding: 0 8px;
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	transition: max-height 0.34s ease, opacity 0.26s ease, padding 0.34s ease;
}

.tbk-nav__acc.is-open .tbk-nav__acc-panel {
	max-height: 480px;
	opacity: 1;
	padding-bottom: 8px;
}

.tbk-nav__cur {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 44px;
	padding: 0 10px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--tbk-ink);
	font-weight: 600;
}

.tbk-nav__cur:hover {
	background: var(--tbk-cream);
}

.tbk-nav__cur.is-current {
	background: var(--tbk-accent-soft, rgba(var(--tbk-primary-rgb), 0.12));
	color: var(--tbk-accent-dark);
}

.tbk-nav__cur-sym {
	color: var(--tbk-ink-soft);
	font-weight: 500;
}

.tbk-nav__actions {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-top: 8px;
}

/* Keep the panel items from being shrunk by the flex column. */
.tbk-nav__list,
.tbk-nav__lang,
.tbk-nav__acc,
.tbk-nav__actions {
	flex: 0 0 auto;
}

.tbk-nav__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	border-radius: 9999px;
	background: var(--tbk-accent);
	color: #fff;
	font-weight: 800;
	text-decoration: none;
}

.tbk-nav__cta:hover {
	background: var(--tbk-accent-dark);
}

.tbk-nav__row {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 50px;
	color: var(--tbk-ink);
	font-weight: 600;
	text-decoration: none;
}

.tbk-nav__row-ic {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex: none;
	border-radius: 50%;
	background: var(--tbk-cream);
	color: var(--tbk-accent);
}

html.tbk-nav-open {
	overflow: hidden;
}

/* ---- Sticky tour booking bar ------------------------------------------ */

.tbk-tour-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 900;
	display: none;
	align-items: center;
	gap: 45px;
	padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
	background: #fff;
	border-top: 1px solid var(--tbk-line);
	box-shadow: 0 -6px 20px rgba(var(--tbk-ink-rgb), 0.08);
	transform: translateY(110%);
	transition: transform 0.25s ease;
}

@media (max-width: 991px) {
	.tbk-tour-bar {
		display: flex;
	}

	body.single-product {
		padding-bottom: 78px;
	}
}

.tbk-tour-bar.is-visible {
	transform: translateY(0);
}

.tbk-tour-bar__meta {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.tbk-tour-bar__label {
	font-size: 12px;
	font-weight: 600;
	color: var(--tbk-ink-soft);
}

.tbk-tour-bar__price {
	font-size: 19px;
	font-weight: 800;
	color: var(--tbk-ink);
}

.tbk-tour-bar__btn {
	flex: 1;
	min-height: 50px;
	border: 0;
	border-radius: 9999px;
	background: linear-gradient(92.83deg, var(--tbk-accent) 0, var(--tbk-accent-dark) 100%);
	color: #fff;
	font-family: "Ubuntu", sans-serif;
	font-weight: 800;
	font-size: 16px;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	text-align: center;
}

/* ---- Touch targets / polish ------------------------------------------- */

@media (max-width: 991px) {
	#lang-toggle,
	#currency-switch .yith-wcmcs-selected-currency {
		min-height: 44px;
		display: inline-flex;
		align-items: center;
	}

	.tbk-tour-reviews__nav,
	.tbk-tour-info__nav {
		width: 46px;
		height: 46px;
	}

	a,
	button {
		-webkit-tap-highlight-color: transparent;
	}
}

/* ---- Programme: collapsible days (small screens) ---------------------- */

@media (max-width: 991px) {
	.tbk-day .tl-desc,
	.tbk-day .tl-img {
		display: none;
	}

	.tbk-day.is-open .tl-desc,
	.tbk-day.is-open .tl-img {
		display: block;
	}

	.tbk-day .tl-day,
	.tbk-day .tl-title {
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}

	.tbk-day .tl-title {
		position: relative;
		padding-right: 34px;
	}

	.tbk-day .tl-title::after {
		content: "";
		position: absolute;
		right: 8px;
		top: 50%;
		width: 10px;
		height: 10px;
		border-right: 2px solid var(--tbk-accent);
		border-bottom: 2px solid var(--tbk-accent);
		transform: translateY(-70%) rotate(45deg);
		transition: transform 0.2s ease;
	}

	.tbk-day.is-open .tl-title::after {
		transform: translateY(-30%) rotate(-135deg);
	}
}

/* ---- Currency switch: normalise YITH's tall box (fixes header height) -- */

#currency-switch,
#currency-switch .yith-wcmcs-shortcode,
#currency-switch .yith-wcmcs-currency-list {
	height: auto !important;
	margin: 0 !important;
}

#currency-switch .yith-wcmcs-currency-list {
	padding: 0 !important;
}

#currency-switch {
	display: flex;
	align-items: center;
}

/* Keep the header pinned on small screens (no auto-hide jump). */
@media (max-width: 991px) {
	#site-header.tbk-header--hidden {
		transform: translateY(0);
	}
}

/* ---- Booking drawer (single tour, small screens) ---------------------- */

.tbk-drawer-backdrop {
	position: fixed;
	inset: 0;
	z-index: 1999;
	background: rgba(var(--tbk-ink-rgb), 0.5);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

html.tbk-drawer-open .tbk-drawer-backdrop {
	opacity: 1;
	visibility: visible;
}

.tbk-drawer__bar {
	display: none;
	position: relative;
	align-items: center;
	justify-content: center;
	align-self: stretch;
	width: 100%;
	padding: 4px 0 10px;
}

.tbk-drawer__grip {
	width: 44px;
	height: 4px;
	border-radius: 9999px;
	background: rgba(var(--tbk-ink-rgb), 0.2);
}

.tbk-drawer__close {
	position: absolute;
	right: 0;
	top: -4px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--tbk-ink);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.tbk-drawer__close:hover {
	background: var(--tbk-cream);
}

@media (max-width: 991px) {
	.tbk-drawer__bar {
		display: flex;
	}

	#tour-booking-card.tbk-drawer {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		top: auto;
		z-index: 2000;
		margin: 0;
		align-items: stretch;
		flex-direction: column;
		flex-wrap: nowrap;
		max-height: 92vh;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		background: #fff;
		border-radius: 20px 20px 0 0;
		box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.3);
		padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
		transform: translateY(102%);
		visibility: hidden;
		transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.32s ease;
	}

	html.tbk-drawer-open #tour-booking-card.tbk-drawer {
		transform: none;
		visibility: visible;
	}

	html.tbk-drawer-open {
		overflow: hidden;
	}
}
