/**
 * C2NET Dostupnost — public widgets (search combobox + result panel).
 *
 * Colours/spacing read the site's Bricks global variables and fall back
 * to the C2NET design-system values, so the widgets look native on the
 * C2NET web and still acceptable on a plain theme. Buttons carry the
 * site classes .button.button-primary / .button-ghost — the theme style
 * owns their look; the fallbacks below only apply when those are absent.
 */

/* The listbox is listed too: the script moves it under <body>, out of the
   widget, so it must carry the tokens itself. */
.c2net-hledani,
.c2net-vysledek,
.c2net-hledani__list {
	--c2d-cyan: var(--brand-primary, #4FE3FF);
	--c2d-violet: var(--brand-secondary, #9F8BFF);
	--c2d-red: var(--brand-accent, #FF4D5C);
	--c2d-bg: var(--neutral-950, #060B18);
	--c2d-bg-raised: var(--neutral-900, #0A1226);
	--c2d-text: var(--neutral-50, #E9EFFF);
	--c2d-muted: var(--neutral-400, #8E9CC0);
	--c2d-line: var(--surface-line, rgba(148, 178, 255, .14));
	--c2d-card: var(--surface-card, rgba(148, 178, 255, .05));
	--c2d-radius: var(--radius-l, 16px);
	--c2d-radius-full: var(--radius-full, 999px);
	--c2d-mono: var(--font-mono, ui-monospace, "JetBrains Mono", Menlo, monospace);
	--c2d-display: var(--font-display, 'Unbounded', sans-serif);
	--c2d-spectrum: var(--gradient-spectrum, linear-gradient(90deg, #4FE3FF, #9F8BFF 50%, #FF4D5C));
	--c2d-ok: var(--c2d-cyan);
	--c2d-warn: #F5B84B;
	--c2d-vdsl: #6E59C8;
	color: var(--c2d-text);
}

.c2net-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Search ---------- */

.c2net-hledani {
	position: relative;
	max-width: 620px;
	margin-inline: auto;
}

.c2net-hledani__form {
	margin: 0;
}

/*
 * Positioning context of the listbox. It must wrap the input field ONLY —
 * anchored to the form, the list would start below the status line instead
 * of below the field.
 *
 * The z-index lifts the whole combo (field + open dropdown) above the hero
 * decorations and the sections that follow, while staying under the sticky
 * header (Bricks uses 998 for #brx-header.brx-sticky).
 */
.c2net-hledani__combo {
	position: relative;
	z-index: 100;
}

.c2net-hledani__field {
	display: flex;
	align-items: center;
	gap: 8px;
	position: relative;
	padding: 6px 6px 6px 22px;
	background: rgba(10, 18, 38, .72);
	border: 1px solid var(--c2d-line);
	border-radius: var(--c2d-radius-full);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	transition: border-color .25s, box-shadow .25s;
}

.c2net-hledani__field:focus-within {
	border-color: var(--c2d-cyan);
	box-shadow: 0 0 0 4px rgba(79, 227, 255, .12);
}

.c2net-hledani__input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 0;
	background: transparent;
	border: 0;
	outline: 0;
	color: inherit;
	font: inherit;
	font-size: 1rem;
	box-shadow: none;
}

.c2net-hledani__input::placeholder {
	color: var(--c2d-muted);
	opacity: 1;
}

.c2net-hledani__submit {
	flex: 0 0 auto;
	white-space: nowrap;
}

/* Fallback button look — the site theme style overrides via .button.button-primary. */
.c2net-hledani__submit:not(.brxe-button) {
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	border-radius: var(--c2d-radius-full);
}

.c2net-hledani.is-loading .c2net-hledani__field::after {
	content: "";
	position: absolute;
	right: 14px;
	top: 50%;
	width: 8px;
	height: 8px;
	margin-top: -4px;
	border-radius: 50%;
	background: var(--c2d-cyan);
	animation: c2d-pulse .9s ease-in-out infinite;
	pointer-events: none;
}

@keyframes c2d-pulse {
	0%, 100% { opacity: .35; transform: scale(.8); }
	50% { opacity: 1; transform: scale(1.1); }
}

/*
 * Fixed, not absolute: the widget may live inside a section that clips its
 * children (the C2NET hero is `overflow: hidden` for its decorations), and
 * no z-index escapes a clip. A viewport-positioned dropdown does — the
 * script writes left/top/width/max-height from the field's rect and keeps
 * them in sync while the list is open. No ancestor may create a containing
 * block for fixed elements (transform, filter, backdrop-filter, …) or the
 * clip returns.
 */
.c2net-hledani__list {
	position: fixed;
	/* Root-level stacking (the script parks the list under <body>): above
	   every page section including the footer, below the sticky Bricks
	   header (998). */
	z-index: 900;
	margin: 0;
	padding: 6px;
	list-style: none;
	text-align: left;
	/*
	 * Deliberately a literal colour, not a token. `background: var(--x)` that
	 * resolves to anything invalid computes to the INITIAL value — transparent —
	 * and the page shows straight through the open dropdown. An overlay must
	 * never depend on a variable chain it does not own.
	 */
	background-color: #0A1226;
	background-image: none;
	border: 1px solid rgba(148, 178, 255, .22);
	border-radius: var(--c2d-radius, 22px);
	box-shadow: 0 24px 64px rgba(0, 0, 0, .65), 0 0 0 1px rgba(6, 11, 24, .9);
	max-height: min(60vh, 380px); /* Overridden per open by the script. */
	overflow-y: auto;
	overscroll-behavior: contain;
}

.c2net-hledani__list[hidden] {
	display: none;
}

.c2net-hledani__option {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas: "main badge" "sub badge";
	column-gap: 12px;
	row-gap: 2px;
	padding: 10px 14px;
	margin: 0;
	border-radius: calc(var(--c2d-radius) - 6px);
	cursor: pointer;
	line-height: 1.3;
}

.c2net-hledani__option + .c2net-hledani__option {
	margin-top: 2px;
}

.c2net-hledani__option:hover,
.c2net-hledani__option.is-active {
	background: rgba(79, 227, 255, .10);
	outline: 1px solid rgba(79, 227, 255, .35);
}

.c2net-hledani__option-main {
	grid-area: main;
	font-weight: 600;
}

.c2net-hledani__option-sub {
	grid-area: sub;
	font-size: .85em;
	color: var(--c2d-muted);
}

.c2net-hledani__option .c2net-badge {
	grid-area: badge;
	align-self: center;
}

.c2net-hledani__option mark {
	background: transparent;
	color: var(--c2d-cyan);
	font-weight: 700;
}

.c2net-hledani__status {
	margin: 10px 0 0;
	min-height: 1.2em;
	font-size: .9rem;
	color: var(--c2d-muted);
	text-align: center;
}

.c2net-hledani__status:empty {
	display: none;
}

/* ---------- Badges ---------- */

.c2net-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: var(--c2d-radius-full);
	font-family: var(--c2d-mono);
	font-size: .66rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	line-height: 1.4;
	vertical-align: middle;
	white-space: nowrap;
}

.c2net-badge--on {
	color: var(--c2d-bg);
	background: var(--c2d-ok);
}

.c2net-badge--off {
	color: var(--c2d-muted);
	background: transparent;
	border: 1px solid var(--c2d-line);
}

/* ---------- Result ---------- */

/*
 * The result is not a box of its own: no frame, no background, no width cap.
 * It fills whatever the page container gives it (1180px on the C2NET site),
 * so the technology cards below get the full width. Those cards carry the
 * framing; the verdict sentence carries the state, so the previous
 * state-coloured border was redundant.
 */
.c2net-vysledek {
	max-width: none;
	padding: 0;
}

.c2net-vysledek__kicker {
	margin: 0 0 6px;
	font-family: var(--c2d-mono);
	font-size: .72rem;
	font-weight: 600;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--c2d-cyan);
}

.c2net-vysledek__adresa,
.c2net-vysledek__title {
	margin: 0;
	font-size: clamp(1.4rem, 2.6vw, 1.9rem);
	line-height: 1.15;
}

.c2net-vysledek__lokalita {
	margin: 6px 0 0;
	color: var(--c2d-muted);
}

.c2net-vysledek__ruian {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 8px;
	border: 1px solid var(--c2d-line);
	border-radius: var(--c2d-radius-full);
	font-family: var(--c2d-mono);
	font-size: .7rem;
	letter-spacing: .08em;
	vertical-align: middle;
}

.c2net-vysledek__verdict {
	margin: 18px 0 0;
	font-size: 1.05rem;
}

.c2net-vysledek__verdict strong {
	color: var(--c2d-cyan);
}

.c2net-vysledek__verdict--none {
	color: var(--c2d-text);
}

.c2net-vysledek__text,
.c2net-vysledek__empty {
	margin: 10px 0 0;
	color: var(--c2d-muted);
}

/* ---------- Result: tariff cards ----------
 * Same visual language as the homepage "Tarify pro domácnosti" section
 * (design/c2net-navrh_10.html, .plans/.plan): kicker, big speed, checklist,
 * price, button; a promotional tariff wears the gradient frame + badge.
 * These are defaults only — the Bricks element "C2NET Výsledek dostupnosti"
 * exposes controls that override them per element (#brxe-… .c2net-plan).
 */

.c2net-vysledek__head {
	max-width: 640px;
	margin: 0 auto 48px;
	text-align: center;
}

.c2net-vysledek__verdict {
	max-width: 640px;
	margin: 18px auto 48px;
	text-align: center;
}

.c2net-plans {
	/* Same footprint as the homepage "Tarify" grid: 1080px wide, gap and
	   card padding from the --space-l token the built cards use. */
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--space-l, 26px);
	align-items: stretch;
	max-width: 1080px;
	margin-inline: auto;
}

.c2net-plan {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: var(--space-l, 26px);
	background: var(--c2d-card);
	border: 1px solid var(--c2d-line);
	border-radius: var(--c2d-radius);
	transition: border-color .3s ease;
}

.c2net-plan:hover {
	border-color: rgba(148, 178, 255, .32);
}

.c2net-plan--hot {
	background:
		linear-gradient(var(--c2d-bg-raised), var(--c2d-bg-raised)) padding-box,
		var(--c2d-spectrum) border-box;
	border: 1px solid transparent;
}

.c2net-plan__badge {
	position: absolute;
	top: -15px;
	left: 50%;
	transform: translateX(-50%);
	padding: 6px 16px;
	border-radius: var(--c2d-radius-full);
	background: var(--c2d-spectrum);
	color: #071022;
	font-weight: 700;
	font-size: .74rem;
	letter-spacing: .08em;
	text-transform: uppercase;
	white-space: nowrap;
}

.c2net-plan__name {
	/* Reserve two lines so a long tariff name does not push the speed
	   figure of one card below its neighbours'. */
	display: flex;
	align-items: flex-end;
	min-height: 2.6em;
	margin: 0;
	line-height: 1.3;
	font-family: var(--c2d-mono);
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--c2d-muted);
}

.c2net-plan__speed {
	margin: 18px 0 4px;
	font-family: var(--c2d-display);
	font-weight: 700;
	font-size: clamp(2.4rem, 4vw, 3.2rem);
	letter-spacing: -.02em;
	line-height: 1;
}

.c2net-plan__speed--text {
	font-size: clamp(1.4rem, 2.4vw, 1.9rem);
	line-height: 1.15;
}

.c2net-plan__speed .unit {
	margin-left: 6px;
	font-size: .38em;
	font-weight: 500;
	color: var(--c2d-muted);
}

.c2net-plan__sub {
	margin: 0 0 26px;
	color: var(--c2d-muted);
	font-size: var(--text-s, .9rem);
}

.c2net-plan__list {
	display: grid;
	gap: 12px;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
	font-size: .96rem;
}

.c2net-plan__list li {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.c2net-plan__list li::before {
	content: "✓";
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	margin-top: 2px;
	border-radius: 50%;
	font-size: .7rem;
	font-weight: 700;
	color: #071022;
	background: var(--c2d-cyan);
}

.c2net-plan__price {
	margin-top: auto;
	padding-top: 22px;
	border-top: 1px solid var(--c2d-line);
}

.c2net-plan__price b {
	font-family: var(--c2d-mono);
	font-weight: 600;
	font-size: 1.9rem;
	letter-spacing: -.02em;
}

.c2net-plan__price s {
	margin-right: 8px;
	font-family: var(--c2d-mono);
	font-size: 1.1rem;
	color: var(--c2d-muted);
}

.c2net-plan__price span {
	color: var(--c2d-muted);
	font-size: .9rem;
}

.c2net-plan__cta {
	width: 100%;
	margin-top: 22px;
}

.c2net-plans__note {
	margin: 26px 0 0;
	text-align: center;
	color: var(--c2d-muted);
	font-size: .82rem;
}

.c2net-vysledek__actions {
	justify-content: center;
}

@media (max-width: 1023px) {
	.c2net-plans {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 720px) {
	.c2net-plans {
		grid-template-columns: 1fr;
		max-width: 460px;
		margin: 0 auto;
	}

	.c2net-plan--hot {
		order: -1;
	}
}

.c2net-vysledek__list {
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 6px;
}

.c2net-vysledek__list li {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border: 1px solid var(--c2d-line);
	border-radius: calc(var(--c2d-radius) - 6px);
}

.c2net-vysledek__list a {
	flex: 1 1 auto;
	display: grid;
	text-decoration: none;
	color: inherit;
}

.c2net-vysledek__list-sub {
	font-size: .85em;
	color: var(--c2d-muted);
}

.c2net-vysledek__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 30px 0 0;
}

@media (max-width: 478px) {
	.c2net-hledani__field {
		flex-direction: column;
		align-items: stretch;
		padding: 8px;
		border-radius: 24px;
	}

	.c2net-hledani__input {
		padding: 10px 14px;
		text-align: center;
	}

	.c2net-hledani__submit {
		width: 100%;
	}

}

@media (prefers-reduced-motion: reduce) {
	.c2net-hledani.is-loading .c2net-hledani__field::after {
		animation: none;
	}
}
