/*
 * Farin cart page, and the steps bar shared with checkout and thank-you.
 * Rows: head (steps, title), main (items | summary), foot (suggestions).
 */

.fc {
	box-sizing: border-box;
	max-inline-size: var(--fc-max);
	margin-inline: auto;
	padding: 24px 24px 48px;
	color: #1d1730;
	font-size: 14px;
	line-height: 1.8;
}

.fc *,
.fc *::before,
.fc *::after {
	box-sizing: border-box;
}

.fc a {
	color: inherit;
	text-decoration: none;
}

.fc :focus-visible {
	outline: 2px solid var(--fc-accent);
	outline-offset: 2px;
	border-radius: 8px;
}

.fc button {
	font: inherit;
	color: inherit;
}

.fc ul,
.fc ol,
.fc dl {
	margin: 0;
	padding: 0;
	list-style: none;
}

.fc h1,
.fc h2,
.fc p {
	margin: 0;
}

.fc-widget {
	max-inline-size: none;
	padding: 0;
}

.fc[aria-busy="true"] {
	cursor: progress;
}

.fc[aria-busy="true"] .fc__row--main {
	opacity: 0.6;
	transition: opacity 0.2s;
}

/* ---------- Rows ---------- */

.fc__row + .fc__row {
	margin-block-start: 24px;
}

.fc__row--main {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--fc-side);
	gap: 24px;
	align-items: start;
}

.fc__row--main > :only-child {
	grid-column: 1 / -1;
}

.fc__zone {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-inline-size: 0;
}

.fc__row--head .fc__zone {
	gap: 24px;
}

.fc__zone.is-sticky {
	position: sticky;
	inset-block-start: calc(var(--wp-admin--admin-bar--height, 0px) + 24px);
}

.fc-card {
	padding: 20px 24px;
	border: 1px solid var(--fc-line);
	border-radius: var(--fc-radius);
	background: var(--fc-card);
	box-shadow: 0 10px 30px rgb(20 16 40 / 0.04);
}

/* ---------- Steps ---------- */

.fsteps {
	--accent: #7b2cbf;
	display: flex;
	max-inline-size: 900px;
	margin: 0 auto !important;
	padding: 0 !important;
	list-style: none;
	counter-reset: none;
}

.fsteps li {
	position: relative;
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	color: #8b8698;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
}

.fsteps li + li::before {
	content: "";
	position: absolute;
	inset-block-start: 19px;
	inset-inline-end: calc(50% + 24px);
	inline-size: calc(100% - 48px);
	block-size: 3px;
	border-radius: 3px;
	background: #e7e3ee;
}

.fsteps li.is-done + li::before,
.fsteps li.is-current::before {
	background: var(--accent);
}

.fsteps__dot {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	inline-size: 40px;
	block-size: 40px;
	border: 2px solid #e7e3ee;
	border-radius: 50%;
	background: #fff;
	font-weight: 800;
}

.fsteps li.is-done .fsteps__dot {
	border-color: var(--accent);
	background: var(--accent);
	color: #fff;
}

.fsteps li.is-current {
	color: #1d1730;
}

.fsteps li.is-current .fsteps__dot {
	border-color: var(--accent);
	background: #1d1730;
	box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent);
	color: #fff;
}

.fsteps li.is-done {
	color: var(--accent);
}

/* ---------- Title, free shipping ---------- */

.fc-title {
	display: flex;
	align-items: center;
	gap: 16px;
}

.fc-title__icon {
	display: grid;
	flex: none;
	place-items: center;
	inline-size: 56px;
	block-size: 56px;
	border-radius: 16px;
	background: color-mix(in srgb, var(--fc-accent) 10%, transparent);
	color: var(--fc-accent);
}

.fc-title h1 {
	font-size: 24px;
	font-weight: 800;
	line-height: 1.4;
}

.fc-title p {
	color: var(--fc-muted);
}

