/**
 * Tour Packages archive: hero banner + tour grid.
 * The grid itself reuses .tour-related__* classes from tour-single.css
 * (enqueued alongside this file) rather than duplicating that CSS.
 */

/* .site-header-custom (western-style.css, site-wide) is normally
   position:sticky — un-stuck here, scoped to this one archive page only
   via WordPress's own body class, because a sticky header stacked with the
   sticky .tour-archive-filter-bar below it (see further down) didn't work
   together. Two-class selector beats that single-class rule on specificity
   regardless of stylesheet load order, without editing western-style.css
   itself. Matches .tour-archive-filter-bar's own min-width:1024px sticky
   breakpoint below — under that width the filter bar isn't sticky either,
   so there's nothing for the header to conflict with and it stays sticky
   as normal.

   position:relative (not static): the "Tour Packages" mega menu
   (.western-tour-mega, western-style.css) is deliberately positioned
   "top:100%" of its nearest positioned ancestor — normally the sticky
   header itself — rather than of the <li> it lives in, so the wide panel
   can stay centered under the nav regardless of where that link sits.
   static removes the header as a positioning context entirely, so on
   this one page the panel fell through to <body> instead (thousands of
   pixels tall) and rendered far below the fold, i.e. never visibly
   opened. relative keeps the exact same "not stuck to scroll" layout
   (no top/left offset is set, so it's visually identical to static) but
   still anchors the mega menu correctly. */
@media ( min-width: 1024px ) {
	.post-type-archive-tour-packages .site-header-custom {
		position: relative;
	}
}

.tour-archive-banner {
	position: relative;
	min-height: 320px;
	display: flex;
	align-items: center;
	color: #fff;
	--section-overlay-color: #101b3d;
	--section-overlay-opacity: 0.6;
}

