/* ===== Variáveis ===== */
:root {
    --pcd-primary: #6d28d9;
    --pcd-primary-2: #9333ea;
    --pcd-accent: #22c55e;
    --pcd-dark: #1e1b2e;
    --pcd-radius: 16px;
}

/* ===== Overlay + Modal ===== */
.pcd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 16, 40, .55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
    padding: 16px;
}
.pcd-overlay.pcd-open {
    opacity: 1;
    visibility: visible;
}

.pcd-modal {
    background: #fff;
    width: 100%;
    max-width: 440px;
    border-radius: var(--pcd-radius);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(30, 15, 60, .35);
    transform: translateY(24px) scale(.96);
    transition: transform .32s cubic-bezier(.2,.9,.3,1.2);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
}
.pcd-overlay.pcd-open .pcd-modal {
    transform: translateY(0) scale(1);
}

.pcd-close {
    position: absolute;
    top: 12px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.25);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background .2s;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}
.pcd-close:hover {
    background: rgba(255,255,255,.45);
}

/* Cabeçalho com gradiente */
.pcd-modal-head {
    background: linear-gradient(135deg, var(--pcd-primary) 0%, var(--pcd-primary-2) 100%);
    color: #fff;
    padding: 26px 24px 22px;
    text-align: center;
}
.pcd-modal-head h3 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}
.pcd-modal-head p {
    margin: 0;
    font-size: 14px;
    opacity: .92;
    line-height: 1.4;
}

.pcd-modal-body {
    padding: 18px 22px;
    overflow-y: auto;
}

/* ===== Lista de faixas ===== */
.pcd-tiers {
    list-style: none;
    margin: 0;
    padding: 0;
}
.pcd-tier {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid #ece9f5;
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all .2s ease;
    background: #faf9fe;
}
.pcd-tier:last-child { margin-bottom: 0; }

.pcd-tier.pcd-active {
    border-color: var(--pcd-accent);
    background: #f0fdf4;
    box-shadow: 0 4px 14px rgba(34, 197, 94, .18);
}
.pcd-tier.pcd-active .pcd-tier-badge {
    background: var(--pcd-accent);
}

.pcd-tier-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pcd-tier-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--pcd-primary);
    text-transform: uppercase;
    letter-spacing: .3px;
}
.pcd-tier-range {
    font-size: 14px;
    font-weight: 600;
    color: var(--pcd-dark);
}
.pcd-tier-badge {
    background: var(--pcd-primary);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== Barra de progresso (dentro do popup) ===== */
.pcd-progress-wrap {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #e2ddf0;
}
.pcd-progress-text {
    font-size: 13.5px;
    color: var(--pcd-dark);
    margin-bottom: 8px;
    text-align: center;
    font-weight: 600;
}
.pcd-progress-text b { color: var(--pcd-primary); }
.pcd-progress-bar {
    height: 10px;
    background: #ede9f7;
    border-radius: 999px;
    overflow: hidden;
}
.pcd-progress-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--pcd-primary), var(--pcd-accent));
    border-radius: 999px;
    transition: width .6s ease;
}

.pcd-modal-foot {
    padding: 0 22px 22px;
}
.pcd-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--pcd-primary), var(--pcd-primary-2));
    color: #fff;
    border: none;
    padding: 13px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease;
}
.pcd-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(109, 40, 217, .35);
}

/* ===== Botão flutuante ===== */
.pcd-badge {
    position: fixed;
    bottom: 22px;
    right: 22px;
    background: linear-gradient(135deg, var(--pcd-primary), var(--pcd-primary-2));
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(109, 40, 217, .4);
    z-index: 999998;
    transition: transform .2s ease, box-shadow .2s ease;
    animation: pcd-pulse 2.4s infinite;
}
.pcd-badge:hover {
    transform: translateY(-2px) scale(1.03);
}
@keyframes pcd-pulse {
    0%   { box-shadow: 0 8px 22px rgba(109,40,217,.4), 0 0 0 0 rgba(147,51,234,.45); }
    70%  { box-shadow: 0 8px 22px rgba(109,40,217,.4), 0 0 0 14px rgba(147,51,234,0); }
    100% { box-shadow: 0 8px 22px rgba(109,40,217,.4), 0 0 0 0 rgba(147,51,234,0); }
}

/* ===== Barra de progresso no carrinho ===== */
.pcd-cart-progress {
    background: #faf9fe;
    border: 1.5px solid #ece9f5;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 20px;
}
.pcd-cart-progress .pcd-cp-text {
    font-size: 14.5px;
    color: var(--pcd-dark);
    margin-bottom: 10px;
    font-weight: 600;
}
.pcd-cart-progress .pcd-cp-text b { color: var(--pcd-primary); }
.pcd-cart-progress .pcd-cp-text .pcd-cp-win { color: var(--pcd-accent); }
.pcd-cart-progress .pcd-progress-bar {
    height: 12px;
    background: #ede9f7;
}

/* Responsivo */
@media (max-width: 480px) {
    .pcd-modal-head h3 { font-size: 19px; }
    .pcd-badge { bottom: 14px; right: 14px; padding: 10px 15px; font-size: 13px; }
}
