/**
 * فروش پلاس — استایل بخش کاربری
 * همهٔ رنگ‌ها از متغیرهای CSS خوانده می‌شوند تا از پنل تنظیمات قابل تغییر باشند.
 */

.forosh-plus {
	--fp-primary: #00857a;
	--fp-accent: #e8a33d;
	--fp-ink: #16221f;
	--fp-muted: #63736f;
	--fp-surface: #ffffff;
	--fp-selected: #f0faf8;
	--fp-border: #e1e7e5;
	--fp-radius: 12px;
	--fp-font: inherit;

	direction: rtl;
	font-family: var(--fp-font);
	color: var(--fp-ink);
	margin: 22px 0;
	text-align: right;
	line-height: 1.7;
	box-sizing: border-box;
}

.forosh-plus *,
.forosh-plus *::before,
.forosh-plus *::after {
	box-sizing: inherit;
}

/* ---------- سرتیتر ---------- */

.fp-head {
	margin-bottom: 14px;
}

.fp-head__title {
	margin: 0 0 4px;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--fp-ink);
	line-height: 1.5;
}

.fp-head__sub {
	margin: 0;
	font-size: 0.86rem;
	color: var(--fp-muted);
}

/* ---------- تایمر ---------- */

.fp-timer {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
	padding: 5px 12px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--fp-accent) 14%, transparent);
	font-size: 0.8rem;
}

.fp-timer__label {
	color: var(--fp-muted);
}

.fp-timer__clock {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--fp-ink);
}

/* ---------- ردیف‌های تخفیف حجمی ---------- */

.fp-tiers {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.fp-tier {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px !important;
	border: 1.5px solid var(--fp-border) !important;
	border-radius: var(--fp-radius) !important;
	background: var(--fp-surface) !important;
	color: var(--fp-ink);
	cursor: pointer;
	transition: border-color 0.18s ease, background-color 0.18s ease;
	margin: 0 !important;
	box-shadow: none !important;
}

.fp-tier:hover {
	border-color: color-mix(in srgb, var(--fp-primary) 45%, var(--fp-border)) !important;
}

.fp-tier.is-selected {
	border-color: var(--fp-primary) !important;
	background: var(--fp-selected) !important;
}

.fp-tier.is-highlight:not(.is-selected) {
	border-color: color-mix(in srgb, var(--fp-primary) 60%, var(--fp-border)) !important;
}

.fp-tier__radio {
	position: absolute !important;
	inset-inline-start: 0 !important;
	top: 0 !important;
	opacity: 0 !important;
	width: 1px !important;
	height: 1px !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	pointer-events: none !important;
}

.fp-tier__radio:focus-visible ~ .fp-tier__mark {
	outline: 2px solid var(--fp-primary);
	outline-offset: 3px;
}

.fp-tier__mark {
	flex: 0 0 auto;
	width: 20px !important;
	height: 20px !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 2px solid var(--fp-border) !important;
	border-radius: 50% !important;
	background: #fff !important;
	box-shadow: none !important;
	position: relative;
	transition: border-color 0.18s ease;
}

.fp-tier.is-selected .fp-tier__mark {
	border-color: var(--fp-primary) !important;
}

.fp-tier.is-selected .fp-tier__mark::after {
	content: "" !important;
	position: absolute !important;
	inset: 3px !important;
	border-radius: 50% !important;
	background: var(--fp-primary) !important;
	display: block !important;
}

.fp-tier__body {
	flex: 1 1 auto;
	min-width: 0;
}

.fp-tier__row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.fp-tier__label {
	font-weight: 700;
	font-size: 0.97rem;
}

.fp-tier__badge {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	background: var(--fp-accent);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.7;
	white-space: nowrap;
}

.fp-tier__sub {
	display: block;
	font-size: 0.82rem;
	color: var(--fp-muted);
	margin-top: 2px;
}

.fp-tier__pricing {
	flex: 0 0 auto;
	text-align: left;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.fp-tier__price {
	font-weight: 700;
	font-size: 1rem;
	white-space: nowrap;
}

.fp-tier__was {
	font-size: 0.8rem;
	color: var(--fp-muted);
	opacity: 0.85;
	white-space: nowrap;
}

.fp-tier__save {
	position: absolute;
	top: -9px;
	inset-inline-start: 14px;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--fp-primary);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1.8;
	white-space: nowrap;
}

/* قالب فشرده: ردیف‌های باریک و افقی، مناسب فضای کم */

.fp-template-compact .fp-tiers {
	gap: 6px;
}

.fp-template-compact .fp-tier {
	padding: 8px 10px;
	gap: 8px;
	border-radius: calc(var(--fp-radius) / 2);
}

.fp-template-compact .fp-tier__mark {
	width: 16px;
	height: 16px;
}

.fp-template-compact .fp-tier__row {
	gap: 6px;
}

.fp-template-compact .fp-tier__label {
	font-size: 0.85rem;
}

.fp-template-compact .fp-tier__sub {
	display: none;
}

.fp-template-compact .fp-tier__badge {
	font-size: 0.66rem;
	padding: 1px 7px;
}

.fp-template-compact .fp-tier__price {
	font-size: 0.9rem;
}

.fp-template-compact .fp-tier__was {
	font-size: 0.72rem;
}

.fp-template-compact .fp-tier__save {
	display: none;
}

.fp-template-compact .fp-head {
	margin-bottom: 8px;
}

/* قالب ساده: بدون کادر و پس‌زمینه، فقط یک لیست با خط جداکننده */

.fp-template-minimal .fp-tiers {
	gap: 0;
}

.fp-template-minimal .fp-tier {
	border: none;
	border-bottom: 1px solid var(--fp-border);
	border-radius: 0;
	background: transparent;
	padding: 12px 2px;
}

.fp-template-minimal .fp-tiers .fp-tier:last-child {
	border-bottom: none;
}

.fp-template-minimal .fp-tier:hover {
	background: transparent;
	border-bottom-color: var(--fp-primary);
}

.fp-template-minimal .fp-tier.is-selected {
	background: transparent;
}

.fp-template-minimal .fp-tier__badge {
	background: transparent;
	color: var(--fp-primary);
	border: 1px solid var(--fp-primary);
}

.fp-template-minimal .fp-tier__save {
	display: none;
}

/* ---------- باندل ---------- */

.fp-bundle {
	border: 1.5px solid var(--fp-border);
	border-radius: var(--fp-radius);
	background: var(--fp-surface);
	padding: 18px;
}

.fp-bundle__items {
	display: flex;
	align-items: stretch;
	gap: 8px;
	flex-wrap: wrap;
}

.fp-bundle__item {
	flex: 1 1 130px;
	min-width: 120px;
	padding: 12px;
	border: 1px solid var(--fp-border);
	border-radius: calc(var(--fp-radius) - 4px);
	text-align: center;
	background: #fff;
}

.fp-bundle__thumb img,
.fp-bundle__thumb .fp-bundle__img {
	width: 100%;
	height: auto;
	max-width: 88px;
	margin: 0 auto 8px;
	display: block;
	border-radius: 6px;
}

.fp-bundle__name {
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.5;
	margin-bottom: 4px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.fp-bundle__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 0.78rem;
	color: var(--fp-muted);
}

.fp-bundle__price {
	font-weight: 700;
	color: var(--fp-ink);
}

.fp-bundle__plus {
	align-self: center;
	font-size: 1.3rem;
	font-weight: 300;
	color: var(--fp-muted);
	padding: 0 2px;
}

.fp-bundle__footer {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 12px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px dashed var(--fp-border);
}

.fp-bundle__totals {
	display: flex;
	align-items: baseline;
	gap: 8px;
	flex-wrap: wrap;
}

.fp-bundle__final {
	font-size: 1.25rem;
	font-weight: 700;
}

.fp-bundle__was {
	color: var(--fp-muted);
	font-size: 0.9rem;
}

.fp-bundle__save {
	padding: 2px 9px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--fp-primary) 12%, transparent);
	color: var(--fp-primary);
	font-size: 0.76rem;
	font-weight: 700;
}

