/* ============================================================
   bsy-promo — Promo / discount code ticket (baly.iq main site)
   Perforated coupon card: reveal → copy. RTL-first.
   Namespace: .bsy-promo* · tokens: --bsy-* (components/shared/bsy-tokens.css)

   Tunables (set on .bsy-promo or an ancestor):
     --bsy-promo-stub   width of the code stub (the perforated panel)
   ============================================================ */

.bsy-promo-list { direction: rtl; font-family: var(--bsy-font); }
.bsy-promo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bsy-space-4); }
@media (max-width: 860px) { .bsy-promo-grid { grid-template-columns: 1fr; } }

/* ── The ticket ─────────────────────────────────────────────── */
/* No punched notches: the ::before/::after circles on the perforation line were
   removed at the owner's request (2026-09-15). The dashed stub border alone
   marks the tear line. */
.bsy-promo {
	--bsy-promo-stub: 190px;
	position: relative; display: flex; align-items: stretch; direction: rtl;
	font-family: var(--bsy-font); color: var(--bsy-fg-primary);
	background: var(--bsy-white); border-radius: var(--bsy-radius-xl);
	box-shadow: var(--bsy-shadow-2);
	transition: transform 250ms cubic-bezier(.16,1,.3,1), box-shadow 250ms cubic-bezier(.16,1,.3,1);
}
.bsy-promo:hover { transform: translateY(-2px); box-shadow: var(--bsy-shadow-3); }

