/* Tour Manager - frontend base (grid, slider, shared card parts).
   CSS variables come from Settings: --tm-primary --tm-secondary --tm-radius --tm-shadow --tm-font-size --tm-spacing */

.tm-wrap,
.tm-wrap *,
.tm-wrap *::before,
.tm-wrap *::after { box-sizing: border-box; }

.tm-wrap { font-size: var(--tm-font-size, 16px); color: inherit; }
.tm-wrap img { max-width: 100%; height: auto; }
.tm-wrap a { text-decoration: none; }

.tm-empty { padding: 1em 0; opacity: .7; }

/* ---------- Grid ---------- */
.tm-grid {
	display: grid;
	gap: var(--tm-spacing, 20px);
	grid-template-columns: repeat(var(--tm-cols-mobile, 1), minmax(0, 1fr));
}
.tm-grid__item { min-width: 0; }
.tm-grid__item > * { height: 100%; }
@media (min-width: 640px)  { .tm-grid { grid-template-columns: repeat(var(--tm-cols-tablet, 2), minmax(0, 1fr)); } }
@media (min-width: 1024px) { .tm-grid { grid-template-columns: repeat(var(--tm-cols-desktop, 3), minmax(0, 1fr)); } }

/* Standalone single card */
.tm-single-card { max-width: 440px; }

/* ---------- Slider ---------- */
.tm-slider { position: relative; --tm-cols: var(--tm-cols-mobile, 1); }
@media (min-width: 640px)  { .tm-slider { --tm-cols: var(--tm-cols-tablet, 2); } }
@media (min-width: 1024px) { .tm-slider { --tm-cols: var(--tm-cols-desktop, 3); } }

.tm-slider__viewport {
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 16px;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	padding: 16px;
	margin: -16px;
	outline: none;
}
.tm-slider__viewport::-webkit-scrollbar { display: none; }
.tm-slider__track { display: flex; gap: var(--tm-spacing, 20px); }
.tm-slider__slide {
	flex: 0 0 calc((100% - (var(--tm-cols) - 1) * var(--tm-spacing, 20px)) / var(--tm-cols));
	min-width: 0;
	scroll-snap-align: start;
}
.tm-slider__slide > * { height: 100%; }

.tm-slider__arrow {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
	width: 2.9em; height: 2.9em; border-radius: 50%; border: 0; padding: 0;
	display: grid; place-items: center; font-size: 1.2em;
	background: #fff; color: #111; cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
	transition: transform .2s ease, background .2s ease, color .2s ease;
}
.tm-slider__arrow:hover { background: var(--tm-primary); color: #fff; transform: translateY(-50%) scale(1.08); }
.tm-slider__arrow[hidden] { display: none; }
.tm-slider__prev { left: 6px; }
.tm-slider__next { right: 6px; }
@media (min-width: 1100px) {
	.tm-slider__prev { left: -22px; }
	.tm-slider__next { right: -22px; }
}

.tm-slider__dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.tm-slider__dots:empty { display: none; }
.tm-slider__dot {
	width: 12px; height: 12px; padding: 0; border: 0; border-radius: 50%;
	background: #cfd8e3; cursor: pointer; transition: background .2s ease, transform .2s ease;
}
.tm-slider__dot.is-active { background: var(--tm-primary); transform: scale(1.15); }

/* ---------- "View all" button with side lines ---------- */
.tm-viewall { display: flex; align-items: center; gap: 1.2em; margin-top: 1.6em; }
.tm-viewall::before,
.tm-viewall::after { content: ""; flex: 1; height: 2px; background: var(--tm-primary); opacity: .85; }
.tm-viewall__btn {
	display: inline-flex; align-items: center; gap: .6em;
	padding: .9em 2.2em; border-radius: 999px;
	background: var(--tm-primary); color: #fff !important; font-weight: 700;
	box-shadow: 0 0 0 5px rgba(255, 255, 255, .9), 0 8px 22px rgba(0, 0, 0, .15);
	transition: transform .2s ease, filter .2s ease;
}
.tm-viewall__btn:hover { transform: translateY(-2px); filter: brightness(1.08); }

/* ---------- Shared card parts ---------- */
.tm-icon { width: 1em; height: 1em; flex: none; }
.tm-emoji { font-size: 1.1em; line-height: 1; }

.tm-card__placeholder {
	position: absolute; inset: 0; display: block;
	background: linear-gradient(135deg, #dfe7ee, #c5d3e0);
}

.tm-chip {
	display: inline-flex; align-items: center; gap: .45em; min-width: 0;
	padding: .6em 1.1em; border-radius: 999px;
	font-weight: 700; font-size: .95em; line-height: 1.1; white-space: nowrap;
}
.tm-chip__text { overflow: hidden; text-overflow: ellipsis; }
.tm-chip--dest { background: var(--tm-primary); color: #fff; }
.tm-chip--duration { background: #fff; color: #111; flex: none; }
.tm-chip--duration .tm-icon { color: var(--tm-primary); }

.tm-badge {
	position: absolute; left: 16px; bottom: 16px; z-index: 2;
	padding: .35em .9em; border-radius: 999px;
	font-size: .78em; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
	background: var(--tm-secondary); color: #111;
}
.tm-badge--top { bottom: auto; top: 16px; }
.tm-badge--hot { background: #e5383b; color: #fff; }
.tm-badge--popular { background: #7c3aed; color: #fff; }

.tm-card__closed {
	position: absolute; right: 16px; bottom: 16px; z-index: 2;
	padding: .35em .9em; border-radius: 999px;
	background: rgba(17, 17, 17, .8); color: #fff; font-size: .78em; font-weight: 700;
}
.tm-card__closed--top { bottom: auto; top: 16px; }

.tm-accent { color: var(--tm-primary); }

/* whole card clickable through the title link */
.tm-card__link { color: inherit; }
.tm-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }

/* price parts */
.tm-price-symbol { font-size: .7em; margin-right: .15em; }

.tm-btn {
	display: inline-flex; align-items: center; gap: .5em; position: relative; z-index: 3;
	padding: .7em 1.3em; border-radius: 999px;
	background: var(--tm-primary); color: #fff !important; font-weight: 700; font-size: .92em;
	transition: transform .2s ease, filter .2s ease;
}
.tm-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }

@media (prefers-reduced-motion: reduce) {
	.tm-wrap * { transition: none !important; }
}
