:root {
    --tw-green:        #1EC55C;
    --tw-green-hover:  #17a94e;
    --tw-green-soft:   #ecfdf3;
    --tw-green-tint:   #f0fdf4;
    --tw-green-border: #bbf7d0;
    --tw-green-ink:    #14532d;
    --tw-green-accent: #15803d;
    --tw-gold:         #D4AF37;

    --tw-ink:     #111827;
    --tw-ink-2:   #6b7280;
    --tw-ink-3:   #9ca3af;
    --tw-border:  #e5e7eb;
    --tw-divider: #f3f4f6;
    --tw-surface: #fff;

    --tw-red:        #ef4444;
    --tw-red-soft:   #fef2f2;
    --tw-red-border: #fecaca;

    --tw-radius:      12px;
    --tw-radius-sm:   8px;
    --tw-radius-pill: 20px;

    --tw-font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.twowallet-panel {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
}

.twowallet-rewards-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.twowallet-rewards-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* ── 2Wallet checkout panel — design system ─────────────────── */

.tw-checkout-panel {
    font-family: var(--tw-font);
    background: var(--tw-surface);
    border: 1px solid var(--tw-border);
    border-radius: var(--tw-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    position: relative;
    overflow: hidden;
}

/* Loading skeleton shimmer */
.tw-checkout-panel.tw-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.8) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: tw-shimmer 1.4s infinite;
    pointer-events: none;
}

@keyframes tw-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

.tw-checkout-header,
.tw-account-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tw-checkout-brand-logo,
.tw-account-brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.tw-checkout-brand-initials,
.tw-account-brand-initials {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--tw-green, #1EC55C);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.tw-checkout-header-text {
    flex: 1;
    min-width: 0;
}

.tw-checkout-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tw-ink);
    margin: 0;
    line-height: 1.3;
}

.tw-checkout-subtitle {
    font-size: 12px;
    color: var(--tw-ink-2);
    margin: 2px 0 0;
}

.tw-checkout-balance-badge {
    display: inline-flex;
    align-items: center;
    background: var(--tw-green-tint);
    border: 1px solid var(--tw-green-border);
    color: var(--tw-green-accent);
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--tw-radius-pill);
    flex-shrink: 0;
}

.tw-checkout-divider {
    height: 1px;
    background: var(--tw-divider);
    margin: 16px 0;
}

.tw-checkout-section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--tw-ink-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px;
}

.tw-checkout-catalog {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.tw-checkout-reward-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--tw-divider);
}

.tw-checkout-reward-item:last-child {
    border-bottom: none;
}

.tw-reward-info {
    flex: 1;
    min-width: 0;
}

.tw-reward-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--tw-ink);
    margin: 0;
}

.tw-reward-cost {
    font-size: 12px;
    color: var(--tw-ink-2);
    margin: 2px 0 0;
}

