/**
 * Tour shortcodes: grid layout + card UI (matches original Elementor template design).
 */

.ap-tours-shortcode-root.ap-shortcode-tours-grid {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 24px !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
	align-items: stretch !important;
	clear: both;
	isolation: isolate;
}

/* Elementor column wrapping the shortcode must not flex-shrink the grid */
.elementor-column.search-tour-box > .elementor-widget-wrap.elementor-element-populated,
.elementor-column.search-tour-box > .elementor-element-populated {
	display: block !important;
	width: 100% !important;
}

.elementor-column.search-tour-box .elementor-widget-shortcode,
.elementor-column.search-tour-box .elementor-widget-shortcode > .elementor-widget-container {
	width: 100% !important;
	max-width: 100% !important;
}

/* Tour card shell (was Elementor column 1aff268: white card + spacing) */
.ap-shortcode-tours-grid > .elementor-column,
.ap-shortcode-tours-grid > .elementor-inner-column,
.ap-shortcode-tours-grid > .elementor-element.elementor-column {
	background-color: #fff !important;
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
	overflow: hidden !important;
	height: 100%;
}

@media (max-width: 1024px) {
	.ap-shortcode-tours-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 600px) {
	.ap-shortcode-tours-grid {
		grid-template-columns: minmax(0, 1fr) !important;
	}
}

/* Each card: own stacking context — stops columns visually bleeding into each other */
.ap-shortcode-tours-grid > .elementor-column,
.ap-shortcode-tours-grid > .elementor-inner-column,
.ap-shortcode-tours-grid > .elementor-element.elementor-column {
	width: auto !important;
	min-width: 0 !important;
	max-width: 100% !important;
	flex: 0 1 auto !important;
	flex-shrink: 1 !important;
	flex-grow: 0 !important;
	flex-basis: auto !important;
	-ms-flex-positive: 0 !important;
	-ms-flex-negative: 1 !important;
	margin: 0 !important;
	margin-bottom: 0 !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	float: none !important;
	clear: none !important;
	position: relative !important;
	left: auto !important;
	right: auto !important;
	top: auto !important;
	transform: none !important;
	overflow: visible !important;
	box-sizing: border-box !important;
}

.ap-shortcode-tours-grid > .elementor-column > .elementor-widget-wrap.elementor-element-populated,
.ap-shortcode-tours-grid > .elementor-inner-column > .elementor-widget-wrap.elementor-element-populated,
.ap-shortcode-tours-grid > .elementor-element.elementor-column > .elementor-widget-wrap.elementor-element-populated {
	display: flex !important;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	align-items: stretch !important;
	width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	position: relative !important;
}

/* Tear image block: constrain box (portrait originals) */
.ap-shortcode-tours-grid .elementor-widget-image:has(img.ap-tour-featured-img) .elementor-widget-container {
	display: block !important;
	width: 100% !important;
	overflow: hidden !important;
	aspect-ratio: 16 / 10 !important;
	max-height: 320px !important;
	position: relative !important;
	margin: 0 !important;
}

.ap-shortcode-tours-grid img.ap-tour-featured-img {
	width: 100% !important;
	height: 100% !important;
	min-height: 0 !important;
	object-fit: cover !important;
	object-position: center !important;
	display: block !important;
	max-width: none !important;
	vertical-align: top;
}

/* No :has() support — same effect for first hero image widget */
.ap-shortcode-tours-grid > .elementor-column > .elementor-widget-wrap > .elementor-element.elementor-widget-image:first-child .elementor-widget-container,
.ap-shortcode-tours-grid > .elementor-inner-column > .elementor-widget-wrap > .elementor-element.elementor-widget-image:first-child .elementor-widget-container {
	display: block !important;
	width: 100% !important;
	overflow: hidden !important;
	aspect-ratio: 16 / 10 !important;
	max-height: 320px !important;
	position: relative !important;
	margin: 0 !important;
}

/* Icon/image-box rows stay in normal flow — avoid overlap with cropped hero */
.ap-shortcode-tours-grid .elementor-widget-image-box .elementor-image-box-wrapper {
	align-items: flex-start !important;
}

.ap-shortcode-tours-grid .elementor-widget-heading {
	position: relative !important;
	z-index: 1 !important;
}

/* Typography + spacing (from Search Tours Elementor template) */
.ap-shortcode-tours-grid .elementor-widget-image + .elementor-widget-heading .elementor-heading-title {
	font-family: Manrope, sans-serif !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	color: #333 !important;
	margin: 12px 20px -6px !important;
	padding: 0 !important;
}

.ap-shortcode-tours-grid .elementor-image-box-wrapper {
	align-items: flex-start !important;
	gap: 10px;
}

