/*!
 * Zardis Toolkit — «خرید تعدادی» (bulk buy)
 * Live preview only. Every number is recalculated again on the server.
 *
 * Visual language: deep navy surface with a brushed-gold edge, matching the
 * site's #001944 / #c9a247 identity. Scoped to .zardis-bulk only.
 */

.zardis-bulk {
	--zb-navy: #001944;
	--zb-navy-deep: #00102b;
	--zb-navy-lift: #062450;
	--zb-gold: #c9a247;
	--zb-gold-light: #e8cd8c;
	--zb-gold-deep: #a9862f;
	--zb-ink: #ffffff;
	--zb-ink-soft: rgba(255, 255, 255, .68);
	--zb-line: rgba(201, 162, 71, .26);
	position: relative;
	margin-block-start: 16px;
	padding: 13px 14px;
	overflow: hidden;
	border: 1px solid var(--zb-line);
	border-radius: 16px;
	background:
		radial-gradient(125% 130% at 100% 0%, rgba(201, 162, 71, .20) 0%, rgba(201, 162, 71, 0) 58%),
		radial-gradient(90% 120% at 0% 100%, rgba(201, 162, 71, .10) 0%, rgba(201, 162, 71, 0) 60%),
		linear-gradient(168deg, var(--zb-navy-lift) 0%, var(--zb-navy) 46%, var(--zb-navy-deep) 100%);
	box-shadow:
		0 18px 44px rgba(0, 16, 43, .28),
		inset 0 1px 0 rgba(255, 255, 255, .07);
	color: var(--zb-ink);
	font-family: inherit;
}

/* Brushed-gold hairline that runs along the top edge. */
.zardis-bulk::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	inset-block-start: 0;
	block-size: 2px;
	background: linear-gradient(90deg, transparent 0%, var(--zb-gold-deep) 18%, var(--zb-gold-light) 50%, var(--zb-gold-deep) 82%, transparent 100%);
	opacity: .85;
	pointer-events: none;
}

.zardis-bulk *,
.zardis-bulk *::before,
.zardis-bulk *::after {
	box-sizing: border-box;
}

/* ---------- head ---------- */

.zardis-bulk__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin-bottom: 9px;
}

/* Sat right next to the heading, not pushed to the far edge. */
.zardis-bulk__spotlight {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 7px;
	margin-inline-start: 6px;
	padding: 7px 14px;
	border-radius: 13px;
	background: linear-gradient(135deg, var(--zb-gold-light) 0%, var(--zb-gold) 52%, var(--zb-gold-deep) 100%);
	color: #1d1605;
	box-shadow:
		0 8px 24px rgba(201, 162, 71, .34),
		inset 0 1px 0 rgba(255, 255, 255, .55);
}

.zardis-bulk__kicker {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	border: 1px solid var(--zb-line);
	border-radius: 999px;
	background: rgba(201, 162, 71, .10);
	color: var(--zb-gold-light);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .01em;
	white-space: nowrap;
}

.zardis-bulk__kicker::before {
	content: "";
	inline-size: 6px;
	block-size: 6px;
	border-radius: 50%;
	background: var(--zb-gold);
	box-shadow: 0 0 0 3px rgba(201, 162, 71, .18);
}

.zardis-bulk__title {
	margin: 0;
	font-size: clamp(17px, 1.8vw, 20px);
	font-weight: 800;
	line-height: 1.35;
	color: var(--zb-ink);
}

/*
 * The spotlight sells the deal: the biggest Toman saving, stated as a prize
 * rather than a rule. It is the loudest element after the chips.
 */
.zardis-bulk__spotlight-save {
	font-size: clamp(19px, 2.2vw, 24px);
	font-weight: 900;
	line-height: 1.15;
	font-variant-numeric: tabular-nums;
	letter-spacing: -.01em;
}

.zardis-bulk__spotlight-unit {
	font-size: 12.5px;
	font-weight: 800;
	line-height: 1.3;
}

.zardis-bulk__spotlight-note {
	inline-size: 100%;
	font-size: 10.5px;
	font-weight: 700;
	line-height: 1.4;
	opacity: .78;
}

.zardis-bulk__lead {
	margin: 0 0 12px;
	font-size: 12.5px;
	line-height: 1.85;
	color: var(--zb-ink-soft);
}

/* ---------- chips ---------- */

.zardis-bulk__chips {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 10px;
	align-items: stretch;
}

.zardis-bulk__form {
	display: flex;
	margin: 0;
	min-width: 0;
}

/*
 * The chip rules carry TWO class selectors on purpose.
 *
 * The theme styles bare buttons through
 * `:is(.btn, .button, button, [type=submit], [type=button])`, which has the
 * same specificity as a single class. With equal specificity the theme wins
 * whenever its stylesheet loads later, which on the live site turned these
 * chips into plain white theme buttons. `.zardis-bulk .zardis-bulk__chip`
 * outranks it regardless of load order, and the reset below removes the
 * native button chrome for good measure.
 */
.zardis-bulk .zardis-bulk__chip {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	inline-size: 100%;
	min-block-size: 74px;
	/*
	 * Because the flag is absolutely positioned, reserve the SAME top space on
	 * every chip. The percentage then lands on one baseline across the row.
	 */
	padding: 26px 8px 8px;
	overflow: hidden;
	/* A real, visible gold border on every single button. */
	border: 1.5px solid rgba(201, 162, 71, .62);
	border-radius: 20px;
	/* Flat, translucent gold over the navy panel — never a white fill. */
	background-color: rgba(201, 162, 71, .07);
	background-image: none;
	color: var(--zb-ink);
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	text-align: center;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
	transition: border-color .18s ease, background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

/* Gold sheen that sweeps in on hover. */
.zardis-bulk .zardis-bulk__chip::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(115deg, transparent 30%, rgba(232, 205, 140, .22) 48%, transparent 66%);
	opacity: 0;
	transform: translateX(-45%);
	transition: opacity .22s ease, transform .5s ease;
	pointer-events: none;
}

