/* XC Rewards — billetera digital corporativa. Azul/naranja XC, sobrio, mobile-first. */

.xc-rw {
	--xc-blue: #0A2C5C;
	--xc-blue-2: #14498F;
	--xc-accent: #F47B20;
	--xc-ink: #1C2530;
	--xc-muted: #5B6675;
	--xc-line: #E4E8EF;
	--xc-bg-soft: #F5F7FA;
	--xc-ok: #1E7F4F;
	--xc-radius: 14px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--xc-ink);
	line-height: 1.5;
}
.xc-rw *, .xc-rw *::before, .xc-rw *::after { box-sizing: border-box; }

/* ---------- Tarjeta principal de billetera ---------- */
.xc-rw-wallet {
	background: linear-gradient(150deg, var(--xc-blue) 0%, var(--xc-blue-2) 100%);
	color: #fff;
	border-radius: var(--xc-radius);
	padding: 1.4rem 1.4rem 1.15rem;
	position: relative;
	overflow: hidden;
	box-shadow: 0 10px 28px -14px rgba(10, 44, 92, .55);
}
.xc-rw-wallet::after {
	content: "";
	position: absolute;
	right: -60px; top: -60px;
	width: 180px; height: 180px;
	background: var(--xc-accent);
	opacity: .16;
	border-radius: 50%;
}
.xc-rw-wallet__head {
	display: flex;
	align-items: center;
	gap: .6rem;
	margin-bottom: 1.1rem;
}
.xc-rw-wallet__logo { height: 26px; width: auto; display: block; }
.xc-rw-wallet__brand {
	font-weight: 700;
	letter-spacing: .16em;
	font-size: .82rem;
}
.xc-rw-wallet__balances {
	display: grid;
	gap: .9rem;
}
.xc-rw-bal { display: flex; flex-direction: column; gap: .15rem; }
.xc-rw-bal__label {
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: rgba(255, 255, 255, .72);
}
.xc-rw-bal__value { font-size: 1.35rem; font-weight: 700; }
.xc-rw-bal__value small { font-size: .62rem; font-weight: 600; letter-spacing: .08em; opacity: .8; }
.xc-rw-bal--primary .xc-rw-bal__value { font-size: 2rem; }
.xc-rw-bal--primary .xc-rw-bal__value small { color: var(--xc-accent); opacity: 1; }
.xc-rw-wallet__link {
	display: inline-block;
	margin-top: 1.1rem;
	color: #fff;
	font-weight: 600;
	font-size: .9rem;
	text-decoration: none;
	border-bottom: 2px solid var(--xc-accent);
	padding-bottom: 1px;
}

/* ---------- Tarjetas de contenido ---------- */
.xc-rw-card {
	background: #fff;
	border: 1px solid var(--xc-line);
	border-radius: var(--xc-radius);
	padding: 1.15rem 1.25rem;
	margin-top: 1rem;
}
.xc-rw-card--muted { background: var(--xc-bg-soft); }
.xc-rw-card__title {
	margin: 0 0 .7rem;
	font-size: 1rem;
	font-weight: 700;
	color: var(--xc-blue);
}
.xc-rw-benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.xc-rw-benefits li { display: flex; align-items: flex-start; gap: .55rem; font-size: .95rem; }
.xc-rw-check {
	flex: 0 0 auto;
	width: 18px; height: 18px;
	margin-top: 1px;
	border-radius: 50%;
	background: rgba(30, 127, 79, .12);
	position: relative;
}
.xc-rw-check::after {
	content: "";
	position: absolute;
	left: 6px; top: 3px;
	width: 4px; height: 8px;
	border: solid var(--xc-ok);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.xc-rw-note { margin: .8rem 0 0; font-size: .85rem; color: var(--xc-muted); }
.xc-rw-note--warn { color: #92400E; background: #FFF7ED; border-radius: 8px; padding: .55rem .7rem; }
.xc-rw-note--muted { color: var(--xc-muted); }
.xc-rw-lead, .xc-rw-legend { color: var(--xc-muted); font-size: .88rem; }

/* ---------- Resumen / historial ---------- */
.xc-rw-summary { display: flex; gap: .75rem; margin-bottom: 1rem; }
.xc-rw-summary > div {
	flex: 1;
	background: var(--xc-bg-soft);
	border: 1px solid var(--xc-line);
	border-radius: 12px;
	padding: .7rem .85rem;
	display: flex;
	flex-direction: column;
	gap: .1rem;
}
.xc-rw-summary span { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--xc-muted); }
.xc-rw-summary strong { font-size: 1.15rem; color: var(--xc-blue); }

.xc-rw-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.xc-rw-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.xc-rw-table thead th {
	text-align: left;
	font-size: .74rem;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--xc-muted);
	padding: .5rem .6rem;
	border-bottom: 2px solid var(--xc-line);
}
.xc-rw-table td { padding: .7rem .6rem; border-bottom: 1px solid var(--xc-line); vertical-align: top; }
.xc-rw-table .xc-rw-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xc-rw-order { display: block; font-size: .78rem; color: var(--xc-muted); }