.fc-free {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 20px;
	border-radius: var(--fc-radius);
	background: color-mix(in srgb, var(--fc-accent) 7%, #fff);
}

.fc-free__icon {
	display: grid;
	flex: none;
	place-items: center;
	inline-size: 44px;
	block-size: 44px;
	border-radius: 12px;
	background: #fff;
	color: var(--fc-accent);
}

.fc-free__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 8px;
}

.fc-free b {
	color: var(--fc-accent);
}

.fc-free__bar {
	block-size: 8px;
	overflow: hidden;
	border-radius: 8px;
	background: color-mix(in srgb, var(--fc-accent) 15%, #fff);
}

.fc-free__bar span {
	display: block;
	block-size: 100%;
	border-radius: inherit;
	background: var(--fc-accent);
	transition: inline-size 0.4s;
}

.fc-free.is-done {
	background: color-mix(in srgb, var(--fc-ok) 10%, #fff);
	color: var(--fc-ok);
	font-weight: 700;
}

.fc-free.is-done .fc-free__icon {
	color: var(--fc-ok);
}

.fc-free.is-done .fc-free__bar span {
	background: var(--fc-ok);
}

/* ---------- Items ---------- */

.fc-items {
	padding-block: 8px;
}

.fc-items__head,
.fc-items__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-block: 12px;
}

.fc-items__head {
	border-block-end: 1px solid var(--fc-line);
}

.fc-check {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	cursor: pointer;
}

.fc-check input {
	inline-size: 22px;
	block-size: 22px;
	margin: 0;
	accent-color: var(--fc-ok);
	cursor: pointer;
}

.fc-item {
	display: grid;
	grid-template-columns: auto 96px minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 18px;
	padding-block: 18px;
	border-block-end: 1px solid var(--fc-line);
}

.fc-item__img {
	inline-size: 96px;
	block-size: 96px;
	padding: 6px;
	border-radius: 16px;
	background: var(--fc-soft);
	object-fit: contain;
}

.fc-item__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-inline-size: 0;
}

.fc-item__name {
	font-size: 16px;
	font-weight: 800;
	line-height: 1.6;
}

.fc-item__name a:hover {
	color: var(--fc-accent);
}

.fc-item__sub {
	color: color-mix(in srgb, #1d1730 70%, transparent);
}

.fc-item__attrs {
	display: flex;
	flex-wrap: wrap;
	color: var(--fc-muted);
	font-size: 12px;
}

.fc-item__attrs span + span::before {
	content: "|";
	margin-inline: 8px;
	opacity: 0.5;
}

.fc-item__stock {
	color: var(--fc-sale);
	font-size: 12px;
	font-weight: 700;
}

.fc-item__tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	max-inline-size: 220px;
}

.fc-item__tools .fc-link {
	flex-basis: 100%;
	justify-content: center;
	font-size: 12px;
}

.fc-qty {
	display: inline-flex;
	align-items: center;
	border: 1.5px solid var(--fc-line);
	border-radius: 12px;
	background: #fff;
}

.fc-qty button {
	display: grid;
	place-items: center;
	inline-size: 40px;
	block-size: 44px;
	border: 0;
	background: none;
	color: var(--fc-muted);
	cursor: pointer;
}

.fc-qty button:hover:not(:disabled) {
	color: var(--fc-accent);
}

.fc-qty button:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.fc-qty input {
	inline-size: 40px;
	border: 0;
	background: none;
	font: inherit;
	font-weight: 800;
	text-align: center;
	appearance: textfield;
	-moz-appearance: textfield;
}

.fc-qty input::-webkit-inner-spin-button,
.fc-qty input::-webkit-outer-spin-button {
	margin: 0;
	appearance: none;
}

.fc-qty.is-single {
	padding: 10px 16px;
	font-weight: 800;
}

.fc-icon-btn {
	display: grid;
	place-items: center;
	inline-size: 44px;
	block-size: 44px;
	border: 1.5px solid var(--fc-line);
	border-radius: 12px;
	background: #fff;
	color: var(--fc-muted);
	cursor: pointer;
}

.fc-icon-btn:hover {
	border-color: var(--fc-sale);
	color: var(--fc-sale);
}

