/**
 * Community Pricing PRO - Frontend CSS
 */

/* Catalog Product Badge */
.product-flag.community-pricing-badge {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%) !important;
    color: #fbbf24 !important;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #1e3a8a;
    border-radius: 4px;
    padding: 5px 10px;
    margin-bottom: 5px;
    display: inline-block;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* ==========================================================================
   Community Pricing PRO - Product page progress widget (WCCP PRO style)
   ========================================================================== */

.cp-promo-widget {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.cp-card {
    background: #fffbf9;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 1.25rem;
}

/* Header alert */
.cp-header {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: #fff4f2;
    border-left: 4px solid #ff7a59;
    border-radius: 4px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
}

.cp-header-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.cp-header-title {
    font-weight: 700;
    font-size: 1rem;
    color: #2b2b2b;
}

.cp-header-dates {
    font-size: 0.8rem;
    color: #7a7a7a;
    margin-top: 2px;
}

/* Countdown to campaign end */
.cp-countdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    margin-top: 0.55rem;
    font-size: 0.85rem;
    color: #2b2b2b;
}

.cp-countdown-label {
    font-weight: 600;
    color: #5a5a5a;
}

.cp-countdown-units {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-variant-numeric: tabular-nums;
}

.cp-countdown-block {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 1.85rem;
    line-height: 1.1;
}

.cp-countdown-block strong {
    font-size: 1rem;
    font-weight: 700;
    color: #1e3a8a;
}

.cp-countdown-block small {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #8a8a8a;
    margin-top: 1px;
}

.cp-countdown-sep {
    font-weight: 700;
    color: #c0c0c0;
    padding-bottom: 0.7rem;
}

.cp-countdown-urgent .cp-countdown-block strong {
    color: #c2410c;
}

.cp-countdown-ended .cp-countdown-ended-msg {
    font-weight: 600;
    color: #9a3412;
}

.cp-countdown-ended-msg {
    font-size: 0.85rem;
}

/* Consumer trust — cart / checkout */
.cp-trust {
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
    background: #f0faf4;
    border: 1px solid #c8e6c9;
    border-left: 4px solid #2e7d32;
}

.cp-trust-title {
    display: block;
    color: #1b5e20;
    font-weight: 700;
    margin: 0;
}

.cp-trust-text {
    margin: 0.35rem 0 0;
    color: #444;
}

.cp-trust-checkout {
    border-style: dashed;
}

.cp-trust-bullets {
    margin: 0.55rem 0 0;
    padding-left: 1.15rem;
    color: #444;
}

.cp-trust-bullets li {
    margin-bottom: 0.35rem;
}

.cp-trust-bullets li:last-child {
    margin-bottom: 0;
}

/* My Rewards (customer account) */
.cp-my-rewards-intro {
    margin-bottom: 1rem;
    color: #555;
}

.cp-my-rewards-table code.cp-voucher-code {
    font-weight: 700;
    color: #1e3a8a;
    background: #eef2ff;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.cp-reward-status {
    display: inline-block;
    font-size: 0.85em;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
}

.cp-reward-status--voucher {
    background: #e8f5e9;
    color: #2e7d32;
}

.cp-reward-status--manual_done {
    background: #e3f2fd;
    color: #1565c0;
}

.cp-reward-status--manual_pending,
.cp-reward-status--failed {
    background: #fff3e0;
    color: #e65100;
}

.cp-reward-status--no_reward {
    background: #f5f5f5;
    color: #616161;
}

.cp-reward-status--pending {
    background: #fff8e1;
    color: #f57f17;
}

.cp-reward-status--confirmed {
    background: #e8f5e9;
    color: #2e7d32;
}

.cp-reward-status--redeemed {
    background: #e3f2fd;
    color: #1565c0;
}

.cp-reward-status--reversed {
    background: #fce4ec;
    color: #c62828;
}

/* Partner Area */
.cp-partner-intro {
    margin-bottom: 1rem;
    color: #555;
}

.cp-partner-stats {
    margin: 1.25rem 0;
}

