/* ============================================================
   Loyalty Points for WooCommerce – Public Styles
   ============================================================ */

:root {
    --lpw-gold:        #e8a020;
    --lpw-gold-light:  #fdf3e0;
    --lpw-gold-dark:   #b07318;
    --lpw-dark:        #1a1a2e;
    --lpw-text:        #2d2d2d;
    --lpw-muted:       #6b7280;
    --lpw-radius:      14px;
    --lpw-shadow:      0 4px 24px rgba(0,0,0,.10);
    --lpw-shadow-hover:0 8px 36px rgba(0,0,0,.16);
    --lpw-green:       #16a34a;
    --lpw-red:         #dc2626;
}

/* ── Wrapper ──────────────────────────────────────────────── */
.lpw-catalog-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 60px;
    font-family: inherit;
}

/* ── Nagłówek (tekst z panelu admina) ─────────────────────── */
.lpw-catalog-header-text {
    background: linear-gradient(135deg, var(--lpw-dark) 0%, #2d1b69 100%);
    color: #fff;
    border-radius: var(--lpw-radius);
    padding: 32px 40px;
    margin-bottom: 32px;
    line-height: 1.7;
    font-size: 1.05rem;
    box-shadow: var(--lpw-shadow);
}

.lpw-catalog-header-text h1,
.lpw-catalog-header-text h2,
.lpw-catalog-header-text h3 {
    color: var(--lpw-gold);
    margin-top: 0;
}

.lpw-catalog-header-text a {
    color: var(--lpw-gold-light);
}

/* ── Baner salda ──────────────────────────────────────────── */
.lpw-balance-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(120deg, var(--lpw-gold) 0%, #f0c040 100%);
    color: #fff;
    border-radius: var(--lpw-radius);
    padding: 24px 32px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(232,160,32,.35);
}

.lpw-balance-icon {
    font-size: 2.8rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.25));
}

.lpw-balance-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lpw-balance-label {
    font-size: .85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .85;
}

.lpw-balance-value {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1;
    color: var(--lpw-dark);
}

.lpw-balance-value small {
    font-size: 1rem;
    font-weight: 500;
    opacity: .75;
}

/* ── Login notice ─────────────────────────────────────────── */
.lpw-login-notice {
    background: var(--lpw-gold-light);
    border-left: 4px solid var(--lpw-gold);
    border-radius: 0 var(--lpw-radius) var(--lpw-radius) 0;
    padding: 16px 24px;
    margin-bottom: 32px;
    color: var(--lpw-text);
    font-size: .95rem;
}

/* ── Grid kafelków ────────────────────────────────────────── */
.lpw-rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
}

/* ── Kafelek nagrody ──────────────────────────────────────── */
.lpw-reward-card {
    background: #fff;
    border-radius: var(--lpw-radius);
    box-shadow: var(--lpw-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .22s ease, box-shadow .22s ease;
    position: relative;
}

.lpw-reward-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--lpw-shadow-hover);
}

.lpw-reward-card.lpw-locked {
    opacity: .85;
}

/* Miniatura */
.lpw-reward-thumb {
    position: relative;
    background: #f5f5f5;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.lpw-reward-thumb img.lpw-reward-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.lpw-reward-card:hover .lpw-reward-img {
    transform: scale(1.05);
}

.lpw-reward-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, #fdf3e0, #fce8b2);
}

/* Badge z kosztem punktów */
.lpw-reward-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--lpw-dark);
    color: var(--lpw-gold);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 5px 12px;
    border-radius: 100px;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    white-space: nowrap;
}

/* Treść karty */
.lpw-reward-body {
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.lpw-reward-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--lpw-text);
    margin: 0 0 8px;
    line-height: 1.3;
}

.lpw-reward-desc {
    font-size: .88rem;
    color: var(--lpw-muted);
    line-height: 1.55;
    margin: 0 0 16px;
    flex: 1;
}

/* Footer karty */
.lpw-reward-footer {
    margin-top: auto;
}

/* Przycisk odbioru */
.lpw-redeem-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--lpw-gold) 0%, #f0c040 100%);
    color: var(--lpw-dark);
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .02em;
    transition: opacity .18s ease, transform .18s ease;
    text-align: center;
}