.fp-bundle__button {
	display: flex !important;
	width: 100% !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 0;
	box-sizing: border-box !important;
	padding: 14px !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: var(--fp-radius) !important;
	background: var(--fp-primary) !important;
	color: #fff !important;
	font-family: inherit !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	line-height: 1.4 !important;
	text-align: center;
	cursor: pointer !important;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
	transition: filter 0.18s ease, transform 0.18s ease !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}

.fp-bundle__button:hover:not(:disabled) {
	filter: brightness(1.08);
}

.fp-bundle__button:active:not(:disabled) {
	transform: translateY(1px);
}

.fp-bundle__button:disabled {
	opacity: 0.65;
	cursor: progress !important;
}

.fp-bundle__button:focus-visible {
	outline: 2px solid var(--fp-ink);
	outline-offset: 2px;
}

.fp-spinner {
	display: none;
	width: 15px;
	height: 15px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: fp-spin 0.7s linear infinite;
}

.fp-bundle__button.is-loading .fp-spinner {
	display: inline-block;
}

@keyframes fp-spin {
	to {
		transform: rotate(360deg);
	}
}

.fp-bundle__message {
	margin: 12px 0 0;
	font-size: 0.86rem;
	min-height: 1.2em;
}

.fp-bundle__message.is-error {
	color: #c2453c;
}

.fp-bundle__message.is-success {
	color: var(--fp-primary);
	font-weight: 600;
}

/* ---------- نوار هدیه ---------- */

.fp-gift {
	border: 1.5px dashed var(--fp-border);
	border-radius: var(--fp-radius);
	padding: 14px 16px;
	background: var(--fp-surface);
}

.fp-gift.is-reached {
	border-style: solid;
	border-color: var(--fp-primary);
	background: var(--fp-selected);
}

.fp-gift__inner {
	display: flex;
	align-items: center;
	gap: 14px;
}

.fp-gift__thumb img {
	width: 52px;
	height: 52px;
	object-fit: cover;
	border-radius: 8px;
	display: block;
}

.fp-gift__content {
	flex: 1 1 auto;
	min-width: 0;
}

.fp-gift__text {
	margin: 0 0 8px;
	font-size: 0.9rem;
}

.fp-gift__product {
	display: block;
	font-size: 0.8rem;
	color: var(--fp-muted);
}

.fp-gift__bar {
	height: 7px;
	border-radius: 999px;
	background: var(--fp-border);
	overflow: hidden;
}

.fp-gift__fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--fp-primary);
	transition: width 0.4s ease;
}

/* ---------- برچسب هدیه در سبد ---------- */

.fp-gift-tag {
	display: inline-block;
	margin-inline-start: 6px;
	padding: 1px 8px;
	border-radius: 999px;
	background: #00857a;
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
}

.fp-gift-qty {
	display: inline-block;
	font-weight: 700;
}

/* ---------- موبایل ---------- */

@media (max-width: 560px) {
	.fp-tier {
		padding: 12px;
		gap: 9px;
	}

	.fp-tier__price {
		font-size: 0.92rem;
	}

	.fp-bundle__plus {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.forosh-plus *,
	.forosh-plus *::before,
	.forosh-plus *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