.cp-partner-stat {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.cp-partner-stat-label {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.cp-partner-stat-value {
    font-size: 1.35rem;
    color: #0f172a;
}

.cp-partner-share,
.cp-partner-redeem,
.cp-partner-history {
    margin: 1.75rem 0;
}

.cp-partner-redeem button[disabled],
.cp-partner-redeem button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.cp-partner-code code {
    font-weight: 700;
    background: #eef2ff;
    color: #1e3a8a;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

/* Status callout */
.cp-callout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 4px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1.1rem;
    font-size: 0.9rem;
}

.cp-callout-unlocked {
    background: #e8f5e9;
    color: #2e7d32;
}

.cp-callout-fomo {
    background: #fff8e1;
    color: #b8860b;
}

.cp-callout-cart {
    background: #fff8f0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.cp-callout-max {
    background: #e3f2fd;
    color: #1565c0;
}

/* Timeline */
.cp-timeline-wrap {
    padding: 2.2rem 0.6rem 2.6rem;
    margin-bottom: 0.5rem;
}

.cp-timeline-track {
    position: relative;
    height: 14px;
    background: #d8d8d8;
    border-radius: 10px;
}

.cp-timeline-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #43a047, #2e7d32);
    transition: width 0.8s ease-in-out;
    position: relative;
    z-index: 1;
}

.cp-timeline-cart {
    position: absolute;
    top: 0;
    height: 100%;
    z-index: 1;
    background: repeating-linear-gradient(
        45deg,
        #ef6c00,
        #ef6c00 8px,
        #ffa726 8px,
        #ffa726 16px
    );
    box-shadow: 0 0 5px rgba(239, 108, 0, 0.4);
    opacity: 0.95;
    border-radius: 0 10px 10px 0;
}

.cp-timeline-cart-pointer {
    position: absolute;
    top: -15px;
    height: 42px;
    width: 3px;
    background: #ef6c00;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
}

.cp-cart-pointer-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-block;
    background: #ef6c00;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    pointer-events: auto;
}

.cp-timeline-pointer {
    position: absolute;
    top: -15px;
    height: 42px;
    width: 3px;
    background: rgba(0, 0, 0, 0.75);
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: none;
}

.cp-pointer-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-block;
    background: #333;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: auto;
}

/* Keep label readable when the stem sits on the left edge */
.cp-timeline-pointer.cp-pointer-at-start {
    transform: none;
}

.cp-timeline-pointer.cp-pointer-at-start .cp-pointer-label {
    left: 0;
    transform: translateX(0);
}

.cp-milestone {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.cp-milestone-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.cp-milestone-reached .cp-milestone-dot {
    background: #2e7d32;
}

.cp-milestone-locked .cp-milestone-dot {
    background: #9e9e9e;
}

.cp-milestone-cart-projected .cp-milestone-dot {
    background: #fff;
    border: 3px solid #ef6c00;
}

.cp-milestone-reached .cp-milestone-dot {
    animation: cp-milestone-pulse 2s infinite;
}

@keyframes cp-milestone-pulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(46, 125, 50, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

.cp-milestone-label {
    position: absolute;
    top: 34px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.2;
    white-space: nowrap;
}

.cp-milestone-label strong {
    display: block;
    color: #333;
}

.cp-milestone-label span {
    color: #2e7d32;
    font-weight: 600;
}

.cp-milestone-locked .cp-milestone-label span {
    color: #9e9e9e;
}

.cp-milestone-cart-projected .cp-milestone-label span {
    color: #ef6c00;
}

/* Social share row */
.cp-share-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 0.5rem;
    flex-wrap: wrap;
}

.cp-share-label {
    font-size: 0.8rem;
    color: #7a7a7a;
}

.cp-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    transition: transform 0.15s ease-in-out;
}

.cp-share-btn:hover {
    transform: scale(1.1);
}

.cp-share-whatsapp { background: #25d366; }
.cp-share-telegram { background: #229ed9; }
.cp-share-facebook { background: #1877f2; }

/* Terms note */
.cp-terms-note {
    margin-top: 1rem;
    font-size: 0.78rem;
    text-align: center;
    color: #8a8a8a;
    border-top: 1px solid #eee;
    padding-top: 0.6rem;
}

.cp-terms-link {
    display: inline-block;
    margin-top: 4px;
    color: #ff7a59;
    font-weight: 600;
    text-decoration: underline;
}

/* Info popup dialog */
.cp-info-dialog {
    border: none;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.cp-info-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.cp-info-dialog-inner {
    padding: 1.5rem;
    background: #fff;
    color: #333;
}

.cp-info-dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.cp-info-dialog-head h4 {
    margin: 0;
    font-weight: bold;
    font-size: 1.2rem;
}

.cp-info-dialog-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.cp-info-dialog-body {
    font-size: 0.95rem;
    line-height: 1.5;
}

.cp-info-dialog-foot {
    text-align: right;
    margin-top: 1.5rem;
}

.cp-info-dialog-btn {
    background: #ff7a59;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/* Price block teaser (near price, links down to the widget above) */
.cp-price-teaser a {
    color: #1e3a8a;
}

/* Responsive: stack milestone labels tighter on small screens */
@media (max-width: 480px) {
    .cp-milestone-label {
        font-size: 0.65rem;
    }
    .cp-timeline-wrap {
        padding: 2rem 0.4rem 2.4rem;
    }
}
