/* =============================================================
   Vertex Bazaar — Popup Styles
   Uses --primary-color & --secondary-color from the theme.
   ============================================================= */

/* Overlay */
.vb-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.65);
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.vb-popup-overlay.vb-popup-visible {
    opacity: 1;
    pointer-events: all;
}

/* Box */
.vb-popup-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    transform: translateY(24px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    scrollbar-width: thin;
}

.vb-popup-overlay.vb-popup-visible .vb-popup-box {
    transform: translateY(0) scale(1);
}

/* Close button */
.vb-popup-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.vb-popup-close:hover {
    background: var(--primary-color, #e74c3c);
    color: #fff;
}

/* Image */
.vb-popup-image {
    width: 100%;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    max-height: 260px;
}

.vb-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Body */
.vb-popup-body {
    padding: 24px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Label / Badge */
.vb-popup-label {
    display: inline-block;
    background: var(--primary-color, #e74c3c);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    align-self: flex-start;
}

/* Title */
.vb-popup-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--secondary-color, #222);
    line-height: 1.3;
}

/* Description */
.vb-popup-desc {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.65;
}

/* Timer */
.vb-popup-timer {
    background: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
}

.vb-popup-timer-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.vb-timer-digits {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.vb-timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
    background: var(--primary-color, #e74c3c);
    color: #fff;
    border-radius: 6px;
    padding: 8px 6px 6px;
}

.vb-t-val {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.vb-t-lbl {
    font-size: 10px;
    font-weight: 600;
    opacity: 0.85;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.vb-timer-sep {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color, #e74c3c);
    line-height: 1;
    margin-bottom: 12px;
}

/* Coupon */
.vb-popup-coupon {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff8e1;
    border: 2px dashed var(--primary-color, #e74c3c);
    border-radius: 8px;
    padding: 10px 14px;
}

.vb-coupon-code {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--secondary-color, #222);
    font-family: monospace;
    word-break: break-all;
}

.vb-coupon-copy {
    background: var(--primary-color, #e74c3c);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.vb-coupon-copy:hover {
    opacity: 0.85;
}

.vb-coupon-copy.copied {
    background: #27ae60;
}

/* CTA Button */
.vb-popup-btn {
    display: inline-block;
    background: var(--primary-color, #e74c3c);
    color: #fff !important;
    text-decoration: none;
    padding: 13px 28px;
    border-radius: var(--button-radius, 6px);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    transition: opacity 0.2s, transform 0.15s;
    align-self: stretch;
}

.vb-popup-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* Expired timer state */
.vb-timer-expired .vb-timer-digits {
    opacity: 0.4;
}

/* Responsive */
@media ( max-width: 480px ) {
    .vb-popup-body {
        padding: 18px 18px 22px;
        gap: 12px;
    }

    .vb-popup-title {
        font-size: 18px;
    }

    .vb-timer-unit {
        min-width: 42px;
    }

    .vb-t-val {
        font-size: 20px;
    }
}
