/* RR Manual Payment — lightweight checkout / post-order CSS */

.rr-payment {
	margin: 0.75rem 0 0;
	/* Defaults; overridden by --rr-qr-* CSS variables from RRQrRenderer */
	--rr-qr-width-desktop: 320px;
	--rr-qr-width-tablet: 260px;
	--rr-qr-width-mobile: 220px;
	--rr-qr-max-width: 400px;
}

.rr-payment__short-desc { margin: 0 0 0.5rem; }
.rr-payment__panel[hidden] { display: none !important; }
.rr-payment__heading,
.rr-payment__merchant { margin: 0.35rem 0; text-align: center; }

.rr-payment__qr-wrap {
	min-height: 0;
	width: 100%;
	max-width: 100%;
	overflow: hidden;
}

.rr-payment-qr {
	display: block;
	width: var(--rr-qr-width-desktop);
	max-width: min(100%, var(--rr-qr-max-width));
	height: auto;
	aspect-ratio: auto;
	object-fit: contain;
	margin-left: auto;
	margin-right: auto;
}

.rr-payment--qr-left .rr-payment-qr {
	margin-left: 0;
	margin-right: auto;
}

.rr-payment--qr-center .rr-payment-qr {
	margin-left: auto;
	margin-right: auto;
}

.rr-payment--qr-right .rr-payment-qr {
	margin-left: auto;
	margin-right: 0;
}

@media (max-width: 1024px) and (min-width: 768px) {
	.rr-payment-qr {
		width: var(--rr-qr-width-tablet);
	}
}

@media (max-width: 767px) {
	.rr-payment-qr {
		width: var(--rr-qr-width-mobile);
	}
}

