/* Carton Pricing — فروش کارتنی (RTL، ریسپانسیو) */

:root {
	--cp-accent: #2563eb;
	--cp-accent-soft: #eff6ff;
	--cp-border: #e5e7eb;
	--cp-bg: #f8fafc;
	--cp-text: #111827;
	--cp-muted: #6b7280;
}

/* ---------- صفحه محصول ---------- */
.cp-wrap {
	margin: 14px 0 18px;
}

.cp-wrap:empty {
	display: none;
	margin: 0;
}

.cp-box {
	direction: rtl;
	background: var(--cp-bg);
	border: 1px solid var(--cp-border);
	border-radius: 14px;
	padding: 14px 16px;
	color: var(--cp-text);
	box-sizing: border-box;
}

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

.cp-box__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.5;
}

.cp-box__title svg {
	flex: none;
	width: 20px;
	height: 20px;
	color: var(--cp-accent);
}

.cp-box__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 10px;
}

.cp-tile {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	padding: 10px 12px;
	background: #fff;
	border: 1px solid var(--cp-border);
	border-radius: 10px;
}

.cp-tile--accent {
	background: var(--cp-accent-soft);
	border-color: var(--cp-accent);
}

.cp-tile__label {
	font-size: 12px;
	color: var(--cp-muted);
	line-height: 1.4;
}

.cp-tile__value {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.5;
	word-break: break-word;
}

.cp-tile__value small {
	font-size: 12px;
	font-weight: 500;
	color: var(--cp-muted);
}

.cp-tile--accent .cp-tile__value {
	color: var(--cp-accent);
}

.cp-box__note {
	margin: 12px 0 0;
	font-size: 12.5px;
	line-height: 1.8;
	color: var(--cp-muted);
}

.cp-unit-label {
	display: inline-block;
	margin-inline-start: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--cp-muted);
	vertical-align: middle;
	white-space: nowrap;
}

/* ---------- سبد خرید / تسویه / مینی‌کارت ---------- */
.cp-cart-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 6px;
	padding: 8px 10px;
	background: var(--cp-bg);
	border: 1px solid var(--cp-border);
	border-radius: 10px;
	font-size: 12.5px;
	line-height: 1.6;
	max-width: 320px;
}

.cp-line {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.cp-line__k {
	color: var(--cp-muted);
}

.cp-line__v {
	font-weight: 600;
	color: var(--cp-text);
}

.cp-line.is-total {
	margin-top: 2px;
	padding-top: 4px;
	border-top: 1px dashed var(--cp-border);
}

.cp-line.is-total .cp-line__v {
	color: var(--cp-accent);
}

dl.variation dd:has(.cp-cart-info) {
	margin: 0;
}

dl.variation dd:has(.cp-cart-info) p {
	margin: 0;
}

.cp-per-carton {
	font-size: 11.5px;
	font-weight: 500;
	color: var(--cp-muted);
	white-space: nowrap;
}

/* ---------- موبایل ---------- */
@media (max-width: 640px) {
	.cp-box {
		padding: 12px;
		border-radius: 12px;
	}

	.cp-box__grid {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.cp-tile {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 10px;
	}

	.cp-cart-info {
		max-width: 100%;
	}
}