.tour-archive-banner--no-image {
	background: linear-gradient(135deg, #1a2350, #3a3b61);
}

.tour-archive-banner__inner {
	position: relative;
	z-index: 1;
	padding: 64px 20px;
}

.tour-archive-banner__badge {
	display: inline-flex;
	align-items: center;
	padding: 7px 18px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin-bottom: 20px;
}

.tour-archive-banner__title {
	font-size: clamp(1.9rem, 4.5vw, 2.8rem);
	font-weight: 800;
	line-height: 1.15;
	margin: 0 0 12px;
	color: #fff;
}

.tour-archive-banner__subtitle {
	font-size: 1rem;
	max-width: 620px;
	margin: 0;
	color: rgba(255, 255, 255, 0.85);
}

/* The grid's own responsive column counts (1 / 2 / 4) already come from
   .tour-related__grid in tour-single.css, enqueued alongside this file —
   no need to redefine them here. */
.tour-archive-grid-section {
	padding: 48px 0 64px;
}

/* Results container the filter bar's AJAX call (see
   assets/js/tour-archive-filters.js) swaps the innerHTML of. The opacity
   dip is the only thing JS toggles directly (.is-loading); the card
   reveal below plays automatically since replaced cards are fresh DOM
   nodes. */
.tour-archive-results {
	transition: opacity 0.2s ease;
}

.tour-archive-results.is-loading {
	opacity: 0.45;
}

@keyframes tourArchiveCardReveal {
	from {
		opacity: 0;
		transform: translateY(22px) scale(0.97);
	}
	60% {
		opacity: 1;
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.tour-archive-results .tour-archive-card {
	animation: tourArchiveCardReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tour-archive-results .tour-related__grid > *:nth-child(1) { animation-delay: 0ms; }
.tour-archive-results .tour-related__grid > *:nth-child(2) { animation-delay: 90ms; }
.tour-archive-results .tour-related__grid > *:nth-child(3) { animation-delay: 180ms; }
.tour-archive-results .tour-related__grid > *:nth-child(4) { animation-delay: 270ms; }
.tour-archive-results .tour-related__grid > *:nth-child(n+5) { animation-delay: 340ms; }

@media (prefers-reduced-motion: reduce) {
	.tour-archive-results .tour-archive-card {
		animation: none;
	}
}

/* -------------------------------------------------- */
/* Filter bar                                          */
/* -------------------------------------------------- */

.tour-archive-filter-bar {
	--tour-archive-accent: #e0793c;
	--tour-archive-ink: #1a1a1a;
	--tour-archive-line: #e2e2e2;
	--tour-archive-track: #e2e2e2;
	--tour-archive-radius: 10px;
}

.tour-archive-filter-bar__form {
	max-width: 100%;
	margin: -32px auto 0;
	position: relative;
	z-index: 2;
	background: #fff;
	border: 1px solid #E5E7EB;
	border-radius: 24px;
	padding: 24px 28px;
	box-shadow: 0 5px 15px rgba( 20, 30, 45, 0.05);
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 20px 24px;
}

@media ( min-width: 1024px ) {
	.tour-archive-filter-bar {
		position: sticky;
		top:-50px;
		z-index: 500;
	}
}

.tour-archive-filter-bar__field {
	display: flex;
	flex-direction: column;
	flex: 1 1 150px;
	min-width: 150px;
}

.tour-archive-filter-bar__field--search {
	flex: 2 1 220px;
	min-width: 220px;
}

.tour-archive-filter-bar__field--price {
	flex: 1 1 180px;
	min-width: 180px;
}

.tour-archive-filter-bar__field label {
	font-weight: 700;
	font-size: 0.85rem;
	color: var( --tour-archive-ink );
	margin-bottom: 8px;
}

.tour-archive-filter-bar__field--price label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.tour-archive-filter-bar__price-value {
	color: var( --tour-archive-accent );
	font-weight: 700;
}

.tour-archive-filter-bar select,
.tour-archive-filter-bar input[type="text"] {
	width: 100%;
	padding: 12px 10px;
	border: 1px solid #E5E7EB;
	border-radius: var( --tour-archive-radius );
	font-size: 0.9rem;
	color: var( --tour-archive-ink );
	background: #fff;text-transform:capitalize;
}
.tour-archive-filter-bar select{-webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cpath fill='black' d='m25 32.4l-9.7-9.7l1.4-1.4l8.3 8.3l8.3-8.3l1.4 1.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 5px center;
    padding-right: 0px;
    background-size: 24px;}
.tour-archive-filter-bar select:focus,
.tour-archive-filter-bar input[type="text"]:focus {
	outline: none;
	border-color: var( --tour-archive-accent );
}

.tour-archive-filter-bar__input-icon {
	position: relative;
	display: flex;
	align-items: center;
}

.tour-archive-filter-bar__input-icon svg {
	position: absolute;
	left: 14px;
	color: #9aa0a6;
	pointer-events: none;
}

.tour-archive-filter-bar__input-icon input[type="text"] {
	padding-left: 42px;
}

/* Custom country-suggestions dropdown for the search box (see
   tour-archive-filters.js) — positioned relative to .input-icon, which
   already wraps just the input itself, so it matches the input's exact
   width regardless of the field's own width at any breakpoint. */
.tour-archive-search-suggestions {
	position: absolute;
	top: calc( 100% + 6px );
	left: 0;
	right: 0;
	z-index: 20;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid var( --tour-archive-line );
	border-radius: var( --tour-archive-radius );
	box-shadow: 0 12px 28px rgba( 20, 30, 45, 0.14 );
	max-height: 240px;
	overflow-y: auto;
}

.tour-archive-search-suggestions[hidden] {
	display: none;
}

.tour-archive-search-suggestions__item {
	padding: 10px 12px;
	border-radius: calc( var( --tour-archive-radius ) - 4px );
	font-size: 0.9rem;
	color: var( --tour-archive-ink );
	cursor: pointer;
	text-transform: capitalize;
}

.tour-archive-search-suggestions__item mark {
	background: none;
	color: var( --tour-archive-accent );
	font-weight: 700;
}

.tour-archive-search-suggestions__item:hover,
.tour-archive-search-suggestions__item.is-active {
	background: var( --tour-archive-line );
}

.tour-archive-filter-bar input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 6px;
	border-radius: 999px;
	background: var( --tour-archive-track );
	outline: none;
	margin-top: 4px;
	padding: 7px 0;
}

.tour-archive-filter-bar input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var( --tour-archive-accent );
	border: 3px solid #fff;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.35 );
	cursor: pointer;
}

.tour-archive-filter-bar input[type="range"]::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var( --tour-archive-accent );
	border: 3px solid #fff;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.35 );
	cursor: pointer;
}

.tour-archive-filter-bar input[type="range"]::-moz-range-track {
	background: transparent;
}

.tour-archive-filter-bar__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 26px;
	border: none;
	border-radius: var( --tour-archive-radius );
	background: var( --tour-archive-accent );
	color: #fff;
	font-weight: 700;
	font-size: 0.92rem;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
	white-space: nowrap;
}