/* ── Main panel ─────────────────────────────────────────────── */
.bsy-promo__main { flex: 1; min-width: 0; padding: var(--bsy-space-5) var(--bsy-space-5) var(--bsy-space-4); display: flex; flex-direction: column; gap: var(--bsy-space-2); }
.bsy-promo__top { display: flex; align-items: center; flex-wrap: wrap; gap: var(--bsy-space-2); }
.bsy-promo__tag {
	display: inline-flex; align-items: center; gap: 6px; flex: none;
	background: var(--bsy-brand-lighter); color: var(--bsy-brand);
	font-size: var(--bsy-text-xs); font-weight: var(--bsy-fw-bold);
	padding: 5px 11px; border-radius: var(--bsy-radius-pill); line-height: 1;
}
.bsy-promo__tag svg { width: 13px; height: 13px; flex: none; }
/* per-service tag colours */
.bsy-promo__tag--taxi { background: var(--bsy-brand-lighter); color: var(--bsy-brand); }
.bsy-promo__tag--food { background: var(--bsy-warning-light); color: #A85F00; }
.bsy-promo__note {
	display: inline-flex; align-items: center; gap: 5px; flex: none;
	background: var(--bsy-grey-100); color: var(--bsy-fg-muted);
	font-size: var(--bsy-text-xs); font-weight: var(--bsy-fw-semibold);
	padding: 5px 11px; border-radius: var(--bsy-radius-pill); line-height: 1;
}
.bsy-promo__note svg { width: 13px; height: 13px; flex: none; }
.bsy-promo__value { display: flex; align-items: baseline; gap: 2px; margin-top: var(--bsy-space-1); font-size: var(--bsy-text-2xl); font-weight: var(--bsy-fw-black); line-height: 1; color: var(--bsy-brand); }
.bsy-promo__value .pct { font-size: var(--bsy-text-lg); font-weight: var(--bsy-fw-bold); }
.bsy-promo__title { margin: 0; font-size: var(--bsy-text-md); font-weight: var(--bsy-fw-bold); line-height: 1.3; }
.bsy-promo__cond { margin: 0; font-size: var(--bsy-text-sm); font-weight: var(--bsy-fw-medium); color: var(--bsy-fg-muted); line-height: 1.55; text-wrap: pretty; }
.bsy-promo__foot { margin-top: auto; padding-top: var(--bsy-space-2); }
.bsy-promo__meta { display: inline-flex; align-items: center; gap: 6px; font-size: var(--bsy-text-xs); font-weight: var(--bsy-fw-semibold); color: var(--bsy-fg-muted); }
.bsy-promo__meta svg { width: 13px; height: 13px; flex: none; }
.bsy-promo__meta--soon { background: var(--bsy-warning-light); color: #8A5300; padding: 5px 11px; border-radius: var(--bsy-radius-pill); }
.bsy-promo__meta--soon .num { font-variant-numeric: tabular-nums; }

/* ── Code stub ──────────────────────────────────────────────── */
.bsy-promo__stub {
	flex: none; width: var(--bsy-promo-stub); box-sizing: border-box; display: flex; flex-direction: column;
	align-items: center; justify-content: center; gap: var(--bsy-space-3);
	padding: var(--bsy-space-5) var(--bsy-space-4);
	border-inline-start: 2px dashed var(--bsy-border-default);
	text-align: center;
}
.bsy-promo__label { font-size: var(--bsy-text-xs); font-weight: var(--bsy-fw-semibold); color: var(--bsy-fg-muted); }
.bsy-promo__code {
	display: block; width: 100%; box-sizing: border-box;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: var(--bsy-text-md); font-weight: var(--bsy-fw-bold);
	color: var(--bsy-fg-primary); background: var(--bsy-grey-100);
	border: 1.5px dashed var(--bsy-grey-300); border-radius: var(--bsy-radius-md);
	padding: 10px 8px; line-height: 1.2; direction: ltr; unicode-bidi: isolate;
	overflow-wrap: anywhere;
}
.bsy-promo__code[data-masked] { color: var(--bsy-fg-muted); letter-spacing: .22em; }
.bsy-promo--revealed .bsy-promo__code { background: var(--bsy-brand-lighter); border-color: var(--bsy-brand-light); border-style: solid; color: var(--bsy-brand); letter-spacing: .1em; }
.bsy-promo__action {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	width: 100%; min-height: 44px; box-sizing: border-box;
	font-family: var(--bsy-font); font-size: var(--bsy-text-sm); font-weight: var(--bsy-fw-bold);
	padding: 12px 16px; border: 0; border-radius: var(--bsy-radius-pill); cursor: pointer; text-decoration: none;
	background: var(--bsy-brand); color: var(--bsy-white); box-shadow: var(--bsy-shadow-brand);
	transition: background 150ms ease-out, transform 150ms ease-out, box-shadow 150ms ease-out;
}
.bsy-promo__action svg { width: 15px; height: 15px; flex: none; }
.bsy-promo__action:hover { background: var(--bsy-brand-hover); }
.bsy-promo__action:active { background: var(--bsy-brand-active); transform: scale(.97); }
.bsy-promo__action[disabled] { background: var(--bsy-grey-200); color: var(--bsy-grey-700); box-shadow: none; cursor: not-allowed; }
.bsy-promo__live { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ── State: copied ──────────────────────────────────────────── */
.bsy-promo--copied .bsy-promo__action { background: var(--bsy-success); box-shadow: 0 4px 20px rgba(0,168,69,.25); }
.bsy-promo--copied .bsy-promo__code { background: var(--bsy-success-light); border-color: var(--bsy-success); color: #00703A; }

/* ── State: expiring soon ───────────────────────────────────── */
.bsy-promo--soon { box-shadow: 0 2px 12px rgba(224,138,0,.18); }
.bsy-promo--soon .bsy-promo__stub { border-inline-start-color: var(--bsy-warning); }

/* ── State: expired (terminal) ──────────────────────────────── */
.bsy-promo--expired { box-shadow: var(--bsy-shadow-1); background: var(--bsy-grey-50); }
.bsy-promo--expired:hover { transform: none; box-shadow: var(--bsy-shadow-1); }
.bsy-promo--expired .bsy-promo__value { color: var(--bsy-grey-700); }
.bsy-promo--expired .bsy-promo__tag { background: var(--bsy-grey-200); color: var(--bsy-grey-700); }
.bsy-promo--expired .bsy-promo__code { color: var(--bsy-grey-700); text-decoration: line-through; text-decoration-thickness: 2px; }
.bsy-promo--expired .bsy-promo__meta { background: var(--bsy-error-light); color: #A3271C; padding: 5px 11px; border-radius: var(--bsy-radius-pill); }

/* ── State: loading skeleton ────────────────────────────────── */
.bsy-promo--skeleton { pointer-events: none; }
.bsy-promo--skeleton:hover { transform: none; box-shadow: var(--bsy-shadow-2); }
.bsy-promo__bar { border-radius: var(--bsy-radius-xs); background: var(--bsy-grey-100); position: relative; overflow: hidden; height: 12px; }
.bsy-promo__bar--lg { height: 30px; width: 42%; }
.bsy-promo__bar--md { height: 18px; width: 55%; }
.bsy-promo__bar--pill { height: 22px; width: 88px; border-radius: var(--bsy-radius-pill); }
.bsy-promo__bar--full { width: 100%; }
.bsy-promo__bar--60 { width: 60%; }
.bsy-promo__bar--code { height: 44px; width: 100%; border-radius: var(--bsy-radius-md); }
.bsy-promo__bar--btn { height: 44px; width: 100%; border-radius: var(--bsy-radius-pill); }
.bsy-promo__bar::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent); animation: bsy-promo-shimmer 1.4s infinite; }
@keyframes bsy-promo-shimmer { 100% { transform: translateX(100%); } }

/* ── Responsive: stack the stub under the body ──────────────── */
@media (max-width: 620px) {
	.bsy-promo { flex-direction: column; }
	.bsy-promo__stub {
		width: auto; border-inline-start: 0; border-top: 2px dashed var(--bsy-border-default);
		flex-direction: row; flex-wrap: wrap; gap: var(--bsy-space-3); padding: var(--bsy-space-4);
	}
	.bsy-promo__label { width: 100%; text-align: start; }
	.bsy-promo__code { flex: 1; min-width: 120px; width: auto; }
	.bsy-promo__action { width: auto; flex: none; }
	.bsy-promo-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.bsy-promo, .bsy-promo__action { transition: none; }
	.bsy-promo:hover { transform: none; }
	.bsy-promo__action:active { transform: none; }
	.bsy-promo__bar::after { animation: none; }
}
