/* =========================================================
   Rewards module - Frontend styles
   ========================================================= */

/* ---------------------------------------------------------
   My Account tab - outer wrapper
   --------------------------------------------------------- */

.smt-rewards-account {
    max-width: 760px;
}

.smt-rewards-account h3 {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 1.2em;
    color: inherit;
}

.smt-rewards-account h4 {
    font-size: 1.05em;
    font-weight: 600;
    margin: 1.4em 0 0.6em;
}

/* ---------------------------------------------------------
   Enroll box
   --------------------------------------------------------- */

.smt-rewards-enroll-box {
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.smt-rewards-enroll-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    cursor: pointer;
}

.smt-rewards-enroll-save {
    flex-shrink: 0;
}

.smt-rewards-enroll-msg {
    font-size: 0.9em;
    color: #2e7d32;
}

.smt-rewards-opted-out-box {
    background: #fef9f0;
    border-color: #f5c875;
    flex-direction: column;
    align-items: flex-start;
}

.smt-rewards-opted-out-msg {
    font-size: 0.95em;
    color: #7a4f00;
    margin: 0;
}

/* ---------------------------------------------------------
   Birthday box
   --------------------------------------------------------- */

.smt-rewards-birthday-box {
    margin-bottom: 20px;
    font-size: 0.95em;
}

.smt-rewards-birthday-box label {
    display: block;
}

.smt-rewards-birthday-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 6px;
}

.smt-rewards-birthday-msg {
    font-size: 0.9em;
    color: #2e7d32;
}

/* ---------------------------------------------------------
   Balance display
   --------------------------------------------------------- */

.smt-rewards-balance-box {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: #fff;
    border-radius: 10px;
    padding: 18px 28px;
    margin: 12px 0 24px;
    box-shadow: 0 4px 14px rgba(21, 101, 192, 0.3);
}

.smt-rewards-balance-number {
    font-size: 2.4em;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
}

.smt-rewards-balance-label {
    font-size: 1em;
    font-weight: 500;
    opacity: 0.88;
    text-transform: lowercase;
}

/* ---------------------------------------------------------
   History table
   --------------------------------------------------------- */

.smt-rewards-history-table {
    width: 100%;
    font-size: 0.9em;
}

.smt-rewards-history-table th,
.smt-rewards-history-table td {
    padding: 8px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #e8e8e8;
}

.smt-rewards-history-table thead th {
    font-weight: 600;
    background: #f3f4f6;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #555;
}

/* Point type badges */
.smt-rewards-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #ebebeb;
    color: #555;
}

.smt-rewards-type-earn       { background: #d6f5e3; color: #0a6928; }
.smt-rewards-type-redeem     { background: #fde8cc; color: #924e00; }
.smt-rewards-type-expire     { background: #fce8e8; color: #900f0f; }
.smt-rewards-type-admin      { background: #e0eaf8; color: #0044aa; }
.smt-rewards-type-refund     { background: #f3f0e0; color: #7a6000; }
.smt-rewards-type-registration { background: #e6d9f5; color: #4a1476; }
.smt-rewards-type-review     { background: #d9f0f5; color: #005f74; }
.smt-rewards-type-birthday   { background: #fce8f5; color: #83006a; }
.smt-rewards-type-level_up   { background: #e0fce8; color: #006b2a; }

/* Plus / minus coloring */
.smt-rewards-plus  { color: #1b7e36; font-weight: 600; }
.smt-rewards-minus { color: #cc2222; font-weight: 600; }

/* Load more button */
.smt-rewards-load-more {
    margin-top: 8px;
}

/* ---------------------------------------------------------
   Cart / Checkout redemption row
   --------------------------------------------------------- */

.smt-rewards-row th,
.smt-rewards-row td {
    vertical-align: middle;
    padding-top: 10px;
    padding-bottom: 10px;
}

.smt-rewards-redeem-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.smt-rewards-balance-hint {
    font-size: 0.85em;
    color: #555;
}

.smt-rewards-redeem-field {
    display: flex;
    gap: 8px;
    align-items: center;
}

.smt-rewards-redeem-field input[type="number"] {
    max-width: 90px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    text-align: center;
}

.smt-rewards-redeem-field .button {
    padding: 6px 14px;
    font-size: 0.9em;
    height: auto;
    line-height: 1.5;
}

.smt-rewards-remove-points {
    margin-left: 8px;
    padding: 4px 10px;
    font-size: 0.85em;
    line-height: 1.4;
}

.smt-rewards-row-applied td {
    text-align: right;
}

.smt-rewards-applied-amount {
    display: inline-block;
}

.smt-rewards-fee-marker {
    display: none;
}

.smt-rewards-redeem-msg {
    font-size: 0.85em;
    font-weight: 500;
    display: none;
}

.smt-rewards-msg-success { color: #1b7e36; }
.smt-rewards-msg-error   { color: #cc2222; }

/* ---------------------------------------------------------
   Guest notice
   --------------------------------------------------------- */

.smt-rewards-guest-notice {
    font-size: 0.95em;
}

/* ---------------------------------------------------------
   Registration opt-in row
   --------------------------------------------------------- */

.smt-rewards-register-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

/* ---------------------------------------------------------
   Popup notification
   --------------------------------------------------------- */

.smt-rewards-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 24px;
    pointer-events: none;
}

.smt-rewards-popup-box {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    padding: 18px 44px 18px 24px;
    max-width: 380px;
    width: 100%;
    position: relative;
    pointer-events: all;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.28s ease, transform 0.28s ease;
    border-left: 4px solid #1565c0;
    font-size: 0.95em;
    line-height: 1.5;
}

.smt-rewards-popup-title {
    margin: 0 0 6px;
    color: #1565c0;
    font-size: 1.05em;
    font-weight: 700;
    line-height: 1.3;
}

.smt-rewards-popup-body {
    color: #333;
}

.smt-rewards-popup-body p {
    margin: 0;
}

.smt-rewards-popup-body p + p {
    margin-top: 6px;
}

.smt-rewards-popup-visible .smt-rewards-popup-box {
    opacity: 1;
    transform: translateY(0);
}

.smt-rewards-popup-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #888;
    padding: 2px;
    line-height: 1;
    border-radius: 3px;
    transition: color 0.15s;
}

.smt-rewards-popup-close:hover {
    color: #333;
}

/* Mobile: full-width bottom toast */
@media (max-width: 480px) {
    .smt-rewards-popup-overlay {
        padding: 12px;
        align-items: flex-end;
        justify-content: center;
    }

    .smt-rewards-popup-box {
        max-width: 100%;
    }
}

/* ---------------------------------------------------------
   Responsive: history table on small screens
   --------------------------------------------------------- */

@media (max-width: 600px) {
    .smt-rewards-balance-box {
        padding: 14px 20px;
    }

    .smt-rewards-balance-number {
        font-size: 1.9em;
    }

    .smt-rewards-history-table thead {
        display: none;
    }

    .smt-rewards-history-table tr {
        display: block;
        border-bottom: 2px solid #e0e0e0;
        padding: 8px 0;
    }

    .smt-rewards-history-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 6px;
        border-bottom: none;
    }

    .smt-rewards-history-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.8em;
        color: #888;
        text-transform: uppercase;
    }
}