.fc-item__price {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	min-inline-size: 150px;
	text-align: end;
}

.fc-item__price b {
	font-size: 17px;
	font-weight: 800;
}

.fc-item__was {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--fc-muted);
	font-size: 12px;
}

.fc-off {
	padding: 1px 8px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--fc-sale) 12%, transparent);
	color: var(--fc-sale);
	font-weight: 700;
	white-space: nowrap;
}

.fc-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 4px;
	border: 0;
	background: none;
	color: var(--fc-accent) !important;
	font-weight: 600;
	cursor: pointer;
}

.fc-link.is-danger {
	color: var(--fc-sale) !important;
}

.fc-link:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.fc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-block-size: 48px;
	padding-inline: 20px;
	border: 1.5px solid transparent;
	border-radius: 12px;
	background: var(--fc-accent);
	color: #fff !important;
	font-weight: 700;
	cursor: pointer;
	transition: filter 0.2s, border-color 0.2s;
}

.fc-btn:hover {
	filter: brightness(1.06);
}

.fc-btn.is-ghost {
	border-color: var(--fc-line);
	background: #fff;
	color: #1d1730 !important;
}

.fc-btn.is-ghost:hover {
	border-color: var(--fc-accent);
	color: var(--fc-accent) !important;
	filter: none;
}

.fc-btn.is-small {
	min-block-size: 40px;
	padding-inline: 14px;
	font-size: 13px;
}

.fc-btn.is-main {
	inline-size: 100%;
	min-block-size: 54px;
	font-size: 16px;
}

/* ---------- Saved for later ---------- */

.fc-saved h2 {
	margin-block-end: 12px;
	font-size: 17px;
	font-weight: 800;
}

.fc-saved h2 small {
	color: var(--fc-muted);
	font-weight: 500;
}

.fc-saved__item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-block: 12px;
	border-block-start: 1px solid var(--fc-line);
}

.fc-saved__item img {
	border-radius: 12px;
	background: var(--fc-soft);
	object-fit: contain;
}

.fc-saved__item > div:first-of-type {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-inline-size: 0;
}

.fc-saved__item a {
	font-weight: 700;
}

.fc-saved__tools {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* ---------- Banner and summary ---------- */

.fc-banner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-block-size: 108px;
	padding: 16px 20px;
	overflow: hidden;
	border-radius: var(--fc-radius);
	background: color-mix(in srgb, var(--fc-accent) 9%, #fff);
	color: var(--fc-accent);
}

.fc-banner__text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	color: #1d1730;
}

.fc-banner__text b {
	font-size: 17px;
}

.fc-banner__text span {
	color: var(--fc-muted);
	font-size: 13px;
}

.fc-banner__img {
	max-block-size: 96px;
	inline-size: auto;
	object-fit: contain;
}

.fc-banner__go {
	position: absolute;
	inset-block-end: 12px;
	inset-inline-end: 12px;
	display: grid;
	place-items: center;
	inline-size: 36px;
	block-size: 36px;
	border-radius: 50%;
	background: #fff;
	color: #1d1730;
}

.fc-art {
	flex: none;
	color: var(--fc-accent);
}

.fc-sum h2 {
	margin-block-end: 16px;
	font-size: 19px;
	font-weight: 800;
}

.fc-sum__row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding-block: 6px;
}

