/* ── Image Popup with Offer Timer — Frontend Styles ─────────────────────── */

#ipt-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
#ipt-overlay.ipt-visible {
    display: flex;
}

/* Popup */
#ipt-popup {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,.5);
    animation: iptPop .4s cubic-bezier(.34,1.56,.64,1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@keyframes iptPop {
    from { opacity: 0; transform: scale(.85) translateY(30px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* Image */
.ipt-image-wrap { line-height: 0; }
.ipt-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
}

/* Close */
#ipt-close {
    position: absolute;
    top: 10px; right: 12px;
    z-index: 10;
    width: 32px; height: 32px;
    background: rgba(0,0,0,.45);
    color: #fff;
    border: none; border-radius: 50%;
    font-size: 20px; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
#ipt-close:hover { background: rgba(0,0,0,.75); }

/* Body */
.ipt-body {
    padding: 22px 26px 26px;
    text-align: center;
}

/* Badge */
.ipt-badge {
    display: inline-block;
    background: var(--ipt-theme, #e74c3c);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
}

/* Headline */
.ipt-headline {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.3;
}

/* Subtext */
.ipt-subtext {
    margin: 0 0 20px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* ── Timer Block ───────────────────────────────────────────────────────────── */
.ipt-timer-block {
    background: var(--ipt-theme, #e74c3c);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.ipt-timer-label {
    color: rgba(255,255,255,.85);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.ipt-timer-digits {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
}

.ipt-digit-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 54px;
}

.ipt-digit {
    display: block;
    background: rgba(0,0,0,.25);
    color: #fff;
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
    padding: 8px 6px;
    border-radius: 6px;
    width: 100%;
    text-align: center;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
    transition: transform .15s ease;
}
.ipt-digit.ipt-tick {
    transform: scale(1.12);
}

.ipt-digit-label {
    color: rgba(255,255,255,.7);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-top: 5px;
}

.ipt-colon {
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    padding-top: 6px;
    line-height: 1;
    opacity: .7;
    animation: iptBlink 1s infinite;
}
@keyframes iptBlink {
    0%, 100% { opacity: .7; }
    50%       { opacity: .2; }
}

/* Expired message */
.ipt-expired-msg {
    background: #f8f9fa;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    border-radius: 8px;
    padding: 14px;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 16px;
}

/* CTA Button */
.ipt-cta {
    display: block;
    background: var(--ipt-cta, #e74c3c);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 16px;
    font-weight: 700;
    padding: 14px 24px;
    border-radius: 8px;
    letter-spacing: .3px;
    transition: filter .2s, transform .15s;
    cursor: pointer;
}
.ipt-cta:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}
.ipt-cta:active {
    transform: translateY(0);
}

/* Hide days block if 0 days remain */
.ipt-timer-digits.no-days .ipt-colon:first-child,
.ipt-timer-digits.no-days .ipt-digit-wrap:first-child { display: none; }

/* Responsive */
@media (max-width: 480px) {
    .ipt-body { padding: 18px 16px 20px; }
    .ipt-headline { font-size: 18px; }
    .ipt-digit { font-size: 24px; padding: 6px 4px; }
    .ipt-digit-wrap { min-width: 44px; }
}
