/*
 * WC Reward Widget
 */

.wcrw-calc-input::-webkit-outer-spin-button,
.wcrw-calc-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.wcrw-calc-input[type=number] {
    -moz-appearance: textfield !important;
}

.wcrw-cart-progress,
.wcrw-wallet-card,
.wcrw-checkout-wallet {
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 18px;
    padding: 16px;
    border: 1px solid #e7e7e7;
    border-radius: 8px;
    background: #fff;
}

.wcrw-cart-progress *,
.wcrw-wallet-card *,
.wcrw-checkout-wallet * {
    box-sizing: border-box;
}

.wcrw-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.wcrw-progress-title {
    font-size: 14px;
    line-height: 1.3;
}

.wcrw-pct {
    color: #b7791f;
    font-size: 13px;
    font-weight: 700;
}

.wcrw-progress-track {
    position: relative;
    display: block;
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #eeeeee;
}

.wcrw-fill {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f0ad00, #d97706);
    transition: width 0.45s ease;
}

.wcrw-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.5);
    animation: wcrw_glow 1.5s ease-in-out infinite;
}

.wcrw-progress-label,
.wcrw-wallet-card p,
.wcrw-checkout-wallet p {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.45;
}

.wcrw-wallet-card strong,
.wcrw-checkout-wallet strong {
    display: block;
    font-size: 16px;
    line-height: 1.3;
}