.tw-reward-remaining {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--tw-green-accent);
    background: var(--tw-green-soft);
    border: 1px solid var(--tw-green-border);
    border-radius: var(--tw-radius-pill);
    padding: 4px 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tw-reward-btn {
    background: var(--tw-green, #1EC55C);
    color: #fff;
    border: none;
    border-radius: var(--tw-radius-sm);
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tw-reward-btn:hover {
    background: var(--tw-green-hover);
}

.tw-reward-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* Cart: single-row layout (default) */
.tw-checkout-active {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

/* Checkout: compact two-row layout, with remove button */
.tw-checkout-active--compact {
    flex-direction: column;
    gap: 4px;
}

.tw-checkout-active-icon {
    color: var(--tw-green, #1EC55C);
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1.4;
}

/* Cart: info column (name + saving text stacked) */
.tw-checkout-active-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tw-checkout-active-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--tw-ink);
    margin: 0;
}

/* Cart: points redeemed line */
.tw-checkout-active-saving {
    font-size: 12px;
    color: var(--tw-ink-2);
    margin: 0;
}

/* Checkout row 1: icon + name inline */
.tw-checkout-active-desc {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Checkout row 2: deduction in red, indented to align with name */
.tw-checkout-active-brief {
    font-size: 12px;
    color: var(--tw-red);
    padding-left: 24px;
}

.tw-remove-btn {
    background: none;
    border: 1px solid var(--tw-border);
    border-radius: var(--tw-radius-sm);
    color: var(--tw-ink-2);
    font-size: 12px;
    padding: 5px 12px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tw-remove-btn:hover {
    border-color: var(--tw-green, #1EC55C);
    color: var(--tw-green-accent);
}

.tw-checkout-empty {
    text-align: center;
    padding: 16px 0 8px;
}

.tw-checkout-empty-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.tw-checkout-empty p {
    font-size: 13px;
    color: var(--tw-ink-2);
    margin: 0;
}

.tw-checkout-guest {
    padding: 12px 0 4px;
    text-align: center;
}

.tw-checkout-guest p {
    font-size: 13px;
    color: var(--tw-ink-2);
    margin: 0 0 8px;
}

.tw-checkout-guest a {
    color: var(--tw-green, #1EC55C);
    font-weight: 600;
    text-decoration: none;
}

.tw-checkout-guest a:hover {
    text-decoration: underline;
}

.tw-checkout-error {
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--tw-red-soft);
    border: 1px solid var(--tw-red-border);
    border-radius: var(--tw-radius-sm);
    color: #dc2626;
    font-size: 13px;
}

/* ── My Account panel ───────────────────────────────────── */

.tw-account-panel {
    font-family: var(--tw-font);
    background: var(--tw-surface);
    border: 1px solid var(--tw-border);
    border-radius: var(--tw-radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

.tw-account-info {
    flex: 1;
    min-width: 0;
}

.tw-account-program-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--tw-ink);
    margin: 0;
    line-height: 1.3;
}

.tw-account-program-type {
    font-size: 12px;
    color: var(--tw-ink-2);
    margin: 2px 0 0;
}

.tw-account-balance-value {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--tw-green-tint);
    border: 1px solid var(--tw-green-border);
    color: var(--tw-green-accent);
    font-size: 14px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--tw-radius-pill);
    flex-shrink: 0;
}

/* ── 2Wallet pass download QR prompt ──────────────────────────── */

.tw-pass-download {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 0 4px;
    text-align: center;
}

.tw-pass-download-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--tw-ink);
    line-height: 1.4;
}

.tw-pass-download-desc {
    margin: 0;
    font-size: 13px;
    color: var(--tw-ink-2);
    line-height: 1.5;
    max-width: 240px;
}

.tw-pass-download-qr-link {
    display: inline-block;
    border-radius: var(--tw-radius-sm);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.tw-pass-download-qr-link:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(30, 197, 92, 0.25);
}

.tw-pass-download-qr {
    display: block;
    width: 160px;
    height: 160px;
    border: 2px solid var(--tw-border);
}

.tw-pass-download-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: var(--tw-green, #1EC55C);
    text-decoration: none;
    padding: 4px 0;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.tw-pass-download-link:hover {
    border-bottom-color: var(--tw-green, #1EC55C);
    text-decoration: none;
    color: var(--tw-green-hover);
}

/* ── Mobile: show button, hide QR ───────────────────────────── */

.tw-pass-download-btn {
    display: none;
    padding: 12px 28px;
    background: var(--tw-green, #1EC55C);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--tw-radius-sm);
    text-decoration: none;
    text-align: center;
    transition: background 0.15s ease;
}

.tw-pass-download-btn:hover {
    background: var(--tw-green-hover);
    color: #fff;
    text-decoration: none;
}

.tw-pass-download-desc--mobile {
    display: none;
}

@media (max-width: 768px) {
    .tw-pass-download-qr-link {
        display: none;
    }

    .tw-pass-download-desc--desktop {
        display: none;
    }

    .tw-pass-download-desc--mobile {
        display: block;
    }

    .tw-pass-download-btn {
        display: inline-block;
    }

    .tw-pass-download-link {
        display: none;
    }
}

/* ── 2Wallet account activity tables ─────────────────────────── */

.tw-account-activity {
    padding-top: 4px;
}

.tw-activity-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tw-ink);
    margin: 0 0 12px;
}

.tw-activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: #374151;
}

.tw-activity-table th,
.tw-activity-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--tw-divider);
}

