/* Travel Business Core - header and footer layout fixes.
   Loaded on every page (see tbc_enqueue_site_chrome_css in travel-business-core.php).
   Colours come only from Elementor Global Colors (hex values are var() fallbacks).
   To remove: delete this file and the enqueue block in the plugin. The Elementor
   header/footer templates keep working, just without these fixes.

   Hooks used by the templates:
   .tbc-topbar-wrap  top bar container      .tbc-main-header  main header container
   .tbc-brand        logo + site title      .tbc-header-right menu + Book Now
   .tbc-book-btn     Book Now button        .tbc-footer       footer container
   .tbc-footer-contact  footer Contact Us column
*/

/* ---------- 1. Sticky header (top bar scrolls away, main header stays) ---------- */

#masthead {
	position: sticky;
	top: -40px; /* = top bar height, so only the white header stays pinned */
	z-index: 999;
}

body.admin-bar #masthead {
	top: calc(32px - 40px); /* WordPress admin bar is 32px on desktop */
}

@media (max-width: 782px) {
	body.admin-bar #masthead {
		top: calc(46px - 40px); /* admin bar is 46px on small screens */
	}
}

/* Top bar is hidden below 768px, so there is nothing to scroll away. */
@media (max-width: 767px) {
	#masthead {
		top: 0;
	}

	body.admin-bar #masthead {
		top: 46px;
	}
}

/* Below 601px the admin bar scrolls with the page instead of staying fixed. */
@media (max-width: 600px) {
	body.admin-bar #masthead {
		top: 0;
	}
}

/* ---------- 2. Top bar ---------- */

body .elementor .tbc-topbar-wrap {
	height: 40px;
	min-height: 40px;
	box-sizing: border-box;
}

body .elementor .tbc-topbar-wrap .elementor-widget {
	margin: 0;
}

