/**
 * AhojNet — Balíky služieb (cenník).
 * Farby a rozmery sú CSS premenné — Elementor ich prepisuje v záložke Štýl.
 */

/* ----------------------------------------------------------------------
 * Premenné (predvolené hodnoty, svetlý vzhľad)
 * -------------------------------------------------------------------- */
.ahn-plans {
	--ahn-plans-cols: var(--ahn-plans-auto-cols, 3);
	--ahn-plans-gap: 24px;
	--ahn-plans-card-max: 440px;
	--ahn-plans-pad: 32px;
	--ahn-plans-radius: 14px;
	--ahn-plans-bg: #ffffff;
	--ahn-plans-text: #111827;
	--ahn-plans-muted: #6b7280;
	--ahn-plans-border: #e5e7eb;
	--ahn-plans-border-w: 1px;
	--ahn-plans-highlight: #2563eb;
	--ahn-plans-highlight-text: #ffffff;
	--ahn-plans-current-bg: #f5f8ff;
	--ahn-plans-check: #111827;
	--ahn-plans-btn-bg: #111827;
	--ahn-plans-btn-text: #ffffff;
	--ahn-plans-btn-bg-hover: #374151;
	--ahn-plans-btn-text-hover: #ffffff;
	--ahn-plans-btn-radius: 10px;
	--ahn-plans-switch-bg: #f3f4f6;
	--ahn-plans-switch-text: #4b5563;
	--ahn-plans-switch-active-bg: #111827;
	--ahn-plans-switch-active-text: #ffffff;
	--ahn-plans-link: #2563eb;
	--ahn-plans-focus: #2563eb;

	color: var(--ahn-plans-text);
	line-height: 1.5;
}

/* Tmavý vzhľad (karty na tmavom pozadí) */
.ahn-plans--dark {
	--ahn-plans-bg: #1a1a1a;
	--ahn-plans-text: #ffffff;
	--ahn-plans-muted: #a3a3a3;
	--ahn-plans-border: #2e2e2e;
	--ahn-plans-highlight: #7aa7ff;
	--ahn-plans-highlight-text: #0b1220;
	--ahn-plans-current-bg: #1f2633;
	--ahn-plans-check: #ffffff;
	--ahn-plans-btn-bg: #e5e5e5;
	--ahn-plans-btn-text: #111111;
	--ahn-plans-btn-bg-hover: #ffffff;
	--ahn-plans-btn-text-hover: #111111;
	--ahn-plans-switch-bg: #262626;
	--ahn-plans-switch-text: #d4d4d4;
	--ahn-plans-switch-active-bg: #ffffff;
	--ahn-plans-switch-active-text: #111111;
	--ahn-plans-link: #a8c7fa;
	--ahn-plans-focus: #a8c7fa;
}

.ahn-plans *,
.ahn-plans *::before,
.ahn-plans *::after {
	box-sizing: border-box;
}

/* Skryté obdobie musí ostať skryté aj pri display:flex nižšie. */
.ahn-plans [hidden] {
	display: none !important;
}

/* ----------------------------------------------------------------------
 * Prepínač období
 * -------------------------------------------------------------------- */
.ahn-plans__switch {
	display: flex;
	width: fit-content;
	max-width: 100%;
	margin: 0 auto;
	padding: 4px;
	gap: 4px;
	border-radius: 999px;
	background: var(--ahn-plans-switch-bg);
}