.wcrw-wallet-card {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border-color: color-mix(in srgb, var(--wcrw-wallet-accent, #d97706) 22%, #e5e7eb);
    border-radius: var(--wcrw-wallet-radius, 16px);
    background: var(--wcrw-wallet-bg, #fff);
    color: var(--wcrw-wallet-text, #172033);
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.09);
}

.wcrw-wallet-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: var(--wcrw-wallet-accent, #d97706);
}

.wcrw-wallet-card > strong:first-child {
    color: var(--wcrw-wallet-muted, #64748b);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wcrw-wallet-card > p:first-of-type {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    margin: 12px 0 14px;
    padding: 12px 16px;
    border-radius: max(8px, calc(var(--wcrw-wallet-radius, 16px) - 6px));
    background: color-mix(in srgb, var(--wcrw-wallet-accent, #d97706) 8%, #fff);
    color: var(--wcrw-wallet-text, #172033);
    font-weight: 800;
}

.wcrw-wallet-card--soft {
    box-shadow: none;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--wcrw-wallet-accent, #d97706) 10%, transparent), transparent 42%),
        var(--wcrw-wallet-bg, #fff);
}

.wcrw-wallet-card--minimal {
    padding: 0;
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: none;
}

.wcrw-wallet-card--minimal::before {
    display: none;
}

.wcrw-wallet-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.wcrw-wallet-kicker,
.wcrw-wallet-meta span,
.wcrw-referral-field span {
    display: block;
    color: var(--wcrw-wallet-muted, #64748b);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wcrw-wallet-hero strong {
    margin-top: 6px;
    color: var(--wcrw-wallet-text, #172033);
    font-size: 40px;
    font-weight: 850;
    letter-spacing: 0;
}

.wcrw-wallet-value {
    color: var(--wcrw-wallet-muted, #64748b);
    font-weight: 700;
}

.wcrw-wallet-badge {
    flex: 0 0 auto;
    max-width: 45%;
    padding: 8px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--wcrw-wallet-accent, #d97706) 14%, #fff);
    color: var(--wcrw-wallet-accent, #d97706);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
}

.wcrw-wallet-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 18px;
}

.wcrw-wallet-meta {
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--wcrw-wallet-accent, #d97706) 16%, #e5e7eb);
    border-radius: max(8px, calc(var(--wcrw-wallet-radius, 16px) - 6px));
    background: color-mix(in srgb, var(--wcrw-wallet-accent, #d97706) 6%, var(--wcrw-wallet-bg, #fff));
}

.wcrw-wallet-meta strong {
    margin-top: 4px;
    color: var(--wcrw-wallet-text, #172033);
    font-size: 15px;
}

.wcrw-wallet-coins {
    color: var(--wcrw-wallet-accent, #d97706);
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
}

.wcrw-wallet-note {
    color: var(--wcrw-wallet-muted, #666);
}

.wcrw-checkout-wallet label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.wcrw-product-bonus,
.wcrw-cart-nudge,
.wcrw-checkout-nudge td {
    padding: 12px 14px;
    border: 1px solid #f0d48a;
    border-radius: 8px;
    background: #fff8e1;
    color: #7a4a00;
    font-weight: 700;
}

.wcrw-product-bonus {
    margin: 0 0 14px;
}

.wcrw-cart-nudge {
    margin: 0 0 16px;
}

.wcrw-floating-wallet {
    position: fixed;
    z-index: 9998;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--wcrw-floating-bg, #111827);
    color: var(--wcrw-floating-text, #fff);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.wcrw-floating-wallet--bottom_right {
    right: 18px;
    bottom: 86px;
}

.wcrw-floating-wallet--bottom_left {
    left: 18px;
    bottom: 86px;
}

.wcrw-floating-wallet--top_right {
    top: 86px;
    right: 18px;
}

.wcrw-floating-wallet--top_left {
    top: 86px;
    left: 18px;
}

.wcrw-floating-wallet span {
    font-weight: 800;
}

.wcrw-referral-field {
    display: block;
    margin: 0 0 16px;
}

.wcrw-referral-field input {
    width: 100%;
    min-height: 42px;
    margin-top: 8px;
    padding: 0 12px;
    border: 1px solid color-mix(in srgb, var(--wcrw-wallet-accent, #d97706) 18%, #d1d5db);
    border-radius: max(8px, calc(var(--wcrw-wallet-radius, 16px) - 8px));
    background: #fff;
    color: var(--wcrw-wallet-text, #172033);
    font-size: 13px;
}

.wcrw-wallet-history-heading {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid color-mix(in srgb, var(--wcrw-wallet-accent, #d97706) 14%, #e5e7eb);
}

.wcrw-wallet-history-heading strong {
    color: var(--wcrw-wallet-text, #172033);
}

.wcrw-wallet-empty {
    margin-top: 18px;
    padding: 14px;
    border: 1px dashed color-mix(in srgb, var(--wcrw-wallet-accent, #d97706) 28%, #d1d5db);
    border-radius: max(8px, calc(var(--wcrw-wallet-radius, 16px) - 6px));
    background: color-mix(in srgb, var(--wcrw-wallet-accent, #d97706) 5%, #fff);
    color: var(--wcrw-wallet-muted, #64748b);
}

.wcrw-wallet-history {
    width: 100%;
    margin-top: 14px;
    border-collapse: collapse;
    font-size: 13px;
}

.wcrw-wallet-history th,
.wcrw-wallet-history td {
    padding: 10px 8px;
    border-bottom: 1px solid color-mix(in srgb, var(--wcrw-wallet-accent, #d97706) 12%, #eeeeee);
    text-align: left;
}

.wcrw-wallet-history th {
    color: var(--wcrw-wallet-muted, #64748b);
    font-size: 12px;
    font-weight: 800;
}

.wcrw-wallet-note input {
    width: 100%;
    margin-top: 6px;
}

.wcrw-box > .wcrw-wallet-card,
.wcrw-box > .wcrw-checkout-wallet {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.wcrw-sticky-progress {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 10px 16px;
    pointer-events: none;
}

.wcrw-sticky-progress--top {
    top: 0;
}

.wcrw-sticky-progress--bottom {
    bottom: 0;
}

.wcrw-sticky-progress .wcrw-cart-progress {
    max-width: 960px;
    margin: 0 auto;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.14);
    pointer-events: auto;
}

@keyframes wcrw_glow {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

@media (max-width: 480px) {
    .wcrw-cart-progress,
    .wcrw-wallet-card,
    .wcrw-checkout-wallet {
        padding: 14px;
    }

    .wcrw-wallet-hero,
    .wcrw-wallet-meta-grid {
        grid-template-columns: 1fr;
    }

    .wcrw-wallet-hero {
        display: block;
    }

    .wcrw-wallet-badge {
        display: inline-block;
        max-width: 100%;
        margin-top: 12px;
    }

    .wcrw-wallet-hero strong {
        font-size: 30px;
    }

    .wcrw-wallet-history {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
