/* Parla Loyalty — customer panel (dark navy + gold, matches store theme) */
.plw-customer-panel {
	max-width: 900px;
	margin: 0 auto;
	font-family: inherit;
	color: #e8e8ec;
	background: #14171f;
	border: 1px solid #262b36;
	border-radius: 14px;
	padding: 28px 24px;
}

.plw-panel-heading {
	color: #f0b90b;
	font-size: 22px;
	margin: 0 0 18px !important;
}

.plw-section-heading {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #f0b90b;
	font-size: 16.5px;
	font-weight: 700;
	margin: 0 0 14px !important;
}
.plw-section-heading::before {
	content: '';
	display: inline-block;
	width: 4px;
	height: 16px;
	border-radius: 999px;
	background: linear-gradient(180deg, #f7c948, #d89e02);
}

.plw-panel-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
	margin: 0 0 24px !important;
}

.plw-panel-card {
	border: 1px solid #262b36;
	border-radius: 10px;
	padding: 14px 16px;
	background: #1b1f29;
}
.plw-panel-card--accent {
	border-color: #f0b90b;
	background: linear-gradient(135deg, rgba(240,185,11,0.14), #1b1f29);
}

.plw-panel-card .plw-label {
	display: block;
	font-size: 13px;
	color: #9aa0ac;
	margin-bottom: 6px;
}
.plw-panel-card .plw-value {
	display: block;
	font-size: 22px;
	font-weight: 700;
	color: #f4f4f6;
}
.plw-panel-card--accent .plw-value { color: #f0b90b; }

/* Money values ("۱,۰۷۹,۴۲۳ تومان") are much longer than the other cards'
   content (a level name, a percent, a small count) — at the same font-size
   as those, "تومان" was wrapping onto its own line and sometimes breaking
   mid-word. Smaller + forced single line (with an ellipsis fallback for
   unusually large amounts) keeps every card the same tidy height. */
.plw-panel-card .plw-value--price {
	font-size: 15px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.plw-panel-card .plw-value--price bdi { white-space: nowrap; }

/* ---- Progress bar: single "installer-style" track with level/lottery markers ---- */
.plw-progress-section { margin-bottom: 24px !important; }

/* Scroll container: on desktop this is inert (no overflow, full width).
   On mobile (see media query below) it's what actually scrolls — padding
   here (not on the track-wrapper) is what keeps the lottery marker above
   the track and the staggered level labels below it from being clipped,
   since anything a scrollable element's children draw outside its own
   box gets cut off once overflow-x is set. */
.plw-progress-scroll {
	overflow-x: visible;
}

.plw-progress-track-wrapper {
	position: relative;
	/* Generous top margin: the lottery marker sits 34px above this box
	   PLUS its own label height — without enough clearance here it
	   collides with the section heading right above it.
	   !important: confirmed via live testing that something in the site's
	   theme/other CSS was overriding this margin with higher specificity
	   — 68px was already the correct value, it just wasn't winning. */
	margin: 68px 4px 56px !important;
}

@media (max-width: 480px) {
	.plw-progress-scroll {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		padding: 68px 4px 56px;
		margin: 0 -4px;
	}
	.plw-progress-track-wrapper {
		margin: 0 4px !important;
		min-width: var(--plw-progress-min-width, 440px);
	}
}

.plw-progress-track {
	position: relative;
	height: 10px;
	border-radius: 999px;
	background: #1b1f29;
	border: 1px solid #262b36;
	overflow: visible;
}
.plw-progress-fill {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, #d89e02, #f0b90b, #f7c948);
	transition: width 0.4s ease;
}

/* Level markers — FIXED equal spacing (set by inline `right: N%` per lane).
   Labels are single-line (never broken mid-word — Persian compound names
   look garbled when force-wrapped character by character) and staggered
   at two alternating heights so neighboring labels never collide even
   when many levels are packed close together. */
.plw-progress-marker {
	position: absolute;
	top: 50%;
	transform: translate(50%, -50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	z-index: 2;
	text-align: center;
}
.plw-progress-marker__dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #14171f;
	border: 2px solid #4a5162;
	flex-shrink: 0;
}
.plw-progress-marker.is-reached .plw-progress-marker__dot {
	border-color: #f0b90b;
	background: #f0b90b;
}
.plw-progress-marker__label {
	position: absolute;
	top: 18px;
	font-size: 11px;
	line-height: 1.3;
	color: #7d8391;
	white-space: nowrap;
}
.plw-progress-marker--offset .plw-progress-marker__label {
	top: 36px;
}
.plw-progress-marker.is-reached .plw-progress-marker__label {
	color: #f0b90b;
	font-weight: 700;
}

/* Lottery marker — a separate marker ABOVE the bar, aligned to whichever
   level's range contains the lottery threshold, never mixed in with the
   level lanes below. */
.plw-lottery-marker {
	position: absolute;
	top: -34px;
	transform: translateX(50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	z-index: 3;
}
.plw-lottery-marker__label {
	font-size: 11px;
	font-weight: 700;
	color: #9aa0ac;
	white-space: nowrap;
	background: #1b1f29;
	border: 1px solid #333a48;
	border-radius: 999px;
	padding: 3px 10px;
}
.plw-lottery-marker.is-reached .plw-lottery-marker__label {
	color: #f0b90b;
	border-color: #f0b90b;
}
.plw-lottery-marker__stem {
	width: 1px;
	height: 20px;
	background: #333a48;
	margin-top: 2px;
}
.plw-lottery-marker.is-reached .plw-lottery-marker__stem {
	background: #f0b90b;
}

.plw-progress-caption {
	font-size: 14.5px;
	color: #d8dbe0;
	margin: 0 0 6px;
	text-align: center;
}
.plw-progress-caption--success { color: #f0b90b; font-weight: 700; }

/* ---- Lottery prize card ---- */
.plw-lottery-prize { margin-bottom: 24px !important; }
.plw-lottery-prize__card {
	display: flex;
	gap: 16px;
	align-items: center;
	border: 1px solid #f0b90b;
	border-radius: 12px;
	padding: 16px;
	background: linear-gradient(135deg, rgba(240,185,11,0.10), #1b1f29);
}
.plw-lottery-prize__image img {
	width: 96px;
	height: 96px;
	object-fit: cover;
	border-radius: 10px;
	display: block;
}
.plw-lottery-prize__info { display: flex; flex-direction: column; gap: 4px; }
.plw-lottery-prize__name { font-size: 17.5px; font-weight: 700; color: #f4f4f6; }
.plw-lottery-prize__price { font-size: 16.5px; color: #f0b90b; font-weight: 700; }
.plw-lottery-prize__note { font-size: 13px; color: #9aa0ac; margin: 4px 0 0; line-height: 1.7; }

@media (max-width: 480px) {
	.plw-lottery-prize__card { flex-direction: column; align-items: flex-start; }
}

/* ---- Validity rules — short summary + expandable detail ---- */
.plw-validity-rules { margin-bottom: 24px !important; }
.plw-validity-summary {
	color: #d8dbe0;
	font-size: 15px;
	line-height: 1.9;
	margin: 0 0 8px !important;
}
.plw-validity-more-toggle {
	background: none;
	border: none;
	padding: 0;
	color: #f0b90b;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}
.plw-validity-more-toggle:hover { text-decoration: underline; }
.plw-validity-more {
	color: #a8adb8;
	font-size: 14.5px;
	line-height: 1.9;
	margin: 10px 0 0 !important;
}

/* ---- Order history — real table ---- */
.plw-order-history { margin-bottom: 8px !important; }
.plw-history-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.plw-history-tab {
	background: #1b1f29;
	border: 1px solid #333a48;
	color: #9aa0ac;
	border-radius: 999px;
	padding: 6px 16px;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.15s ease;
}
.plw-history-tab.is-active {
	background: #f0b90b;
	border-color: #f0b90b;
	color: #14171f;
	font-weight: 700;
}

.plw-history-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14.5px;
	border: 1px solid #262b36;
	border-radius: 10px;
	overflow: hidden;
}
.plw-history-table thead th {
	background: #1b1f29;
	color: #9aa0ac;
	font-weight: 600;
	text-align: right;
	padding: 10px 14px;
	border-bottom: 1px solid #262b36;
}
.plw-history-table tbody td {
	padding: 10px 14px;
	border-bottom: 1px solid #20242e;
	color: #e8e8ec;
}
.plw-history-table tbody tr:last-child td { border-bottom: none; }
.plw-history-table tbody tr:hover { background: #1b1f29; }

.plw-history-row__link { color: #f0b90b; text-decoration: none; font-weight: 700; }
.plw-history-row__link:hover { text-decoration: underline; }

.plw-history-row__badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
}
.plw-history-row__badge.is-valid { background: rgba(76, 217, 100, 0.16); color: #4cd964; }
.plw-history-row__badge.is-invalid { background: rgba(255, 107, 107, 0.16); color: #ff6b6b; }

@media (max-width: 480px) {
	.plw-history-table { font-size: 13px; }
	.plw-history-table thead th,
	.plw-history-table tbody td { padding: 8px; }
}