.rr-payment__notice { font-size: 0.925em; opacity: 0.85; }
.rr-payment__error { color: #b32d2e; }

/* Non-blocking skeleton — never covers the page */
.rr-payment__skeleton { padding: 0.5rem 0; pointer-events: none; }
.rr-skel {
	background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
	background-size: 200% 100%;
	animation: rr-skel 1.2s ease-in-out infinite;
	border-radius: 4px;
	margin: 0.5rem auto;
}
.rr-skel--line { height: 12px; max-width: 70%; }
.rr-skel--short { max-width: 40%; }
.rr-skel--box {
	width: min(160px, var(--rr-qr-width-desktop, 160px));
	max-width: min(100%, var(--rr-qr-max-width, 400px));
	aspect-ratio: 1 / 1;
	height: auto;
}
@keyframes rr-skel {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

.rr-upload { margin: 1rem 0; }
.rr-upload__dropzone {
	border: 2px dashed #b0b0b0;
	border-radius: 8px;
	padding: 1.25rem;
	text-align: center;
	cursor: pointer;
	background: #fafafa;
}
.rr-upload__dropzone.is-dragover { border-color: #2271b1; background: #f0f6fc; }
.rr-upload__preview img { max-width: 200px; height: auto; margin-top: 0.75rem; }
.rr-upload__progress { margin-top: 0.75rem; height: 8px; background: #e0e0e0; border-radius: 4px; overflow: hidden; }
.rr-upload__bar { height: 100%; width: 0; background: #2271b1; }
.rr-upload__message.is-error { color: #b32d2e; }
.rr-upload__message.is-success { color: #00a32a; }
.rr-upload__warning {
	margin: 0 0 0.75rem;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	background: #fcf0e3;
	color: #6e4a12;
	font-size: 0.925em;
}

/* Badges */
.rr-badge {
	display: inline-block;
	padding: 0.2em 0.65em;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.4;
	vertical-align: middle;
}
.rr-badge--pending { background: #f0f0f1; color: #50575e; }
.rr-badge--waiting { background: #fcf0c3; color: #614a00; }
.rr-badge--verified { background: #d1f0d6; color: #0a5c1f; }
.rr-badge--rejected { background: #f8d7da; color: #8a1f1f; }
.rr-badge--completed { background: #d0e6f7; color: #0b4a75; }

/* Proof card */
.rr-proof-card {
	margin: 1rem 0;
	padding: 1.25rem;
	border: 1px solid #dcdcde;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.rr-proof-card__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}
.rr-proof-card__title { margin: 0; font-size: 1.1rem; }
.rr-proof-card__notice {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-radius: 8px;
}
.rr-proof-card__notice--success { background: #edf7ed; color: #1e4620; }
.rr-proof-card__notice--verified { background: #e8f5e9; color: #0a5c1f; }
.rr-proof-card__note {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	background: #f6f7f7;
}
.rr-proof-card__note--reject { background: #fdecea; color: #8a1f1f; }
.rr-proof-card__thumb {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: zoom-in;
	border-radius: 10px;
	overflow: hidden;
}
.rr-proof-card__thumb img {
	display: block;
	width: 100%;
	max-height: 360px;
	object-fit: contain;
	background: #f6f7f7;
}
.rr-proof-card__meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 0.75rem 1rem;
	margin: 1rem 0 0;
}
.rr-proof-card__meta dt {
	margin: 0;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	opacity: 0.7;
}
.rr-proof-card__meta dd { margin: 0.15rem 0 0; }
.rr-proof-card__date,
.rr-proof-card__time { display: block; }

/* WhatsApp — always visible channel */
.rr-whatsapp { margin: 1.25rem 0 0.5rem; }
.rr-button--whatsapp {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	background: #25d366 !important;
	border-color: #1da851 !important;
	color: #fff !important;
	border-radius: 999px !important;
	padding: 0.75rem 1.35rem !important;
	text-decoration: none !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
	box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
}
.rr-button--whatsapp:hover,
.rr-button--whatsapp:focus {
	background: #1ebe5d !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
	color: #fff !important;
}
.rr-button--whatsapp.is-loading {
	opacity: 0.65;
	pointer-events: none;
	transform: none;
}
.rr-button--whatsapp__icon {
	display: inline-flex;
	flex-shrink: 0;
}
.rr-whatsapp--sticky {
	position: sticky;
	bottom: 1rem;
	z-index: 50;
	margin-top: 1.5rem;
	padding: 0.5rem 0;
	background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.92) 35%);
}
.rr-whatsapp--sticky .rr-button--whatsapp {
	box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}
@media (max-width: 767px) {
	.rr-button--whatsapp { width: 100%; }
	.rr-whatsapp--sticky {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		margin: 0;
		padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
		background: rgba(255, 255, 255, 0.96);
		border-top: 1px solid #e0e0e0;
		box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
	}
}

/* Mark received */
.rr-button--received {
	border-radius: 8px !important;
	padding: 0.65rem 1.1rem !important;
}
.rr-mark-received { margin: 1rem 0; }

/* Timeline */
.rr-order-timeline { margin: 1.5rem 0; }
.rr-order-timeline__heading { margin: 0 0 0.75rem; }
.rr-order-timeline__list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-left: 2px solid #dcdcde;
}
.rr-order-timeline__item {
	position: relative;
	padding: 0 0 1rem 1.25rem;
}
.rr-order-timeline__marker {
	position: absolute;
	left: -6px;
	top: 0.35rem;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #2271b1;
}
.rr-order-timeline__when,
.rr-order-timeline__actor,
.rr-order-timeline__note {
	margin: 0.2rem 0 0;
	font-size: 0.9em;
	opacity: 0.85;
}

.rr-history__list { list-style: none; margin: 0; padding: 0; }
.rr-history__item {
	padding: 0.75rem 0;
	border-bottom: 1px solid #eee;
}

/* Lightbox */
.rr-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.75);
	padding: 1rem;
}
.rr-lightbox[hidden] { display: none !important; }
.rr-lightbox__img {
	max-width: min(96vw, 900px);
	max-height: 90vh;
	object-fit: contain;
	border-radius: 8px;
	background: #fff;
}
.rr-lightbox__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	border: 0;
	border-radius: 999px;
	width: 2.5rem;
	height: 2.5rem;
	cursor: pointer;
	background: #fff;
	font-size: 1.25rem;
	line-height: 1;
}

@media (prefers-color-scheme: dark) {
	.rr-proof-card {
		background: #1d2327;
		border-color: #3c434a;
		color: #f0f0f1;
	}
	.rr-upload__dropzone { background: #2c3338; border-color: #50575e; }
	.rr-proof-card__thumb img,
	.rr-proof-card__note { background: #2c3338; }
}

.rr-timeline { list-style: disc; padding-left: 1.25rem; }