.tour-archive-filter-bar__submit:hover,
.tour-archive-filter-bar__submit:focus-visible {
	background: var( --tour-accent-dark, #c85f27 );
}

/* Popup toggle/close/backdrop only ever apply for JS-enabled visitors on
   the sub-575px layout below — a synchronous inline script in
   filter-bar.php adds .has-js to .tour-archive-filter-bar before the
   browser paints. Without it (JS disabled/blocked) the form stays exactly
   as it always rendered: a plain stacked block, no popup, no toggle button
   that could otherwise never be opened. */
.tour-archive-filter-bar__toggle,
.tour-archive-filter-bar__popup-header,
.tour-archive-filter-bar__backdrop {
	display: none;
}

/* JS adds this to <body> only while the popup is open, to stop the page
   behind it from scrolling. */
body.tour-filter-popup-open {
	overflow: hidden;
}

@media ( max-width: 575px ) {
	.tour-archive-filter-bar.has-js .tour-archive-filter-bar__toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		width: 100%;
		padding: 13px 20px;
		border: 1.5px solid var( --tour-archive-ink );
		border-radius: var( --tour-archive-radius );
		background: #fff;
		color: var( --tour-archive-ink );
		font-weight: 700;
		font-size: 0.92rem;
		cursor: pointer;
	}

	.tour-archive-filter-bar__toggle svg {
		color: var( --tour-archive-accent );
	}

	/* Backdrop sits under the popup, dims the page behind it; both stay
	   display:none until JS (tour-archive-filters.js) adds .is-open. */
	.tour-archive-filter-bar.has-js .tour-archive-filter-bar__backdrop {
		position: fixed;
		inset: 0;
		z-index: 1000;
		background: rgba( 16, 20, 30, 0.55 );
	}

	.tour-archive-filter-bar__backdrop.is-open {
		display: block;
	}

	.tour-archive-filter-bar.has-js .tour-archive-filter-bar__form {
		display: none;
		position: fixed;
		inset: 0;
		z-index: 1001;
		margin: 0;
		width: 100%;
		max-width: 100%;
		max-height: 100%;
		border-radius: 0;
		overflow-y: auto;
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: stretch;
		gap: 18px;
		padding:0px 15px 20px;
	}

	.tour-archive-filter-bar.has-js .tour-archive-filter-bar__form.is-open {
		display: flex;
	}

	/* Sticky so Apply stays reachable while the field list scrolls beneath
	   it — needs an opaque background since scrolled content passes under
	   it. There's no separate close button any more; the only ways out of
	   the popup are Apply (applies + closes), tapping the backdrop, or
	   Escape (both close with nothing applied). */
	.tour-archive-filter-bar.has-js .tour-archive-filter-bar__popup-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		position: sticky;
		top: 0;
		z-index: 1;
		margin: 0 -20px;
		padding: 10px 15px 12px;
		background: #fff;
		border-bottom: 1px solid var( --tour-archive-line );
	}

	.tour-archive-filter-bar__popup-title {
		font-weight: 700;
		font-size: 1.05rem;
		color: var( --tour-archive-ink );
	}

	.tour-archive-filter-bar__field,
	.tour-archive-filter-bar__field--search,
	.tour-archive-filter-bar__field--price {
		flex: 1 1 100%;
		min-width: 0;
	}

	/* western-style.css hides the Apply button site-wide (display:none) so
	   desktop's auto-apply-on-change selects don't need it — but inside
	   the mobile popup, selects deliberately do NOT auto-apply (see
	   tour-archive-filters.js) so more than one field can be picked before
	   submitting, so Apply has to be visible here — compact, top-right of
	   the sticky header, rather than the full-width bar used elsewhere.
	   4-class selector beats that single-class rule on specificity
	   regardless of stylesheet order. */
	.tour-archive-filter-bar.has-js .tour-archive-filter-bar__popup-header .tour-archive-filter-bar__submit {
		display: inline-flex;
		width: auto;
		padding: 9px 18px;
		font-size: 0.85rem;
		flex-shrink: 0;
	}
}

/* -------------------------------------------------- */
/* Tour card                                           */
/* -------------------------------------------------- */

.tour-archive-card {
	--tour-archive-accent: #e0793c;
	--tour-archive-ink: #1a2350;
	--tour-archive-ink-soft: #6b7280;
	--tour-archive-line: #eceef1;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 4px 15px rgba( 20, 30, 45, 0.08 );
}

.tour-archive-card__media {
	display: block;
	aspect-ratio: 7 / 3;
	overflow: hidden;
}

.tour-archive-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.tour-archive-card:hover .tour-archive-card__media img {
	transform: scale( 1.05 );
}

