/**
 * Discount Popup Widget styles for hahamoving.co.il
 * Loaded deferred — no impact on first paint.
 */

.discount-widget {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    pointer-events: none;
    font-family: 'Heebo', 'Arial Hebrew', system-ui, sans-serif;
}

.discount-widget[data-state="visible"] {
    display: flex;
    pointer-events: auto;
    animation: dw-fade-in 0.35s ease-out;
}

.discount-widget__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.discount-widget__panel {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: linear-gradient(135deg, #1565C0 0%, #0d47a1 100%);
    color: #fff;
    border-radius: 20px;
    padding: 28px 24px 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    overflow: hidden;
    animation: dw-pop-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Decorative shine */
.discount-widget__panel::before {
    content: '';
    position: absolute;
    top: -50%;
    inset-inline-start: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.discount-widget__close {
    position: absolute;
    top: 8px;
    inset-inline-end: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.discount-widget__close:hover,
.discount-widget__close:focus-visible {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    outline: none;
}

.discount-widget__badge {
    display: inline-block;
    background: #FFD600;
    color: #0d47a1;
    font-weight: 800;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: 14px;
    box-shadow: 0 4px 14px rgba(255, 214, 0, 0.4);
    position: relative;
    z-index: 1;
}

.discount-widget__title {
    font-size: clamp(20px, 5vw, 26px);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 18px;
    color: #fff;
    position: relative;
    z-index: 1;
}

.discount-widget__offers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.discount-widget__offer {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 12px 10px;
    text-align: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.discount-widget__offer--big {
    background: rgba(255, 214, 0, 0.18);
    border-color: rgba(255, 214, 0, 0.45);
}

.discount-widget__offer-amount {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.3;
    margin-bottom: 4px;
}
.discount-widget__offer-amount strong {
    display: block;
    font-size: clamp(24px, 6vw, 32px);
    font-weight: 900;
    color: #FFD600;
    margin-bottom: 2px;
    line-height: 1;
}
.discount-widget__offer--small .discount-widget__offer-amount strong {
    color: #fff;
}

.discount-widget__offer-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.3;
}

.discount-widget__countdown {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.discount-widget__countdown-label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 6px;
    font-weight: 600;
}

.discount-widget__countdown-clock {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}

.discount-widget__countdown-segment {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    color: #0d47a1;
    padding: 6px 10px;
    border-radius: 8px;
    min-width: 52px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.discount-widget__countdown-value {
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
}

.discount-widget__countdown-unit {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1565C0;
    margin-top: 2px;
}

.discount-widget__countdown-sep {
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    align-self: center;
    transform: translateY(-6px);
}

.discount-widget__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: #25D366;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
    border-radius: 100px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
    position: relative;
    z-index: 1;
}

.discount-widget__cta:hover,
.discount-widget__cta:focus-visible {
    background: #1FB855;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.55);
    color: #fff;
    outline: none;
}

.discount-widget__cta-icon {
    flex-shrink: 0;
}

.discount-widget__note {
    margin-top: 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

/* Animations */
@keyframes dw-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes dw-pop-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Expired state — countdown shows 00:00, CTA still works */
.discount-widget[data-expired] .discount-widget__countdown-value { color: #F87171; }
.discount-widget[data-expired] .discount-widget__countdown-segment { background: #fff3cd; }

/* Mobile */
@media (max-width: 480px) {
    .discount-widget {
        padding: 8px;
        align-items: flex-end;
    }
    .discount-widget__panel {
        padding: 22px 18px 18px;
        border-radius: 18px 18px 12px 12px;
    }
    .discount-widget__title {
        font-size: 19px;
        margin-bottom: 14px;
    }
    .discount-widget__offers { gap: 6px; margin-bottom: 14px; }
    .discount-widget__offer { padding: 10px 6px; }
    .discount-widget__offer-amount strong { font-size: 22px; }
    .discount-widget__cta { font-size: 14px; padding: 12px 16px; }
    .discount-widget__countdown-segment { min-width: 46px; padding: 5px 8px; }
    .discount-widget__countdown-value { font-size: 19px; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .discount-widget[data-state="visible"],
    .discount-widget__panel {
        animation: none;
    }
}
