/**
 * MultBlock Rewards - Public CSS
 */

/* Badge Widget (My Account) */
.mbr-badge-widget {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 12px;
}

.mbr-badge-widget-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mbr-widget-badge-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.mbr-widget-badge-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
}

.mbr-widget-info {
    display: flex;
    flex-direction: column;
}

.mbr-widget-level {
    font-size: 16px;
    font-weight: 600;
}

.mbr-widget-points {
    font-size: 13px;
    color: #666;
}

/* My Account Points Page */
.mbr-my-account-points {
    max-width: 800px;
}

.mbr-points-header {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.mbr-current-badge {
    flex: 1;
    min-width: 200px;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.mbr-badge-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.mbr-badge-info {
    display: flex;
    flex-direction: column;
}

.mbr-badge-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.mbr-badge-name {
    font-size: 24px;
    font-weight: 700;
}

.mbr-points-box {
    flex: 1;
    min-width: 200px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: center;
}

.mbr-points-value {
    display: block;
    font-size: 42px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.mbr-points-label {
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

/* Total Acumulado - Sutil */
.mbr-total-subtle {
    display: block;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e0e0e0;
    font-size: 12px;
    color: #888;
}

.mbr-total-subtle strong {
    color: #666;
    font-weight: 600;
}

/* Progress Section */
.mbr-progress-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.mbr-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.mbr-progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.mbr-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.mbr-max-level {
    margin-bottom: 30px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #ffd70020, #ffd70040);
    border-radius: 12px;
    text-align: center;
    color: #b8860b;
    font-weight: 500;
}

.mbr-max-level .dashicons {
    color: #ffd700;
    margin-right: 5px;
}

/* Benefits Section */
.mbr-benefits-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #e8f5e9;
    border-radius: 12px;
}

.mbr-benefits-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #2e7d32;
}

.mbr-benefits-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mbr-benefits-list li {
    padding: 8px 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mbr-benefits-list .dashicons {
    color: #4caf50;
}

/* ========================================
   INFO CARDS - Como Ganhar Pontos
   ======================================== */
.mbr-info-cards-section {
    margin-bottom: 30px;
}

.mbr-info-cards-title {
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    color: #1a365d;
    margin: 0 0 20px 0;
}

.mbr-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.mbr-info-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8edf2;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.mbr-info-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.mbr-info-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #e8f4fd, #d0e8f9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.mbr-info-card-icon svg {
    width: 24px;
    height: 24px;
    color: #1565c0;
    fill: #1565c0;
}

.mbr-info-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a365d;
    margin: 0 0 10px 0;
}

.mbr-info-card-text {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

.mbr-info-card-example {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    color: #475569;
}

/* Responsive */
@media (max-width: 640px) {
    .mbr-info-cards {
        grid-template-columns: 1fr;
    }

    .mbr-info-cards-title {
        font-size: 18px;
    }
}

/* Referral Section */
.mbr-referral-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #e3f2fd;
    border-radius: 12px;
}

.mbr-referral-section h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #1565c0;
}

.mbr-referral-section p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

.mbr-referral-box {
    display: flex;
    gap: 10px;
}

.mbr-referral-box input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #90caf9;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
}

.mbr-copy-btn {
    padding: 10px 20px;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.mbr-copy-btn:hover {
    background: #1565c0;
}

.mbr-referral-stats {
    margin-top: 10px !important;
    font-size: 13px;
    color: #666;
}

/* Actions */
.mbr-actions {
    margin-top: 20px;
}

.mbr-btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s;
}

.mbr-btn-secondary:hover {
    background: #e0e0e0;
    color: #333;
}

/* History Table */
.mbr-points-history h2 {
    margin-bottom: 20px;
}

.mbr-history-table {
    width: 100%;
    border-collapse: collapse;
}

.mbr-history-table th,
.mbr-history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.mbr-history-table th {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 13px;
    color: #666;
}

.mbr-positive {
    color: #2e7d32;
    font-weight: 600;
}

.mbr-negative {
    color: #c62828;
    font-weight: 600;
}

