/* Egghey Points & Rewards – Frontend Styles */

/* ── My Account ──────────────────────────────────────────────────────────── */
.epr-myaccount { max-width: 800px; }

.epr-balance-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f7a800 0%, #ff6b35 100%);
    color: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(247,168,0,.3);
}
.epr-bal-num  { font-size: 3em; font-weight: 800; line-height: 1; }
.epr-bal-lbl  { font-size: 1.1em; opacity: .85; }
.epr-bal-val  { font-size: .95em; opacity: .75; margin-top: 4px; }
.epr-tier-big {
    display: inline-block; padding: 6px 18px;
    border-radius: 20px; font-weight: 700; font-size: 1.1em;
    color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.epr-tier-sub { font-size: .85em; color: rgba(255,255,255,.8); margin-top: 6px; text-align: center; }

/* Progress bar */
.epr-progress-wrap { margin-bottom: 24px; }
.epr-progress-label { font-size: .9em; margin-bottom: 6px; color: #555; }
.epr-progress-bar   { background: #eee; border-radius: 6px; height: 12px; overflow: hidden; }
.epr-progress-fill  { height: 100%; border-radius: 6px; transition: width .6s ease; }

/* Sections */
.epr-section {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}
.epr-section h3 { margin-top: 0; font-size: 1.1em; }

/* Referral link */
.epr-ref-row { display: flex; gap: 8px; margin: 12px 0; }
.epr-ref-row input { flex: 1; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: .9em; }
.epr-ref-row button, .epr-redeem-row button {
    background: #f7a800; color: #fff; border: none;
    padding: 8px 18px; border-radius: 6px; cursor: pointer; font-weight: 600;
}
.epr-ref-row button:hover, .epr-redeem-row button:hover { background: #e09700; }

/* Redeem */
.epr-redeem-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.epr-redeem-row input { width: 100px; padding: 8px; border: 1px solid #ddd; border-radius: 6px; }

/* Table */
.epr-table { width: 100%; border-collapse: collapse; font-size: .9em; }
.epr-table th, .epr-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; text-align: left; }
.epr-table th { background: #fafafa; font-weight: 600; }
.epr-pos { color: #22a06b; font-weight: 700; }
.epr-neg { color: #d94c4c; font-weight: 700; }

/* Product notice */
.epr-product-notice {
    background: #fff8e6; border: 1px solid #f7d96b;
    border-radius: 8px; padding: 8px 14px;
    font-size: .9em; color: #7a5c00;
}

/* Cart notice */
.epr-cart-notice { background: #fff8e6; color: #7a5c00; font-size: .9em; padding: 8px 0; }

/* Tier badge (global) */
.epr-tier-badge {
    display: inline-block; padding: 2px 10px;
    border-radius: 12px; color: #fff;
    font-size: .8em; font-weight: 700;
    text-shadow: 0 1px 1px rgba(0,0,0,.2);
}

/* ── Cart Points Coupon Box (matches "Add coupons" style) ────────────────── */
/*
 * position:relative + z-index ensures the widget stays ABOVE any
 * WooCommerce Block Cart loading-mask overlays (which sit at z-index:1).
 * pointer-events:all guarantees clicks reach our elements even when a
 * parent has pointer-events:none during a React loading state.
 */
.epr-coupon-box {
    position: relative;
    z-index: 100;
    pointer-events: all !important;
    border-top: 1px solid #e0e0e0;
    margin-bottom: 0;
    font-size: .93em;
}

/* Header toggle row */
.epr-coupon-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
    cursor: pointer !important;
    pointer-events: all !important;
    user-select: none;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid transparent;
    transition: color .15s;
}
.epr-coupon-toggle:hover { color: #f7a800; }
.epr-coupon-toggle.epr-has-points { color: #1a6e1a; }
.epr-coupon-toggle-icon { font-size: 1.1em; flex-shrink: 0; }
.epr-coupon-toggle small { font-size: .85em; }
.epr-coupon-chevron {
    margin-left: auto;
    font-size: 1.2em;
    line-height: 1;
    color: #aaa;
    transition: transform .2s;
}

/* Body */
.epr-coupon-body {
    padding: 12px 0 16px;
    border-top: 1px solid #f0f0f0;
}

/* Input + button row */
.epr-coupon-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.epr-coupon-row input[type="number"] {
    flex: 1;
    min-width: 90px;
    max-width: 130px;
    height: 42px;
    padding: 0 12px;
    border: 1.5px solid #ccc;
    border-radius: 4px;
    font-size: .95em;
    color: #333;
    background: #fff;
    transition: border-color .15s;
    -moz-appearance: textfield;
}
.epr-coupon-row input[type="number"]::-webkit-outer-spin-button,
.epr-coupon-row input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.epr-coupon-row input[type="number"]:focus {
    outline: none;
    border-color: #f7a800;
    box-shadow: 0 0 0 2px rgba(247,168,0,.18);
}

/* Apply button */
.epr-apply-btn {
    height: 42px;
    padding: 0 20px;
    background: #f7a800;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    font-size: .93em;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.epr-apply-btn:hover:not(:disabled) { background: #e09600; }
.epr-apply-btn:disabled { opacity: .55; cursor: not-allowed; }

/* Remove button */
.epr-remove-btn {
    height: 42px;
    padding: 0 14px;
    background: none;
    color: #888;
    border: 1.5px solid #ddd;
    border-radius: 4px;
    font-size: .88em;
    cursor: pointer;
    transition: border-color .15s, color .15s;
    white-space: nowrap;
}
.epr-remove-btn:hover { border-color: #d63638; color: #d63638; }
.epr-remove-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Hint text */
.epr-coupon-hint {
    margin-top: 8px;
    font-size: .8em;
    color: #999;
}

/* Feedback message */
.epr-coupon-msg {
    margin-top: 8px;
    font-size: .88em;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 4px;
}
.epr-msg-ok  { background: #eafbea; color: #1a6e1a; }
.epr-msg-err { background: #fdf0f0; color: #d63638; }

/* Leaderboard */
.epr-leaderboard { max-width: 500px; }
.epr-lb-list { list-style: none; padding: 0; margin: 0; }
.epr-lb-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid #f0f0f0;
}
.epr-lb-rank { font-weight: 800; color: #f7a800; width: 32px; }
.epr-lb-name { flex: 1; }
.epr-lb-pts  { font-weight: 700; color: #333; }

/* ── Programme Rules collapsible section ────────────────────────────────── */
.epr-rules-section .epr-rules-toggle {
    user-select: none;
}
.epr-rules-section .epr-rules-toggle:hover h3 { color: #f7a800; }
.epr-rules-body ul { padding-left: 20px; }
.epr-rules-body ul li { margin-bottom: 6px; }
.epr-rules-body h4 { margin-top: 0; }