.fc-sum__row dt {
	color: color-mix(in srgb, #1d1730 72%, transparent);
}

.fc-sum__row dd {
	margin: 0;
	font-weight: 700;
}

.fc-sum__row.is-off dd {
	color: var(--fc-sale);
}

.fc-sum .is-ok {
	color: var(--fc-ok);
	font-weight: 800;
}

.fc-sum .is-muted {
	color: var(--fc-muted);
	font-weight: 500;
}

.fc-coupon {
	display: flex;
	gap: 8px;
	margin-block-start: 12px;
}

.fc-coupon input {
	flex: 1;
	min-inline-size: 0;
	min-block-size: 44px;
	padding-inline: 14px;
	border: 1.5px solid var(--fc-line);
	border-radius: 12px;
	font: inherit;
}

.fc-sum__total {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-block: 16px;
	padding-block-start: 16px;
	border-block-start: 1px solid var(--fc-line);
	font-weight: 800;
}

.fc-sum__total b {
	color: inherit;
	font-size: 24px;
}

.fc-sum .fc-btn + .fc-btn {
	inline-size: 100%;
	margin-block-start: 10px;
}

.fc-svc {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
	gap: 12px;
	text-align: center;
}

.fc-svc li {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	line-height: 1.5;
}

.fc-svc__icon {
	display: grid;
	place-items: center;
	inline-size: 52px;
	block-size: 52px;
	margin-block-end: 6px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--fc-accent) 10%, transparent);
	color: var(--fc-accent);
}

.fc-svc b {
	font-size: 13px;
}

.fc-svc small {
	color: var(--fc-muted);
	font-size: 12px;
}

/* ---------- Suggestions ---------- */

.fc-cross {
	padding: 20px 24px 24px;
	border-radius: var(--fc-radius);
	background: color-mix(in srgb, var(--fc-accent) 7%, #fff);
}

.fc-cross__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-block-end: 16px;
}

.fc-cross__head h2 {
	font-size: 18px;
	font-weight: 800;
}

.fc-cross__head p {
	color: var(--fc-muted);
}

.fc-cross__nav {
	display: flex;
	gap: 8px;
}

.fc-cross__nav button {
	display: grid;
	place-items: center;
	inline-size: 44px;
	block-size: 44px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 4px 12px rgb(20 16 40 / 0.08);
	cursor: pointer;
}

.fc-cross__nav [data-scroll="-1"] svg {
	transform: rotate(-90deg);
}

.fc-cross__nav [data-scroll="1"] svg {
	transform: rotate(90deg);
}

.fc-cross__body {
	display: flex;
	gap: 16px;
}

.fc-promo {
	display: flex;
	flex: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	inline-size: 190px;
	text-align: center;
}

.fc-promo b {
	font-size: 16px;
}

.fc-promo small {
	color: var(--fc-muted);
}

