/**
 * Pricing Redesign (Task-P2, v3)
 * ================================================================
 * v3: перекрываем красный градиент из main.css через !important,
 *     ужимаем padding до размеров остальных карточек, буллеты и
 *     подпись компактно, кнопка прижата к низу через margin-top:auto.
 *
 * Откат: убрать enqueue этого файла в functions.php.
 * Старые правила .f45-price--trial в main.css не меняются.
 * ================================================================ */

/* ---------- Порядок в grid ---------- */
.f45-prices--compact .f45-prices__grid .f45-price--trial {
	order: -1;
}

/* ---------- Соседние карточки — лёгкая тонировка ---------- */
.f45-prices--compact .f45-prices__grid > .f45-price:not(.f45-price--trial) {
	background: #F7F7F9;
	border: 1px solid #EAEAEC;
}

/* ---------- Карточка Пробной: перекрываем красный градиент ----------
 * main.css задаёт !important на background/color/border — приходится тоже с !important.
 */
.f45-prices .f45-price.f45-price--trial,
.f45-prices--compact .f45-price.f45-price--trial {
	background: #FFFFFF !important;
	color: var(--f45-ink, #0B1444) !important;
	border: 2px solid rgba(230, 0, 26, 0.16) !important;
	border-radius: 14px;
	box-shadow: 0 16px 32px -14px rgba(230, 0, 26, 0.22);
	padding: 1.4rem 1.15rem 1.1rem;
	overflow: visible;
	position: relative;
}

/* Убираем радиальный gradient overlay из main.css (::before) */
.f45-price.f45-price--trial::before {
	background: none !important;
	content: "" !important;
	inset: auto !important;
}

/* Верхняя красная полоса — теперь через отдельный псевдо-элемент */
.f45-price.f45-price--trial::before {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	height: 3px !important;
	background: var(--f45-red, #E6001A) !important;
	border-radius: 14px 14px 0 0 !important;
	pointer-events: none;
}

/* Все дочерние элементы — тёмный текст (перекрываем `color:#fff` из main.css) */
.f45-price.f45-price--trial > * { position: relative; z-index: 1; }
.f45-price.f45-price--trial h4 {
	color: var(--f45-ink, #0B1444) !important;
	font-family: 'Barlow Condensed', sans-serif;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.2;
	text-transform: none;
	margin: 0.15rem 0 0.35rem;
}
.f45-price.f45-price--trial .f45-price__desc,
.f45-price.f45-price--trial .f45-price__specs,
.f45-price.f45-price--trial .f45-price__specs li,
.f45-price.f45-price--trial .f45-price__spec-label {
	color: var(--f45-ink-2, #4A5578) !important;
}
.f45-price.f45-price--trial .f45-price__specs li::before {
	background: var(--f45-red, #E6001A) !important;
	opacity: 1 !important;
}

/* Встроенный .f45-price__tag заменяем на "ЛУЧШИЙ СТАРТ" через JS.
 * Здесь только стили: красный контур на белом. */
.f45-price.f45-price--trial .f45-price__tag {
	background: #FFFFFF !important;
	color: var(--f45-red, #E6001A) !important;
	border: 1px solid rgba(230, 0, 26, 0.35);
	padding: 0.2rem 0.55rem;
	font-size: 0.72rem;
	letter-spacing: 0.08em;
}

/* Цена — крупная красная */
.f45-price.f45-price--trial .f45-price__amount {
	margin: 0.35rem 0 0.5rem;
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.5rem;
}
.f45-price.f45-price--trial .f45-price__amount strong {
	color: var(--f45-red, #E6001A) !important;
	font-family: 'Barlow Condensed', sans-serif;
	font-weight: 800;
	font-size: 1.65rem;
	line-height: 1;
}
.f45-price.f45-price--trial .f45-price__old {
	color: var(--f45-ink-2, #4A5578) !important;
}
.f45-price__amount-suffix {
	color: var(--f45-ink-2, #4A5578);
	font-size: 0.78rem;
	font-weight: 500;
}

/* Компактные буллеты (вставляются JS-ом) */
.f45-trial-bullets {
	list-style: none;
	padding: 0;
	margin: 0.25rem 0 0.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}
.f45-trial-bullets li {
	position: relative;
	padding-left: 1.35rem;
	color: var(--f45-ink, #0B1444);
	font-size: 0.82rem;
	line-height: 1.35;
}
.f45-trial-bullets li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 3px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--f45-red, #E6001A);
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 6.2 5 8.5 9.5 3.8'/></svg>");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 10px 10px;
}
/* Последний буллет — подпись «Активируется в день покупки», без галки, курсивом и мельче */
.f45-trial-bullets li.f45-trial-bullets__hint {
	padding-left: 0;
	margin-top: 0.15rem;
	color: var(--f45-ink-2, #4A5578);
	font-size: 0.72rem;
	font-style: italic;
	line-height: 1.3;
}
.f45-trial-bullets li.f45-trial-bullets__hint::before { display: none; }

/* CTA-кнопка — красная как у остальных, прижата к низу карточки.
 * Перекрываем правило main.css которое делало её белой с красным текстом.
 */
.f45-prices--compact .f45-price.f45-price--trial .f45-price__btn,
.f45-price.f45-price--trial .f45-price__btn {
	margin-top: auto;
	background: var(--f45-red, #E6001A) !important;
	color: #FFFFFF !important;
	font-weight: 700;
	border-radius: 999px;
	text-align: center;
}
.f45-prices--compact .f45-price.f45-price--trial .f45-price__btn:hover,
.f45-price.f45-price--trial .f45-price__btn:hover {
	background: #C4001A !important;
	color: #FFFFFF !important;
}

/* ---------- Shimmer у бейджа ---------- */
.f45-price.f45-price--trial .f45-price__tag {
	position: relative;
	overflow: hidden;
}
.f45-price.f45-price--trial .f45-price__tag::after {
	content: "";
	position: absolute;
	top: 0;
	left: -60%;
	width: 60%;
	height: 100%;
	background: linear-gradient(
		100deg,
		rgba(230, 0, 26, 0) 0%,
		rgba(230, 0, 26, 0.15) 50%,
		rgba(230, 0, 26, 0) 100%
	);
	animation: f45-tag-shimmer 5s ease-in-out infinite;
	animation-delay: 2s;
	pointer-events: none;
}
@keyframes f45-tag-shimmer {
	0%, 78%, 100% { transform: translateX(0); }
	85%           { transform: translateX(280%); }
}

/* ---------- Hover карточки (только desktop) ---------- */
@media (hover: hover) {
	.f45-prices--compact .f45-price.f45-price--trial:hover {
		transform: translateY(-4px);
		box-shadow: 0 24px 48px -16px rgba(230, 0, 26, 0.26);
	}
	.f45-prices--compact .f45-prices__grid > .f45-price:not(.f45-price--trial):hover {
		transform: translateY(-2px);
		box-shadow: 0 10px 24px rgba(11, 20, 68, 0.06);
	}
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
	.f45-prices .f45-price.f45-price--trial,
	.f45-prices--compact .f45-price.f45-price--trial {
		padding: 1.35rem 1.1rem 1rem;
	}
	.f45-price.f45-price--trial h4 { font-size: 1.1rem; }
	.f45-price.f45-price--trial .f45-price__amount strong { font-size: 1.55rem; }
}

/* ---------- prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.f45-price.f45-price--trial .f45-price__tag::after {
		animation: none !important;
	}
	.f45-prices--compact .f45-price.f45-price--trial {
		transition: none !important;
	}
	.f45-prices--compact .f45-price.f45-price--trial:hover {
		transform: none !important;
	}
}