.ap-shortcode-tours-grid .elementor-image-box-img img {
	width: 22px !important;
	height: auto !important;
	flex-shrink: 0;
}

.ap-shortcode-tours-grid .elementor-image-box-title {
	font-family: Manrope, sans-serif !important;
	font-size: 18px !important;
	font-weight: 700 !important;
	line-height: 1.35 !important;
	color: #011b30 !important;
	margin: 0 !important;
}

.ap-shortcode-tours-grid .elementor-widget-image-box .elementor-widget-container,
.ap-shortcode-tours-grid .elementor-widget-icon-box .elementor-widget-container {
	padding-left: 20px !important;
	padding-right: 20px !important;
}

.ap-shortcode-tours-grid .elementor-widget-icon-box .elementor-icon-box-wrapper {
	flex-direction: row !important;
	align-items: center !important;
	text-align: start !important;
	display: flex !important;
	gap: 10px;
}

.ap-shortcode-tours-grid .elementor-icon-box-icon .elementor-icon {
	font-size: 18px;
	line-height: 1;
}

.ap-shortcode-tours-grid .elementor-icon-box-icon svg {
	width: 18px !important;
	height: 18px !important;
	fill: #011b30 !important;
}

.ap-shortcode-tours-grid .elementor-icon-box-title {
	font-family: Manrope, sans-serif !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	color: #54595f !important;
}

.ap-shortcode-tours-grid .elementor-icon-box-title span {
	display: inline-block;
}

.ap-shortcode-tours-grid .elementor-widget-text-editor .elementor-widget-container {
	padding: 0 20px !important;
}

.ap-shortcode-tours-grid .elementor-widget-text-editor p {
	font-family: Manrope, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: #7a7a7a;
	margin: 8px 0 0;
}

.ap-shortcode-tours-grid > .elementor-column > .elementor-widget-wrap > .elementor-widget-heading:last-child .elementor-heading-title,
.ap-shortcode-tours-grid > .elementor-element.elementor-column > .elementor-widget-wrap > .elementor-widget-heading:last-child .elementor-heading-title {
	font-family: Manrope, sans-serif !important;
	font-size: 20px !important;
	font-weight: 700 !important;
	color: #011b30 !important;
	margin: 8px 20px 16px !important;
	padding: 0 !important;
}

.ap-shortcode-tours-grid .elementor-widget-wrap > .elementor-element {
	margin-bottom: 0 !important;
}

.ap-shortcode-tours-grid .elementor-widget-wrap > .elementor-element + .elementor-element {
	margin-top: 4px;
}

@media (min-width: 768px) {
	.ap-shortcode-tours-grid .elementor-widget-image-box.elementor-vertical-align-top .elementor-image-box-wrapper {
		align-items: flex-start !important;
	}

	.ap-shortcode-tours-grid .elementor-widget-image-box.elementor-position-left .elementor-image-box-wrapper {
		flex-direction: row !important;
		text-align: start !important;
		display: flex !important;
	}
}

/* --------------------------------------------------------------------------
 * [custom_search_box] — layout + autocomplete (optional #autocomplete-list)
 * -------------------------------------------------------------------------- */

.ap-custom-search-box.search-box,
.ap-custom-search-box {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
	align-items: end;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	position: relative;
	padding-bottom: 2rem; /* matches common .pb-5 if Bootstrap not loaded */
}

.ap-custom-search-box .form-control,
.ap-custom-search-box select.form-control {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 1rem;
	line-height: 1.4;
	background: #fff;
}

.ap-custom-search-box .ap-search-btn {
	cursor: pointer;
	font-weight: 600;
	border: 1px solid #1e3a5f;
	background: #1e3a5f;
	color: #fff;
}

.ap-custom-search-box .ap-search-btn:hover,
.ap-custom-search-box .ap-search-btn:focus {
	filter: brightness(1.08);
}

#autocomplete-list.autocomplete-items {
	border: 1px solid #ddd;
	border-top: none;
	max-height: 200px;
	overflow-y: auto;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 1000;
	background-color: #fff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.autocomplete-item {
	padding: 10px 12px;
	cursor: pointer;
}

.autocomplete-item:hover,
.autocomplete-item:focus {
	background-color: #f0f0f0;
}

/* Tour card: whole column is keyboard-focusable link */
.ap-shortcode-tours-grid > .elementor-column[data-ap-url] {
	cursor: pointer;
}

.ap-shortcode-tours-grid > .elementor-column[data-ap-url]:focus {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

.ap-tours-no-results {
	grid-column: 1 / -1;
	margin: 0;
	padding: 24px 16px;
	text-align: center;
	font-family: Manrope, sans-serif;
	color: #54595f;
}