.xc-rw-badge {
	display: inline-block;
	font-size: .72rem;
	font-weight: 600;
	padding: .18rem .5rem;
	border-radius: 999px;
	line-height: 1.4;
	white-space: nowrap;
}
.xc-rw-badge--pendiente  { background: #FEF3C7; color: #92400E; }
.xc-rw-badge--disponible { background: #DCFCE7; color: #166534; }
.xc-rw-badge--utilizado  { background: #E0E7FF; color: #3730A3; }
.xc-rw-badge--revertido  { background: #F3F4F6; color: #4B5563; }
.xc-rw-badge--expirado   { background: #FEE2E2; color: #991B1B; }
.xc-rw-badge--desconocido { background: #F3F4F6; color: #4B5563; }
.xc-rw-legend { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }

.xc-rw-pager { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1rem; }

/* ---------- Botones ---------- */
.xc-rw-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	font-weight: 600;
	font-size: .92rem;
	padding: .62rem 1.05rem;
	border-radius: 10px;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: filter .15s ease, background .15s ease;
}
.xc-rw-btn--primary { background: var(--xc-accent); color: #fff; }
.xc-rw-btn--primary:hover { filter: brightness(.94); }
.xc-rw-btn--ghost { background: #fff; color: var(--xc-blue); border-color: var(--xc-line); }
.xc-rw-btn--ghost:hover { background: var(--xc-bg-soft); }
.xc-rw-btn[disabled] { opacity: .55; cursor: default; }

/* ---------- Acumulación (producto / carrito) ---------- */
.xc-rw-accrual {
	display: flex;
	align-items: center;
	gap: .5rem;
	font-size: .93rem;
	color: var(--xc-blue);
	background: var(--xc-bg-soft);
	border: 1px solid var(--xc-line);
	border-left: 3px solid var(--xc-accent);
	border-radius: 8px;
	padding: .55rem .75rem;
	margin: .75rem 0;
}
.xc-rw-accrual--guest { color: var(--xc-muted); }
.xc-rw-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--xc-accent); flex: 0 0 auto; }

/* ---------- Redención en checkout ---------- */
.xc-rw-redeem {
	border: 1px solid var(--xc-line);
	border-radius: 12px;
	padding: 1rem 1.1rem;
	margin: 1rem 0;
	background: #fff;
}
.xc-rw-redeem__row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .8rem; }
.xc-rw-redeem__label { font-weight: 600; color: var(--xc-blue); }
.xc-rw-redeem__avail { font-weight: 700; font-size: 1.05rem; }
.xc-rw-redeem__field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .6rem; font-size: .88rem; }
.xc-rw-redeem__input {
	width: 100%;
	padding: .55rem .7rem;
	border: 1px solid var(--xc-line);
	border-radius: 8px;
	font-size: 1rem;
}
.xc-rw-redeem__apply .xc-rw-btn { width: 100%; }
.xc-rw-redeem__hint { font-size: .8rem; color: var(--xc-muted); margin: .4rem 0 0; }
.xc-rw-redeem__summary { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.xc-rw-redeem__line { display: flex; flex-direction: column; }
.xc-rw-redeem__line strong { color: var(--xc-ok); font-size: 1.1rem; }
.xc-rw-redeem__error { color: #991B1B; background: #FEE2E2; border-radius: 8px; padding: .5rem .65rem; margin: .7rem 0 0; font-size: .85rem; }
.xc-rw-redeem.is-loading { opacity: .6; pointer-events: none; }

/* ---------- Volver a comprar ---------- */
.xc-rw-reorder__grid {
	list-style: none;
	margin: 1rem 0 0;
	padding: 0;
	display: grid;
	gap: .9rem;
	grid-template-columns: 1fr;
}
.xc-rw-reorder__item {
	display: grid;
	grid-template-columns: 64px 1fr;
	grid-template-areas: "thumb body" "actions actions" "feedback feedback";
	gap: .55rem .9rem;
	border: 1px solid var(--xc-line);
	border-radius: 12px;
	padding: .8rem;
	align-items: start;
}
.xc-rw-reorder__thumb { grid-area: thumb; }
.xc-rw-reorder__thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; display: block; }
.xc-rw-reorder__body { grid-area: body; display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.xc-rw-reorder__name { font-weight: 600; color: var(--xc-ink); text-decoration: none; }
.xc-rw-reorder__price { color: var(--xc-blue); font-size: .92rem; }
.xc-rw-reorder__meta { font-size: .78rem; color: var(--xc-muted); }
.xc-rw-reorder__actions { grid-area: actions; display: flex; gap: .5rem; align-items: center; }
.xc-rw-reorder__qty { width: 64px; padding: .45rem .5rem; border: 1px solid var(--xc-line); border-radius: 8px; font-size: .95rem; }
.xc-rw-reorder__add { flex: 1; }
.xc-rw-reorder__feedback { grid-area: feedback; font-size: .82rem; color: var(--xc-ok); min-height: 1em; }
.xc-rw-reorder__feedback.is-error { color: #991B1B; }

/* ---------- Desktop ---------- */
@media (min-width: 560px) {
	.xc-rw-wallet__balances { grid-template-columns: 1.3fr 1fr; align-items: end; }
	.xc-rw-reorder__grid { grid-template-columns: 1fr 1fr; }
	.xc-rw-reorder__item {
		grid-template-columns: 72px 1fr;
		grid-template-areas: "thumb body" "thumb actions" "feedback feedback";
	}
}
@media (min-width: 782px) {
	.xc-rw-bal--primary .xc-rw-bal__value { font-size: 2.3rem; }
}
