/* Phones: native patterns. Bottom tab bar + horizontal snap rails on the home page instead of long stacks.
 * Desktop (>= 1024 for the bar, >= 600 for rails) is unchanged. */

/* ---------------------------------------------------------------- Bottom tab bar */
body.ggt-theme .ggt-tabbar { display: none; }
@media (max-width: 1023.98px) {
	body.ggt-theme.ggt-has-tabbar { --ggt-tabbar-h: 60px; padding-bottom: calc(var(--ggt-tabbar-h) + env(safe-area-inset-bottom, 0px)); }
	body.ggt-theme .ggt-tabbar {
		display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
		padding-bottom: env(safe-area-inset-bottom, 0px);
		background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
		border-top: 1px solid var(--ggt-line);
	}
	body.ggt-theme .ggt-tabbar__list { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: var(--ggt-tabbar-h); margin: 0 auto; padding: 0 4px; max-width: 640px; list-style: none; }
	body.ggt-theme .ggt-tabbar__list li { margin: 0; min-width: 0; }
	body.ggt-theme .ggt-tabbar__item {
		position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 100%;
		color: var(--ggt-muted); text-decoration: none; font-size: 11px; font-weight: 600; letter-spacing: .01em; -webkit-tap-highlight-color: transparent;
	}
	body.ggt-theme .ggt-tabbar__item:hover { color: var(--ggt-ink); }
	body.ggt-theme .ggt-tabbar__item.is-active { color: var(--ggt-accent); }
	body.ggt-theme .ggt-tabbar__item.is-active::before { content: ""; position: absolute; top: 0; left: 50%; width: 24px; height: 2px; margin-left: -12px; border-radius: 0 0 2px 2px; background: var(--ggt-accent); }
	body.ggt-theme .ggt-tabbar__item.is-active .ggt-tabbar__icon { stroke-width: 2.1; }
	body.ggt-theme .ggt-tabbar__item:focus-visible { outline: none; box-shadow: inset var(--ggt-focus); border-radius: 12px; }
	body.ggt-theme .ggt-tabbar__icon { width: 24px; height: 24px; flex: none; }
	body.ggt-theme .ggt-tabbar__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	@media (prefers-reduced-transparency: reduce) { body.ggt-theme .ggt-tabbar { background: var(--ggt-paper); -webkit-backdrop-filter: none; backdrop-filter: none; } }
	/* Things that live at the bottom edge sit above the bar. */
	body.ggt-theme.ggt-has-tabbar .ggt-consent { bottom: calc(var(--ggt-tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px); }
	body.ggt-theme.ggt-has-tabbar .ggt-viewas { bottom: calc(var(--ggt-tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px); }
	/* The burger sheet stops above the bar. */
	body.ggt-theme.ggt-has-tabbar .ggt-nav.is-open { bottom: calc(var(--ggt-tabbar-h) + env(safe-area-inset-bottom, 0px)); }
}
/* A dialog (Add money, auth) covers the bar; nothing to do: dialogs live in the top layer. */

/* ---------------------------------------------------------------- Home rails (phones) */
@media (max-width: 599.98px) {
	body.ggt-theme.ggt-theme .ggt-home-countries .ggt-country-chips,
	body.ggt-theme.ggt-theme .ggt-city-tiles--home,
	body.ggt-theme.ggt-theme .ggt-home-tours .ggt-grid--tours,
	body.ggt-theme.ggt-theme .ggt-home-calls .ggt-call-offers,
	body.ggt-theme.ggt-theme .ggt-home-interests .ggt-interest-tiles,
	body.ggt-theme.ggt-theme .ggt-home-reviews .ggt-quotes,
	body.ggt-theme.ggt-theme .ggt-home-guides .ggt-grid--guides,
	body.ggt-theme.ggt-theme .ggt-home-why .ggt-why {
		display: grid; grid-auto-flow: column; grid-template-columns: none; gap: 12px;
		margin: 0 calc(-1 * var(--ggt-gutter)); padding: 2px var(--ggt-gutter) 6px; list-style: none;
		overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--ggt-gutter);
		scrollbar-width: none; -webkit-overflow-scrolling: touch;
	}
	body.ggt-theme.ggt-theme .ggt-home-countries .ggt-country-chips::-webkit-scrollbar,
	body.ggt-theme.ggt-theme .ggt-city-tiles--home::-webkit-scrollbar,
	body.ggt-theme.ggt-theme .ggt-home-tours .ggt-grid--tours::-webkit-scrollbar,
	body.ggt-theme.ggt-theme .ggt-home-calls .ggt-call-offers::-webkit-scrollbar,
	body.ggt-theme.ggt-theme .ggt-home-interests .ggt-interest-tiles::-webkit-scrollbar,
	body.ggt-theme.ggt-theme .ggt-home-reviews .ggt-quotes::-webkit-scrollbar,
	body.ggt-theme.ggt-theme .ggt-home-guides .ggt-grid--guides::-webkit-scrollbar,
	body.ggt-theme.ggt-theme .ggt-home-why .ggt-why::-webkit-scrollbar { display: none; }
	body.ggt-theme.ggt-theme .ggt-home-countries .ggt-country-chips > *,
	body.ggt-theme.ggt-theme .ggt-city-tiles--home > *,
	body.ggt-theme.ggt-theme .ggt-home-tours .ggt-grid--tours > *,
	body.ggt-theme.ggt-theme .ggt-home-calls .ggt-call-offers > *,
	body.ggt-theme.ggt-theme .ggt-home-interests .ggt-interest-tiles > *,
	body.ggt-theme.ggt-theme .ggt-home-reviews .ggt-quotes > *,
	body.ggt-theme.ggt-theme .ggt-home-guides .ggt-grid--guides > *,
	body.ggt-theme.ggt-theme .ggt-home-why .ggt-why > * { scroll-snap-align: start; min-width: 0; margin: 0; }

	/* Countries: two compact rows that scroll sideways. */
	body.ggt-theme.ggt-theme .ggt-home-countries .ggt-country-chips { grid-template-rows: repeat(2, auto); grid-auto-columns: max-content; gap: 8px; }
	body.ggt-theme.ggt-theme .ggt-home-countries .ggt-country-chip { min-height: 44px; padding: 6px 14px 6px 10px; border-radius: var(--ggt-pill); gap: 8px; }
	body.ggt-theme.ggt-theme .ggt-home-countries .ggt-country-chip__flag { font-size: 18px; }
	body.ggt-theme.ggt-theme .ggt-home-countries .ggt-country-chip__text { flex-direction: row; align-items: baseline; gap: 6px; white-space: nowrap; }
	body.ggt-theme.ggt-theme .ggt-home-countries .ggt-country-chip__name { font-size: 14px; }
	body.ggt-theme.ggt-theme .ggt-home-countries .ggt-country-chip__count { font-size: 12.5px; }

	/* Cities: photo-led cards, next one peeking. */
	body.ggt-theme.ggt-theme .ggt-city-tiles--home { grid-auto-columns: 68%; }
	body.ggt-theme.ggt-theme .ggt-city-tiles--home .ggt-city-tile__link { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
	body.ggt-theme.ggt-theme .ggt-city-tiles--home .ggt-city-tile__media { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 0; }
	body.ggt-theme.ggt-theme .ggt-city-tiles--home .ggt-city-tile__body { padding: 10px 12px 12px; }
	body.ggt-theme.ggt-theme .ggt-city-tiles--home .ggt-city-tile__name { font-size: 16px; }
	body.ggt-theme.ggt-theme .ggt-city-tiles--home .ggt-city-tile__country,
	body.ggt-theme.ggt-theme .ggt-city-tiles--home .ggt-city-tile__facts { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

	/* Tours, calls, reviews, guides, why: one card + a peek. Interests: two at a time. */
	body.ggt-theme.ggt-theme .ggt-home-tours .ggt-grid--tours { grid-auto-columns: 78%; }
	body.ggt-theme.ggt-theme .ggt-home-calls .ggt-call-offers { grid-auto-columns: 84%; }
	body.ggt-theme.ggt-theme .ggt-home-reviews .ggt-quotes { grid-auto-columns: 84%; }
	body.ggt-theme.ggt-theme .ggt-home-guides .ggt-grid--guides { grid-auto-columns: 64%; }
	body.ggt-theme.ggt-theme .ggt-home-why .ggt-why { grid-auto-columns: 72%; }
	body.ggt-theme.ggt-theme .ggt-home-interests .ggt-interest-tiles { grid-auto-columns: 58%; }
	body.ggt-theme.ggt-theme .ggt-interest-tile { padding: 16px; gap: 6px; min-height: 0; height: 100%; }
	body.ggt-theme.ggt-theme .ggt-interest-tile__top { flex-direction: column; align-items: flex-start; gap: 2px; }
	body.ggt-theme.ggt-theme .ggt-interest-tile__name { font-size: 17px; }
	body.ggt-theme.ggt-theme .ggt-interest-tile__text { font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

	/* How it works: a compact numbered list instead of three tall cards. */
	body.ggt-theme.ggt-theme .ggt-how .ggt-steps { gap: 10px; }
	body.ggt-theme.ggt-theme .ggt-how .ggt-step { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-items: start; padding: 16px; }
	body.ggt-theme.ggt-theme .ggt-how .ggt-step__num { grid-row: 1 / span 2; width: 36px; height: 36px; margin: 0; font-size: 15px; border-radius: 10px; display: grid; place-items: center; }
	body.ggt-theme.ggt-theme .ggt-how .ggt-step__title { margin: 6px 0 0; font-size: 17px; line-height: 1.3; }
	body.ggt-theme.ggt-theme .ggt-how .ggt-step__text { margin: 0; font-size: 14px; line-height: 1.5; }
	body.ggt-theme.ggt-theme .ggt-how { padding-top: 36px; padding-bottom: 36px; }
	body.ggt-theme.ggt-theme .ggt-home-tours .ggt-tour-card,
	body.ggt-theme.ggt-theme .ggt-home-guides .ggt-grid--guides > *,
	body.ggt-theme.ggt-theme .ggt-home-reviews .ggt-quote,
	body.ggt-theme.ggt-theme .ggt-home-why .ggt-why__item { height: 100%; }

	/* Hero stats: three across, no orphan. (rich.css loads after this sheet, hence the doubled class.) */
	body.ggt-theme.ggt-theme .ggt-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
	body.ggt-theme.ggt-theme .ggt-stats__item:last-child:nth-child(odd) { grid-column: auto; }

	/* Tighter section rhythm on the home page. */
	body.ggt-theme.ggt-theme .ggt-home-countries,
	body.ggt-theme.ggt-theme .ggt-home-cities,
	body.ggt-theme.ggt-theme .ggt-home-tours,
	body.ggt-theme.ggt-theme .ggt-home-calls,
	body.ggt-theme.ggt-theme .ggt-home-interests,
	body.ggt-theme.ggt-theme .ggt-home-reviews,
	body.ggt-theme.ggt-theme .ggt-home-guides,
	body.ggt-theme.ggt-theme .ggt-home-why { padding-top: 36px; padding-bottom: 36px; }
}