.tour-archive-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 22px 22px 24px;
}

.tour-archive-card__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
}

.tour-archive-card__badge {
	display: inline-flex;
	align-items: center;
	padding: 6px 14px;
	border: 1px solid rgb(224 121 60 / 52%);
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 700;
	color:var( --tour-accent-dark, #c85f27 );
	background: #fff;
}

.tour-archive-card__badge--type {
	color: var( --tour-accent-dark, #c85f27 );
	border-color: rgba( 224, 121, 60, 0.5 );
}

.tour-archive-card__title {
	margin: 0 0 10px;
	font-size: 22px;
	line-height: 1.3;
	font-weight: 700;
	color: var( --tour-archive-ink );
}

.tour-archive-card__title a {
	color: inherit;
	text-decoration: none;
}

.tour-archive-card__title a:hover {
	text-decoration: underline;
}

.tour-archive-card__route {
	margin: 0 0 18px;
	font-size: 0.88rem;
	color:#464C5E;
	line-height: 1.5;
}

.tour-archive-card__inclusions {
	display: flex;
	justify-content: space-between;
	gap: 6px;
	padding: 16px 0;
	border-top: 1px solid var( --tour-archive-line );
	margin-top: auto;
}

.tour-archive-card__inclusion {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	flex: 1;
	min-width: 0;
}

.tour-archive-card__inclusion-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var( --tour-archive-accent );
	line-height: 1;
}

.tour-archive-card__inclusion-icon svg {
	width: 35px;
	height: 35px;
}

.tour-archive-card__inclusion-label {
	font-size: 12px;
	color:#464c5e;
	text-align: center;font-weight: 600;
	white-space: nowrap;
}

.tour-archive-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 16px;
	border-top: 1px solid var( --tour-archive-line );
}

.tour-archive-card__price {
	margin: 0;
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}

.tour-archive-card__price-label {
	font-size: 14px;
	color: var( --tour-archive-ink-soft );
}

.tour-archive-card__price-value {
	font-size: 1.3rem;
	font-weight: 800;
	color: var( --tour-archive-accent );
}

/*
 * Same "sweep fill" hover mechanism as .site-header-custom__btn in
 * western-style.css (wp-content/novamira-sandbox/site-header.php): a
 * ::before panel slides in from the left on hover/focus instead of the
 * background just flipping instantly, plus a per-character label flip
 * (see tour-archive-filters.js, using the same GSAP + SplitType already
 * loaded site-wide for the header button). Not reusing .site-header-
 * custom__btn directly — that class also carries header-specific padding/
 * radius/font that would fight this button's own sizing.
 */
.tour-archive-card__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 22px;
	border: 1.5px solid var( --tour-archive-accent );
	border-radius: 999px;
	background: rgba( 224, 121, 60, 0.08 );
	color: var( --tour-archive-accent );
	font-weight: 700;
	font-size: 0.88rem;
	text-decoration: none;
	white-space: nowrap;
	position: relative;
	overflow: hidden;
	isolation: isolate;
	transition: color 350ms cubic-bezier( 0.4, 0, 0.2, 1 );
}

.tour-archive-card__cta::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var( --tour-archive-accent );
	transform: translate3d( -100%, 0, 0 );
	transition: transform 400ms cubic-bezier( 0.4, 0, 0.2, 1 );
}

.tour-archive-card__cta:hover,
.tour-archive-card__cta:focus-visible {
	color: #fff;
}

.tour-archive-card__cta:hover::before,
.tour-archive-card__cta:focus-visible::before {
	transform: translate3d( 0, 0, 0 );
}

.tour-archive-card__cta-label {
	position: relative;
	display: inline-block;
	line-height: 1;font-size:14px;
}
/* =========================================================
   TOUR ARCHIVE - INFINITE SCROLL
   ========================================================= */

.tour-archive-load-more {
	width: 100%;
	height: 80px;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.tour-archive-load-more__spinner {
	display: none;
	width: 28px;
	height: 28px;
	border: 3px solid rgba(0, 0, 0, 0.12);
	border-top-color: var(--tour-archive-accent, #e97632);
	border-radius: 50%;
	animation: tourArchiveSpin 0.7s linear infinite;
}

.tour-archive-load-more.is-loading
.tour-archive-load-more__spinner {
	display: block;
}

.tour-archive-load-more.is-finished {
	height: 1px;
	visibility: hidden;
}

@keyframes tourArchiveSpin {
	to {
		transform: rotate(360deg);
	}
}