.zardis-bulk .zardis-bulk__chip:hover,
.zardis-bulk .zardis-bulk__chip:focus-visible {
	border-color: var(--zb-gold-light);
	background-color: rgba(201, 162, 71, .18);
	color: var(--zb-ink);
	box-shadow: 0 10px 26px rgba(0, 16, 43, .38);
	outline: 2px solid rgba(232, 205, 140, .6);
	outline-offset: 2px;
}

.zardis-bulk .zardis-bulk__chip:hover::before,
.zardis-bulk .zardis-bulk__chip:focus-visible::before {
	opacity: 1;
	transform: translateX(45%);
}

.zardis-bulk .zardis-bulk__chip:active {
	transform: translateY(1px);
	box-shadow: inset 0 2px 6px rgba(0, 0, 0, .25);
}

/* The biggest pack is the recommended one. */
.zardis-bulk .zardis-bulk__chip.is-best {
	border-color: var(--zb-gold);
	background-color: rgba(201, 162, 71, .2);
	/* inset shadow instead of a second border keeps every chip the same size */
	box-shadow: inset 0 0 0 1px rgba(232, 205, 140, .45), 0 6px 20px rgba(201, 162, 71, .16);
}

.zardis-bulk .zardis-bulk__chip.is-best:hover,
.zardis-bulk .zardis-bulk__chip.is-best:focus-visible {
	background-color: rgba(201, 162, 71, .3);
}

.zardis-bulk__chip-flag {
	position: absolute;
	inset-block-start: 0;
	inset-inline: 0;
	padding: 3px 4px;
	/* Matches the chip's own top corners exactly, so no gold corner spills out. */
	border-radius: 17px 17px 0 0;
	background: linear-gradient(180deg, var(--zb-gold) 0%, var(--zb-gold-deep) 100%);
	color: #221a08;
	font-size: 9.5px;
	font-weight: 800;
	line-height: 1.55;
	letter-spacing: .01em;
	white-space: nowrap;
}

/* The chip clips the flag to its rounded shape; overflow:hidden does the rest. */

/* The percentage is the loudest thing on the chip — it IS the offer. */
.zardis-bulk__chip-pct {
	font-size: 27px;
	font-weight: 900;
	line-height: 1.05;
	font-variant-numeric: tabular-nums;
	letter-spacing: -.02em;
	color: var(--zb-gold-light);
}

.zardis-bulk .zardis-bulk__chip.is-best .zardis-bulk__chip-pct {
	color: #ffe6a8;
}

.zardis-bulk__chip-qty {
	margin-block-start: 1px;
	font-size: 10.5px;
	font-weight: 600;
	line-height: 1.25;
	font-variant-numeric: tabular-nums;
	color: rgba(255, 255, 255, .7);
}

.zardis-bulk__chip-save {
	margin-block-start: 5px;
	padding-block-start: 5px;
	inline-size: 100%;
	border-block-start: 1px solid rgba(201, 162, 71, .18);
	color: var(--zb-gold-light);
	font-size: 10.5px;
	font-weight: 700;
	line-height: 1.6;
	font-variant-numeric: tabular-nums;
}

.zardis-bulk__chip.is-busy {
	opacity: .65;
	cursor: progress;
}

.zardis-bulk__chip.is-busy::after {
	content: "";
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	margin: -7px 0 0 -7px;
	inline-size: 14px;
	block-size: 14px;
	border: 2px solid rgba(255, 255, 255, .25);
	border-top-color: var(--zb-gold-light);
	border-radius: 50%;
	animation: zardis-bulk-spin .7s linear infinite;
}

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

/* ---------- live summary ---------- */

.zardis-bulk__summary {
	margin: 14px 0 0;
	padding-block-start: 12px;
	border-block-start: 1px dashed rgba(201, 162, 71, .26);
	font-size: 12.5px;
	line-height: 2;
	color: var(--zb-ink-soft);
	font-variant-numeric: tabular-nums;
}

.zardis-bulk__summary strong {
	color: var(--zb-gold-light);
	font-weight: 800;
}

.zardis-bulk__summary span[aria-hidden="true"] {
	margin-inline: 6px;
	color: rgba(201, 162, 71, .45);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
	.zardis-bulk__chips {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.zardis-bulk {
		padding: 16px;
		border-radius: 15px;
	}

	.zardis-bulk__chips {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 9px;
	}

	.zardis-bulk .zardis-bulk__chip {
		min-block-size: 92px;
		padding: 22px 6px 10px;
		border-radius: 17px;
	}

	.zardis-bulk__chip-pct {
		font-size: 24px;
	}

	/* Last chip spans the row so the grid never ends on a hole. */
	.zardis-bulk__chips > .zardis-bulk__form:last-child {
		grid-column: 1 / -1;
	}

	.zardis-bulk__ribbon {
		margin-inline-start: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.zardis-bulk__chip,
	.zardis-bulk__chip::before {
		transition: none;
	}

	.zardis-bulk__chip.is-busy::after {
		animation: none;
	}

	.zardis-bulk .zardis-bulk__chip:hover,
	.zardis-bulk .zardis-bulk__chip:active {
		transform: none;
	}
}