body .elementor .tbc-topbar-wrap .tbc-topbar-city,
body .elementor .tbc-topbar-wrap .tbc-topbar-city p {
	margin: 0;
	color: var(--e-global-color-accent, #F7F4EE);
	font-size: 13px;
	line-height: 1;
	white-space: nowrap;
}

/* ---------- 3. Main header ---------- */

body .elementor .tbc-main-header {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Logo and menu groups size to their content, never to a fixed width. */
body .elementor .tbc-main-header .tbc-brand,
body .elementor .tbc-main-header .tbc-header-right {
	--width: auto;
	width: auto;
	flex: 0 0 auto;
	min-width: 0;
}

body .elementor .tbc-main-header .tbc-brand .elementor-widget {
	margin: 0;
	width: auto;
}

/* Logo: 56px tall on desktop, 44px on mobile, width follows the picture. */
body .elementor .tbc-main-header .hfe-site-logo-container {
	display: flex;
	align-items: center;
}

body .elementor .tbc-main-header .hfe-site-logo .hfe-site-logo-container img.hfe-site-logo-img {
	display: block;
	height: 56px;
	width: auto;
	max-width: none;
	object-fit: contain;
}

@media (max-width: 767px) {
	body .elementor .tbc-main-header .hfe-site-logo .hfe-site-logo-container img.hfe-site-logo-img {
		height: 44px;
	}
}

body .elementor .tbc-main-header .hfe-site-title,
body .elementor .tbc-main-header .hfe-site-title .hfe-heading-text {
	white-space: nowrap;
}

/* Between 1025px and 1199px the site title is hidden to keep the menu on one line. */
@media (min-width: 1025px) and (max-width: 1199px) {
	body .elementor .tbc-main-header .tbc-brand .elementor-widget-hfe-site-title {
		display: none;
	}
}

/* Menu: one line, never wraps. */
body .elementor .tbc-main-header .elementor-widget-navigation-menu {
	width: auto;
	flex: 0 0 auto;
}

body .elementor .tbc-main-header .hfe-nav-menu__layout-horizontal .hfe-nav-menu {
	flex-wrap: nowrap;
}

body .elementor .tbc-main-header .hfe-nav-menu a.hfe-menu-item {
	white-space: nowrap;
	font-size: 15px;
	line-height: 1.2;
}

/* Book Now: its own space, never overlaps the menu. */
body .elementor .tbc-main-header .tbc-book-btn {
	flex: 0 0 auto;
	width: auto;
}

body .elementor .tbc-main-header .tbc-book-btn a.elementor-button {
	white-space: nowrap;
}

@media (min-width: 1025px) {
	body .elementor .tbc-main-header .tbc-book-btn {
		margin-left: 12px;
	}
}

/* Tablet and mobile: hamburger dropdown is full width and easy to read. */
@media (max-width: 1024px) {
	body .elementor .tbc-main-header .hfe-nav-menu nav.hfe-dropdown a.hfe-menu-item,
	body .elementor .tbc-main-header .hfe-nav-menu nav.hfe-dropdown-expandible a.hfe-menu-item {
		font-size: 16px;
		padding: 14px 20px;
		white-space: normal;
	}
}

/* ---------- 4. Footer ---------- */

/* Footer logo: at most 70px tall. The light plate keeps a dark logo readable on the dark footer. */
body .elementor .tbc-footer .hfe-site-logo .hfe-site-logo-container {
	display: inline-flex;
	align-items: center;
	padding: 6px 10px;
	border-radius: 8px;
	background-color: var(--e-global-color-accent, #F7F4EE);
}

body .elementor .tbc-footer .hfe-site-logo .hfe-site-logo-container img.hfe-site-logo-img {
	display: block;
	height: auto;
	max-height: 70px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
}

/* Contact Us column: light text, white links, Secondary on hover. */
body .elementor .tbc-footer-contact .elementor-widget-shortcode .elementor-shortcode {
	color: var(--e-global-color-accent, #F7F4EE);
	font-size: 15px;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

body .elementor .tbc-footer-contact .elementor-widget-shortcode .elementor-shortcode a:not(.tbc-contact-buttons__btn) {
	color: var(--e-global-color-ttwhite, #FFFFFF);
	text-decoration: none;
	transition: color 0.2s ease;
}

body .elementor .tbc-footer-contact .elementor-widget-shortcode .elementor-shortcode a:not(.tbc-contact-buttons__btn):hover,
body .elementor .tbc-footer-contact .elementor-widget-shortcode .elementor-shortcode a:not(.tbc-contact-buttons__btn):focus-visible {
	color: var(--e-global-color-secondary, #F28C28);
}

/* WhatsApp button in the footer: normal size, Secondary colour. */
body .elementor .tbc-footer a.tbc-contact-buttons__btn {
	min-height: 44px;
	padding: 0 20px;
	border-color: var(--e-global-color-secondary, #F28C28);
	background-color: var(--e-global-color-secondary, #F28C28);
	color: var(--e-global-color-text, #1B1B1B);
	font-size: 15px;
}

body .elementor .tbc-footer a.tbc-contact-buttons__btn:hover,
body .elementor .tbc-footer a.tbc-contact-buttons__btn:focus-visible {
	border-color: var(--e-global-color-ttwhite, #FFFFFF);
	background-color: var(--e-global-color-ttwhite, #FFFFFF);
	color: var(--e-global-color-primary, #0E5A66);
}

body .elementor .tbc-footer .tbc-contact-buttons__icon {
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
}

/* ---------- 5. Small screens: logo left, Book Now + hamburger right, one row ---------- */

/* Never let the header groups wrap onto a second row (Elementor flips the
   right-hand group to wrap-reverse on mobile). */
body .elementor .tbc-main-header .tbc-brand,
body .elementor .tbc-main-header .tbc-header-right {
	flex-wrap: nowrap;
	min-width: 0;
}

/* On phones the logo is enough: the site title next to it would push
   Book Now and the hamburger off the screen. */
@media (max-width: 767px) {
	body .elementor .tbc-main-header .tbc-brand .elementor-widget-hfe-site-title {
		display: none;
	}

	body .elementor .tbc-main-header .tbc-header-right {
		margin-left: auto;
	}
}