.fc-cross__track {
	display: flex;
	flex: 1;
	/* RTL scrollers in a flex row still widened the page in Chrome; keep their cards inside. */
	contain: paint;
	gap: 12px;
	min-inline-size: 0;
	padding-block-end: 4px !important;
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.fc-cross__track::-webkit-scrollbar {
	display: none;
}

.fc-pcard {
	display: flex;
	flex: 0 0 168px;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 14px 12px;
	border-radius: 16px;
	background: #fff;
	text-align: center;
	scroll-snap-align: start;
}

/* The picture-and-name link stacks; the «افزودن» link (a variable product) stays a button. */
.fc-pcard a:not(.fc-btn) {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.fc-pcard img {
	inline-size: 110px;
	block-size: 110px;
	object-fit: contain;
}

.fc-pcard__name {
	font-size: 13px;
	font-weight: 700;
	line-height: 1.6;
}

.fc-pcard__price {
	color: inherit;
	font-size: 13px;
	font-weight: 800;
}

.fc-pcard__price del {
	display: none;
}

.fc-pcard__price ins {
	text-decoration: none;
}

.fc-pcard .fc-btn {
	inline-size: 100%;
	margin-block-start: auto;
	padding-inline: 8px;
	white-space: nowrap;
}

/* ---------- Empty cart, notices, phone bar ---------- */

.fc-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin-block-end: 24px;
	padding: 48px 16px;
	border: 1px dashed var(--fc-line);
	border-radius: var(--fc-radius);
	color: var(--fc-accent);
	text-align: center;
}

.fc-empty h1 {
	color: #1d1730;
	font-size: 22px;
}

.fc-empty p {
	color: var(--fc-muted);
}

.fc-empty .fc-btn {
	inline-size: auto;
	padding-inline: 32px;
}

.fc-empty + .fc-card {
	margin-block-end: 24px;
}

.fc__notices:empty {
	display: none;
}

.fc__notices {
	margin-block-end: 16px;
}

.fc__notices :is(.woocommerce-message, .woocommerce-error, .woocommerce-info) {
	margin: 0 0 8px;
	padding: 12px 16px;
	border-radius: 12px;
	background: var(--fc-soft);
	list-style: none;
}

.fc-toast {
	position: fixed;
	inset-block-end: 24px;
	inset-inline: 50% auto;
	z-index: 9999;
	max-inline-size: min(92vw, 520px);
	padding: 12px 18px;
	border-radius: 12px;
	background: #1d1730;
	color: #fff;
	font: inherit;
	box-shadow: 0 12px 30px rgb(20 16 40 / 0.25);
	transform: translateX(50%);
}

[dir="ltr"] .fc-toast {
	transform: translateX(-50%);
}

.fc-toast.is-error {
	background: #b91c1c;
}

.fc-mbar {
	display: none;
}

/* ---------- Tablet and phone ---------- */

/* Page frame and the phone bar follow the screen. */
@media (max-width: 1023.98px) {
	.fc {
		padding-inline: 16px;
	}

	.fc-mbar {
		position: fixed;
		inset-inline: 0;
		inset-block-end: 0;
		z-index: 850;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
		border-block-start: 1px solid var(--fc-line);
		background: #fff;
		box-shadow: 0 -8px 24px rgb(20 16 40 / 0.08);
	}

	.fc-mbar div {
		display: flex;
		flex-direction: column;
		line-height: 1.5;
	}

	.fc-mbar small {
		color: var(--fc-muted);
	}

	.fc-mbar b {
		color: inherit;
		font-size: 17px;
	}

	.fc:has(.fc-mbar) {
		padding-block-end: 96px;
	}

	/* The footer comes after the cart: it must not end under the pay bar either. */
	body:not(.has-fbb):has(.fc-mbar) {
		padding-block-end: calc(72px + env(safe-area-inset-bottom));
	}
}

/* The columns follow the block's own width (also inside an Elementor column);
   each zone too, so the rows of a narrow column fold on their own. */
.fc__body,
.fc__zone,
.fty {
	container-type: inline-size;
	/* Measured at its full width inside a wrapping Elementor container, not at zero. */
	contain-intrinsic-inline-size: 100000px;
}

@container (max-width: 960px) {
	.fc__row--main {
		grid-template-columns: minmax(0, 1fr);
	}

	.fc__zone.is-sticky {
		position: static;
	}
}

@container (max-width: 700px) {
	.fsteps__label {
		font-size: 11px;
	}

	.fsteps__dot {
		inline-size: 32px;
		block-size: 32px;
	}

	.fsteps li + li::before {
		inset-block-start: 15px;
		inset-inline-end: calc(50% + 20px);
		inline-size: calc(100% - 40px);
	}

	.fc-card {
		padding-inline: 16px;
	}

	.fc-item {
		grid-template-columns: auto 72px minmax(0, 1fr);
		gap: 10px 12px;
	}

	.fc-item__img {
		inline-size: 72px;
		block-size: 72px;
	}

	.fc-item__tools,
	.fc-item__price {
		grid-column: 2 / -1;
	}

	.fc-item__tools {
		justify-content: flex-start;
		max-inline-size: none;
	}

	.fc-item__tools .fc-link {
		flex-basis: auto;
	}

	.fc-item__price {
		flex-direction: row-reverse;
		align-items: center;
		justify-content: space-between;
		min-inline-size: 0;
		grid-row: 2;
	}

	.fc-items__foot {
		flex-wrap: wrap;
	}

	.fc-cross {
		padding-inline: 16px;
	}

	.fc-cross__body {
		flex-direction: column;
	}

	/* On a phone the row is swiped: no arrows, and no picture card repeating the title. */
	.fc-cross__nav,
	.fc-promo {
		display: none;
	}

	.fc-cross__head h2 {
		font-size: 16px;
	}

	.fc-pcard {
		flex-basis: 150px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fc *,
	.fc-cross__track {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}