.lpw-redeem-btn:hover {
    opacity: .9;
    transform: translateY(-1px);
}

.lpw-redeem-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* Niewystarczające punkty */
.lpw-not-enough {
    display: block;
    text-align: center;
    font-size: .85rem;
    color: var(--lpw-red);
    font-weight: 600;
    padding: 10px 0 4px;
    opacity: .8;
}

.lpw-login-to-redeem {
    display: block;
    text-align: center;
    font-size: .85rem;
    color: var(--lpw-muted);
    padding: 10px 0 4px;
}

/* Brak nagród */
.lpw-no-rewards {
    text-align: center;
    padding: 60px 20px;
    color: var(--lpw-muted);
    font-size: 1.1rem;
}

/* ── Modal ────────────────────────────────────────────────── */
.lpw-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(3px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: lpwFadeIn .2s ease;
}

@keyframes lpwFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lpw-modal {
    background: #fff;
    border-radius: var(--lpw-radius);
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    max-width: 440px;
    width: 100%;
    padding: 36px 32px 28px;
    position: relative;
    animation: lpwSlideUp .25s ease;
}

@keyframes lpwSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.lpw-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--lpw-muted);
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: color .15s;
}

.lpw-modal-close:hover {
    color: var(--lpw-text);
}

#lpw-modal-body {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--lpw-text);
    margin-bottom: 20px;
}

#lpw-modal-body .lpw-modal-icon {
    font-size: 3rem;
    display: block;
    text-align: center;
    margin-bottom: 12px;
}

#lpw-modal-body p {
    margin: 0;
    text-align: center;
}

#lpw-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

#lpw-modal-actions .lpw-btn {
    padding: 11px 28px;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity .15s;
}

#lpw-modal-actions .lpw-btn:hover { opacity: .88; }

.lpw-btn-primary {
    background: var(--lpw-gold);
    color: var(--lpw-dark);
}

.lpw-btn-secondary {
    background: #f3f4f6;
    color: var(--lpw-text);
}

.lpw-btn-success {
    background: var(--lpw-green);
    color: #fff;
}

/* ── "Moje konto" widget ──────────────────────────────────── */
.lpw-myaccount-widget {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(120deg, var(--lpw-dark) 0%, #2d1b69 100%);
    color: #fff;
    border-radius: var(--lpw-radius);
    padding: 20px 28px;
    margin-bottom: 28px;
}

.lpw-myaccount-icon {
    font-size: 2rem;
}

.lpw-myaccount-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lpw-myaccount-balance {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--lpw-gold);
    line-height: 1;
}

.lpw-myaccount-balance span {
    font-size: .9rem;
    opacity: .8;
    font-weight: 500;
}

.lpw-myaccount-link {
    font-size: .85rem;
    color: var(--lpw-gold-light);
    text-decoration: none;
    margin-top: 4px;
}

.lpw-myaccount-link:hover {
    text-decoration: underline;
}

/* ── Inline saldo (shortcode [lpw_balance]) ───────────────── */
.lpw-inline-balance {
    display: inline-block;
    background: var(--lpw-gold-light);
    border: 1px solid var(--lpw-gold);
    border-radius: 6px;
    padding: 2px 10px;
    font-size: .9em;
    color: var(--lpw-gold-dark);
}

/* ── Responsywność ────────────────────────────────────────── */
@media (max-width: 600px) {
    .lpw-rewards-grid {
        grid-template-columns: 1fr;
    }

    .lpw-balance-banner {
        padding: 18px 20px;
    }

    .lpw-balance-value {
        font-size: 1.7rem;
    }

    .lpw-catalog-header-text {
        padding: 22px 20px;
    }

    .lpw-modal {
        padding: 28px 20px 22px;
    }
}

/* Modal domyślnie ukryty – JS steruje klasą lpw-modal-hidden */
.lpw-modal-overlay.lpw-modal-hidden {
    display: none !important;
}

/* ── Odznaki typu produktu ────────────────────────────────── */
.lpw-reward-type-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(26,26,46,.82);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    letter-spacing: .03em;
    backdrop-filter: blur(4px);
}

.lpw-badge-outofstock {
    background: rgba(220,38,38,.82);
}
