/**
 * Ping Smart Promotions — Frontend Styles
 * @package PingSmartPromotions
 */

/* ── Reward items in cart ──────────────────────────────────────────────────── */

/* "FREE" badge replacing the $0.00 price */
.psp-reward-free {
    display: inline-block;
    background: #2d6a20;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    letter-spacing: .5px;
    text-transform: uppercase;
}

/* "(Reward)" label appended to the product name */
.psp-reward-label {
    display: inline-block;
    color: #2d6a20;
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}

/* ── Progress / incentive message ─────────────────────────────────────────── */

.psp-progress-message {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 1.25em;
    padding: 12px 16px;
    background: #f0f7ee;
    border: 1px solid #c3dbbf;
    border-left: 4px solid #2d6a20;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.psp-progress-message .psp-progress-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}

.psp-progress-message .psp-progress-text {
    flex: 1;
}

/* Slightly smaller on checkout to keep it unobtrusive */
.woocommerce-checkout .psp-progress-message {
    font-size: 13px;
    padding: 10px 14px;
    margin-bottom: 1em;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media ( max-width: 600px ) {
    .psp-progress-message {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* ── Reward selection block (Phase 8) ─────────────────────────────────────── */

.psp-reward-selection {
    margin: 0 0 1.5em;
    padding: 0;
}

.psp-reward-selection-inner {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #16a34a;
    border-radius: 6px;
    padding: 18px 20px;
}

.psp-reward-selection-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.psp-reward-selection-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}

.psp-reward-selection-headline {
    margin: 0 0 3px;
    font-size: 16px;
    font-weight: 700;
    color: #14532d;
    line-height: 1.3;
}

.psp-reward-selection-sub {
    margin: 0;
    font-size: 13px;
    color: #166534;
}

/* Product card grid */
.psp-reward-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.psp-reward-product-card {
    background: #fff;
    border: 1px solid #d1fae5;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: border-color .15s, box-shadow .15s;
}

.psp-reward-product-card:hover {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22,163,74,.15);
}

.psp-reward-product-thumb img,
.psp-reward-product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.psp-reward-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.psp-reward-product-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}

.psp-reward-product-price {
    font-size: 12px;
    color: #6b7280;
    text-decoration: line-through;
}

/* Select button */
.psp-select-reward-btn {
    width: 100%;
    font-size: 12px !important;
    padding: 6px 10px !important;
    background: #16a34a !important;
    color: #fff !important;
    border-color: #16a34a !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: background .15s;
}

.psp-select-reward-btn:hover:not(:disabled) {
    background: #15803d !important;
    border-color: #15803d !important;
}

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

/* Feedback */
.psp-reward-selection-feedback {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.psp-feedback-success {
    background: #dcfce7;
    color: #14532d;
    border: 1px solid #86efac;
}

.psp-feedback-error {
    background: #fef2f2;
    color: #7f1d1d;
    border: 1px solid #fca5a5;
}

/* Footer note */
.psp-reward-selection-note {
    margin: 10px 0 0;
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

/* Responsive */
@media (max-width: 480px) {
    .psp-reward-products {
        grid-template-columns: repeat(2, 1fr);
    }
    .psp-reward-selection-header {
        flex-direction: column;
        gap: 8px;
    }
}