.ahn-plans .ahn-plans__switch-btn {
	appearance: none;
	min-width: 120px;
	margin: 0;
	padding: 10px 24px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	color: var(--ahn-plans-switch-text);
	font: inherit;
	font-weight: 600;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ahn-plans .ahn-plans__switch-btn:hover {
	background: transparent;
	color: var(--ahn-plans-text);
}

.ahn-plans .ahn-plans__switch-btn.is-active {
	background: var(--ahn-plans-switch-active-bg);
	color: var(--ahn-plans-switch-active-text);
}

.ahn-plans__hint {
	margin: 12px 0 0;
	color: var(--ahn-plans-muted);
	font-size: 0.95em;
	text-align: center;
}

/* ----------------------------------------------------------------------
 * Mriežka kariet
 * Presne --ahn-plans-cols stĺpcov, kým má každá karta aspoň 250 px;
 * inak sa karty zalomia pod seba (bez media queries).
 * -------------------------------------------------------------------- */
.ahn-plans__grid {
	display: grid;
	grid-template-columns: repeat(
		auto-fit,
		minmax(
			min(100%, max(250px, calc((100% - (var(--ahn-plans-cols) - 1) * var(--ahn-plans-gap)) / var(--ahn-plans-cols)))),
			1fr
		)
	);
	gap: var(--ahn-plans-gap);
	max-width: calc(var(--ahn-plans-cols) * var(--ahn-plans-card-max) + (var(--ahn-plans-cols) - 1) * var(--ahn-plans-gap));
	margin: 0 auto;
	padding-top: 14px; /* Miesto pre štítky na hornom okraji kariet. */
}

.ahn-plans__switch + .ahn-plans__grid,
.ahn-plans__hint + .ahn-plans__grid {
	margin-top: 22px;
}

/* ----------------------------------------------------------------------
 * Karta ponuky
 * -------------------------------------------------------------------- */
.ahn-plans__card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: var(--ahn-plans-pad);
	border: var(--ahn-plans-border-w) solid var(--ahn-plans-border);
	border-radius: var(--ahn-plans-radius);
	background: var(--ahn-plans-bg);
	color: var(--ahn-plans-text);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Odporúčaná ponuka a aktuálny plán: zvýraznený rámik (tieň nemení rozmery karty). */
.ahn-plans__card.is-featured,
.ahn-plans__card.is-current {
	border-color: var(--ahn-plans-highlight);
	box-shadow: 0 0 0 1px var(--ahn-plans-highlight);
}

.ahn-plans__card.is-current {
	background: var(--ahn-plans-current-bg);
}

.ahn-plans__badge,
.ahn-plans__tag {
	position: absolute;
	top: 0;
	max-width: calc(50% - var(--ahn-plans-pad));
	padding: 3px 12px;
	overflow: hidden;
	border: 1px solid var(--ahn-plans-highlight);
	border-radius: 999px;
	font-size: 0.75em;
	font-weight: 700;
	line-height: 1.5;
	text-overflow: ellipsis;
	white-space: nowrap;
	transform: translateY(-50%);
}

/* Štítky sedia na hornom okraji karty, aby neposúvali obsah —
   názvy, ceny a odrážky ostanú v kartách v jednej línii. */
.ahn-plans__badge {
	left: var(--ahn-plans-pad);
	background: var(--ahn-plans-highlight);
	color: var(--ahn-plans-highlight-text);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.ahn-plans__tag {
	right: var(--ahn-plans-pad);
	background: var(--ahn-plans-bg);
	color: var(--ahn-plans-highlight);
}

.ahn-plans .ahn-plans__name {
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: 1.5em;
	font-weight: 700;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.ahn-plans__desc {
	margin: 8px 0 0;
	color: var(--ahn-plans-muted);
	font-size: 0.95em;
}

/* ----------------------------------------------------------------------
 * Obdobie v karte (cena, odrážky, tlačidlo)
 * -------------------------------------------------------------------- */
.ahn-plans__panel {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	margin-top: 20px;
}

.ahn-plans__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 2px;
	margin: 0;
}

.ahn-plans__amount {
	font-size: 2em;
	font-weight: 700;
	line-height: 1.15;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.ahn-plans__period {
	color: var(--ahn-plans-muted);
	font-size: 1em;
	white-space: nowrap;
}

.ahn-plans__unavailable {
	margin: 0;
	color: var(--ahn-plans-muted);
}

.ahn-plans .ahn-plans__features {
	flex: 1 1 auto;
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
}

.ahn-plans .ahn-plans__feature {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
	padding: 12px 0;
	border-bottom: 1px solid var(--ahn-plans-border);
	list-style: none;
}

.ahn-plans .ahn-plans__feature:last-child {
	border-bottom: 0;
}

.ahn-plans__icon {
	flex: 0 0 auto;
	margin-top: 0.2em;
	color: var(--ahn-plans-check);
}

.ahn-plans__feature.is-excluded {
	color: var(--ahn-plans-muted);
}

.ahn-plans__feature.is-excluded .ahn-plans__icon {
	color: var(--ahn-plans-muted);
}

/* ----------------------------------------------------------------------
 * Tlačidlo a spodný odkaz
 * -------------------------------------------------------------------- */
.ahn-plans__foot {
	margin-top: auto;
	padding-top: 28px;
}

.ahn-plans a.ahn-plans__btn {
	display: block;
	width: 100%;
	padding: 14px 20px;
	border: 2px solid var(--ahn-plans-btn-bg);
	border-radius: var(--ahn-plans-btn-radius);
	background: var(--ahn-plans-btn-bg);
	color: var(--ahn-plans-btn-text);
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ahn-plans a.ahn-plans__btn:hover,
.ahn-plans a.ahn-plans__btn:focus-visible {
	border-color: var(--ahn-plans-btn-bg-hover);
	background: var(--ahn-plans-btn-bg-hover);
	color: var(--ahn-plans-btn-text-hover);
	text-decoration: none;
}

/* Vedľajšie akcie (aktuálny plán, nižší balík, iné obdobie): obrysové tlačidlo. */
.ahn-plans a.ahn-plans__btn--current,
.ahn-plans a.ahn-plans__btn--downgrade,
.ahn-plans a.ahn-plans__btn--cycle,
.ahn-plans a.ahn-plans__btn--manage {
	border-color: var(--ahn-plans-border);
	background: transparent;
	color: var(--ahn-plans-text);
}

.ahn-plans a.ahn-plans__btn--current:hover,
.ahn-plans a.ahn-plans__btn--current:focus-visible,
.ahn-plans a.ahn-plans__btn--downgrade:hover,
.ahn-plans a.ahn-plans__btn--downgrade:focus-visible,
.ahn-plans a.ahn-plans__btn--cycle:hover,
.ahn-plans a.ahn-plans__btn--cycle:focus-visible,
.ahn-plans a.ahn-plans__btn--manage:hover,
.ahn-plans a.ahn-plans__btn--manage:focus-visible {
	border-color: var(--ahn-plans-text);
	background: transparent;
	color: var(--ahn-plans-text);
}

.ahn-plans .ahn-plans__alt {
	appearance: none;
	display: flex;
	align-items: center;
	gap: 6px;
	width: 100%;
	margin: 24px 0 0;
	padding: 16px 0 0;
	border: 0;
	border-top: 1px solid var(--ahn-plans-border);
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--ahn-plans-link);
	font: inherit;
	font-size: 0.95em;
	font-weight: 500;
	line-height: 1.4;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	white-space: normal;
	cursor: pointer;
}

.ahn-plans .ahn-plans__alt:hover {
	background: transparent;
	color: var(--ahn-plans-link);
}

.ahn-plans .ahn-plans__alt:hover .ahn-plans__alt-text {
	text-decoration: underline;
}

.ahn-plans__alt-arrow {
	flex: 0 0 auto;
}

/* ----------------------------------------------------------------------
 * Klávesnica a prístupnosť
 * -------------------------------------------------------------------- */
.ahn-plans .ahn-plans__switch-btn:focus-visible,
.ahn-plans a.ahn-plans__btn:focus-visible,
.ahn-plans .ahn-plans__alt:focus-visible {
	outline: 2px solid var(--ahn-plans-focus);
	outline-offset: 2px;
}

@media (max-width: 480px) {
	.ahn-plans {
		--ahn-plans-pad: 24px;
	}

	.ahn-plans__switch {
		width: 100%;
	}

	.ahn-plans .ahn-plans__switch-btn {
		flex: 1 1 0;
		min-width: 0;
		padding: 10px 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ahn-plans__card,
	.ahn-plans .ahn-plans__switch-btn,
	.ahn-plans a.ahn-plans__btn {
		transition: none;
	}
}