.mbr-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.mbr-type-signup { background: #e3f2fd; color: #1565c0; }
.mbr-type-purchase { background: #e8f5e9; color: #2e7d32; }
.mbr-type-referral { background: #fff3e0; color: #e65100; }
.mbr-type-referral_commission { background: #e0f2f1; color: #00796b; }
.mbr-type-admin { background: #f3e5f5; color: #7b1fa2; }
.mbr-type-badge_reward { background: #fff8e1; color: #f9a825; }
.mbr-type-redeem { background: #ffebee; color: #c62828; }

.mbr-no-history {
    padding: 40px;
    text-align: center;
    color: #666;
    background: #f5f5f5;
    border-radius: 12px;
}

.mbr-back-link {
    margin-top: 20px;
}

.mbr-back-link a {
    color: #1976d2;
    text-decoration: none;
}

.mbr-back-link a:hover {
    text-decoration: underline;
}

/* Points Form (Cart/Checkout) */
.mbr-points-form {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* ========================================
   ETIQUETA DE DESCONTO POR MEMBERSHIP
   ======================================== */

/* Etiqueta de desconto */
.mbr-discount-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mbr-discount-tag svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    fill: currentColor;
}

/* Cores por nivel */
.mbr-discount-tag.mbr-level-iniciante {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
}

.mbr-discount-tag.mbr-level-bronze {
    background: linear-gradient(135deg, #cd7f32, #d4a574);
    color: #fff;
}

.mbr-discount-tag.mbr-level-prata {
    background: linear-gradient(135deg, #a0a0a0, #c0c0c0);
    color: #333;
}

.mbr-discount-tag.mbr-level-ouro {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #333;
}

.mbr-discount-tag.mbr-level-diamante {
    background: linear-gradient(135deg, #0097a7, #4dd0e1);
    color: #fff;
}

/* Variante compacta para minicart e tabelas */
.mbr-discount-tag-compact {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mbr-discount-tag-compact svg {
    width: 10px;
    height: 10px;
    fill: currentColor;
}

.mbr-discount-tag-compact.mbr-level-iniciante {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
}

.mbr-discount-tag-compact.mbr-level-bronze {
    background: linear-gradient(135deg, #cd7f32, #d4a574);
    color: #fff;
}

.mbr-discount-tag-compact.mbr-level-prata {
    background: linear-gradient(135deg, #a0a0a0, #c0c0c0);
    color: #333;
}

.mbr-discount-tag-compact.mbr-level-ouro {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #333;
}

.mbr-discount-tag-compact.mbr-level-diamante {
    background: linear-gradient(135deg, #0097a7, #4dd0e1);
    color: #fff;
}

/* Economia total no carrinho/checkout */
.mbr-savings-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #4caf50;
}

.mbr-savings-banner svg {
    width: 24px;
    height: 24px;
    color: #2e7d32;
    flex-shrink: 0;
}

.mbr-savings-banner-content {
    flex: 1;
}

.mbr-savings-banner-title {
    font-weight: 700;
    color: #2e7d32;
    font-size: 14px;
    margin-bottom: 2px;
}

.mbr-savings-banner-amount {
    color: #1b5e20;
    font-size: 13px;
}

.mbr-savings-banner-amount strong {
    font-size: 16px;
}

/* Badge no item do carrinho */
.mbr-cart-item-discount {
    display: block;
    margin-top: 5px;
}

/* Preco original riscado */
.mbr-original-price {
    color: #999 !important;
    font-weight: 400 !important;
}

/* Preco com desconto */
.mbr-discounted-price {
    color: #2e7d32 !important;
    font-weight: 700 !important;
}

/* Mini Cart especifico */
.widget_shopping_cart .mbr-discount-tag-compact {
    margin-top: 4px;
    display: inline-flex;
}

/* Carrinho - Tabela */
.woocommerce-cart-form .mbr-discount-tag-compact {
    margin-top: 5px;
}

/* Checkout - Review */
.woocommerce-checkout-review-order .mbr-discount-tag-compact {
    margin-left: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .mbr-points-header {
        flex-direction: column;
    }

    .mbr-referral-box {
        flex-direction: column;
    }

    .mbr-history-table thead {
        display: none;
    }

    .mbr-history-table tr {
        display: block;
        margin-bottom: 15px;
        background: #f9f9f9;
        border-radius: 8px;
        padding: 10px;
    }

    .mbr-history-table td {
        display: flex;
        justify-content: space-between;
        border: none;
        padding: 8px 10px;
    }

    .mbr-history-table td::before {
        content: attr(data-title);
        font-weight: 600;
        color: #666;
    }
}