.tw-activity-table th {
    font-weight: 600;
    color: var(--tw-ink-2);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tw-activity-table tbody tr:last-child td {
    border-bottom: none;
}

.tw-activity-qty {
    font-weight: 700;
    text-align: right;
}

.tw-activity-positive { color: var(--tw-green, #1EC55C); }
.tw-activity-negative { color: var(--tw-red); }

/* --- No-redemption notice (checkout read-only mode) --- */
.tw-checkout-no-redemption {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    margin-top: 8px;
    background: #f9fafb;
    border-radius: var(--tw-radius-sm);
    color: var(--tw-ink-2);
    font-size: 13px;
}
.tw-checkout-no-redemption-icon {
    font-size: 18px;
    flex-shrink: 0;
}
.tw-checkout-no-redemption-text {
    margin: 0;
}

/* ── Guest toggle views ──────────────────────────────────────── */

.tw-guest-view { text-align: center; padding: 8px 0; }
.tw-guest-qr { display: block; margin: 12px auto; }
.tw-guest-email { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: var(--tw-radius-sm); font-size: 15px; margin: 8px 0; }
/* In-input "revalidate" icon: re-runs the email lookup without retyping. Hardened against
   host-theme button styles (grey bg, padding, static position) with higher specificity +
   !important on the properties themes most often override. */
.tw-guest-email-wrap { position: relative; }
.tw-guest-email-wrap .tw-guest-email { padding-right: 42px; }
.tw-guest-email-wrap .tw-guest-revalidate {
	position: absolute !important;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	   -moz-appearance: none;
	        appearance: none;
	color: var(--tw-ink-2);
	cursor: pointer;
	border-radius: var(--tw-radius-sm);
	line-height: 0;
}
.tw-guest-email-wrap .tw-guest-revalidate:hover { color: var(--tw-green, #1EC55C); background: var(--tw-green-tint) !important; }
.tw-guest-email-wrap .tw-guest-revalidate svg { display: block; width: 16px; height: 16px; }
.tw-guest-link { display: inline-block; margin-top: 10px; font-size: 13px; color: #4b5563; text-decoration: none; cursor: pointer; }
/* Make the call-to-action part pop so the toggle is intuitive. */
.tw-guest-link-cta { color: var(--tw-green, #1EC55C); font-weight: 600; text-decoration: underline; white-space: nowrap; }
.tw-guest-link:hover .tw-guest-link-cta { color: var(--tw-green-hover); }
.tw-guest-lookup-error { color: #b91c1c; font-size: 13px; margin-top: 6px; }
/* The QR is only useful on desktop (can't scan your own phone screen). */
@media (max-width: 600px) { .tw-guest-qr { display: none; } }

/* ── Guest progress stepper (desktop only) ───────────────────── */
/* Mirrors the dashboard stepper: "Paso N" + subtitle + segment bars. Hidden on
   mobile, where the customer always lands on the email view directly. */
.tw-stepper { display: none; text-align: left; margin: 0 0 4px; }
/* Desktop only, and only once the customer has reached the QR flow (tw-steps-visible),
   so a hook+fidelity store that defaults to the email view doesn't show a lone "Paso 2". */
@media (min-width: 601px) { .tw-guest.tw-steps-visible .tw-stepper { display: block; } }
.tw-stepper-label { margin: 0; font-size: 15px; font-weight: 700; color: var(--tw-ink); }
.tw-stepper-sub { margin: 2px 0 8px; font-size: 13px; color: var(--tw-ink-2); }
.tw-stepper-bars { display: flex; gap: 8px; }
.tw-stepper-bar { flex: 1; height: 6px; border-radius: var(--tw-radius-pill); background: var(--tw-border); }
.tw-stepper-bar--done { background: var(--tw-green, #1EC55C); }

/* ── PIN verification box (guest redeem gate) ────────────────── */

.tw-pin-box { margin-top: 12px; text-align: center; }
.tw-pin-input { letter-spacing: 8px; text-align: center; font-size: 20px; padding: 8px; width: 160px; border: 1px solid #d1d5db; border-radius: var(--tw-radius-sm); }
.tw-pin-verify { display: block; margin: 10px auto 0; }
.tw-pin-error { color: #b91c1c; font-size: 13px; margin-top: 6px; }
/* Loading feedback while verifying the PIN. */
.tw-pin-loading { opacity: 0.6; }
.tw-pin-loading .tw-pin-verify { cursor: progress; }
.tw-pin-loading .tw-pin-verify::after {
	content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 8px;
	vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent;
	border-radius: 50%; animation: tw-pin-spin 0.6s linear infinite;
}
@keyframes tw-pin-spin { to { transform: rotate(360deg); } }

/* ── Guest widget redesign ─────────────────────────────── */
/* The redesigned balance view is left-aligned (teaser, rows, label). */
.tw-guest-view--balance { text-align: left; }

.tw-badge-free {
	background: transparent;
	border: 0;
	color: var(--tw-green-accent);
	font-weight: 600;
	padding: 0;
}

.tw-earn-box {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: var(--tw-green-soft);
	border-radius: var(--tw-radius);
	padding: 12px 14px;
	margin: 14px 0 12px;
}
.tw-earn-icon { color: var(--tw-green-accent); flex-shrink: 0; line-height: 0; margin-top: 1px; }
.tw-earn-text { margin: 0; font-size: 14px; line-height: 1.4; color: var(--tw-green-ink); }
.tw-earn-text strong { display: block; color: var(--tw-green-ink); font-weight: 700; }

.tw-info-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 10px 0;
}
.tw-info-icon { color: var(--tw-ink-3); flex-shrink: 0; line-height: 0; margin-top: 1px; }
.tw-info-text { margin: 0; font-size: 13px; line-height: 1.4; color: var(--tw-ink-2); }
.tw-info-text strong { color: #4b5563; font-weight: 600; }

.tw-field-label {
	display: block;
	margin: 16px 0 6px;
	font-size: 14px;
	font-weight: 600;
	color: #374151;
}

/* ponytail: !important on the CTA — the widget lives in arbitrary themes whose
   button rules (.woocommerce a.button, button) outrank a single class; scope-
   hardening alone is unreliable. */
.tw-checkout-panel .tw-btn-primary,
a.tw-btn-primary,
button.tw-btn-primary {
	display: block !important;
	width: 100% !important;
	box-sizing: border-box !important;
	background: var(--tw-green, #1EC55C) !important;
	color: #fff !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	text-align: center !important;
	text-decoration: none !important;
	text-transform: none !important;
	border: 0 !important;
	border-radius: 10px !important;
	box-shadow: none !important;
	padding: 13px 16px !important;
	margin-top: 12px !important;
	cursor: pointer !important;
	transition: background 0.15s ease, opacity 0.15s ease;
}
.tw-checkout-panel a.tw-btn-primary:hover,
.tw-checkout-panel button.tw-btn-primary:hover {
	background: var(--tw-green-hover) !important;
	color: #fff !important;
}
.tw-btn-primary[aria-disabled="true"],
.tw-btn-primary:disabled {
	opacity: 0.55 !important;
	pointer-events: none;
}
.tw-btn-block { display: block; }
/* Green accent icon (person / "sin cuenta" row) to match the mockup. */
.tw-info-icon--accent { color: var(--tw-green-accent); }
.tw-info-icon--accent-2 { color: var(--tw-gold); }

.tw-guest-footer {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 6px;
	text-align: center;
	margin: 12px 0 0;
	font-size: 12px;
	line-height: 1.4;
	color: var(--tw-ink-3);
}
.tw-guest-footer-icon { flex-shrink: 0; line-height: 0; margin-top: 1px; }

/* Cashback apply/active panels add NO new CSS — they reuse the existing design line
 * entirely via markup classes: apply headline → .tw-info-row/.tw-info-text, apply CTA
 * → .tw-reward-btn, active row → .tw-checkout-active (+ --cashback marker, unstyled),
 * remove → .tw-remove-btn. Single source of truth; nothing to declare here. */

/* ── Coupon panel ─────────────────────────────────────────────────────────── */
.tw-coupon-benefit { text-align: center; margin: 12px 0 16px; }
.tw-coupon-benefit__value { display: block; font-size: 18px; font-weight: 800; color: var(--tw-ink); }
.tw-coupon-benefit__expiry { display: block; font-size: 12px; color: var(--tw-ink-2); margin-top: 4px; }
.tw-coupon-applied { text-align: center; font-weight: 700; color: var(--tw-green-accent); margin: 12px 0 4px; }
.tw-coupon-applied__hint { text-align: center; font-size: 12px; color: var(--tw-ink-2); margin: 0 0 12px; }
.tw-coupon-panel--applied .tw-remove-btn { display: block; margin: 0 auto; }
.tw-badge-coupon { background: var(--tw-green-tint); border: 1px solid var(--tw-green-border); color: var(--tw-green-ink); }
.tw-coupon-disclaimer { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 1.4; color: var(--tw-ink-2); margin: 8px 4px 4px; }
.tw-coupon-disclaimer-icon { flex: 0 0 auto; line-height: 0; margin-top: 2px; }
.tw-coupon-panel--pending { opacity: 0.85; }
.tw-coupon-pending { text-align: center; font-size: 13px; line-height: 1.45; color: var(--tw-ink-2); margin: 12px 4px 4px; }
.tw-badge-pending { background: #EEF1F5; border: 1px solid #D5DBE3; color: #5B6472; }
