/* BIMS homepage announcement popup */
.bims-popup {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.bims-popup.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.bims-popup.is-closing {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.bims-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 20, 14, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.bims-popup.is-open .bims-popup__backdrop {
    opacity: 1;
}

.bims-popup__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    max-height: min(90vh, 720px);
    max-height: min(90dvh, 720px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 20px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    transform: translateY(24px) scale(0.96);
    opacity: 0;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.bims-popup.is-open .bims-popup__dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.bims-popup.is-closing .bims-popup__dialog {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
}

.bims-popup__accent {
    height: 5px;
    background: linear-gradient(90deg, #007a46 0%, #009355 50%, #00b368 100%);
    flex-shrink: 0;
}

.bims-popup__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 0;
    flex-shrink: 0;
}

.bims-popup__header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.bims-popup__title {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 4px;
    font-size: clamp(1.15rem, 4vw, 1.45rem);
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.bims-popup__timer {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
}

.bims-popup__timer svg {
    display: block;
    width: 44px;
    height: 44px;
    transform: rotate(-90deg);
}

.bims-popup__timer-track {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 3;
}

.bims-popup__timer-progress {
    fill: none;
    stroke: #009355;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 113;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.bims-popup__timer-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #009355;
}

.bims-popup__body {
    padding: 16px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
}

.bims-popup__desc {
    margin: 0 0 16px;
    font-size: clamp(0.9rem, 3.2vw, 1rem);
    line-height: 1.6;
    color: #475569;
}

.bims-popup__desc p:last-child {
    margin-bottom: 0;
}

.bims-popup__desc a {
    color: #009355;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.bims-popup__image-wrap {
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
    line-height: 0;
}

.bims-popup__image {
    display: block;
    width: 100%;
    max-height: 42vh;
    max-height: 42dvh;
    object-fit: contain;
    margin: 0 auto;
}

.bims-popup__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 20px 20px;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.bims-popup__btn {
    flex: 1 1 auto;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.bims-popup__btn:active {
    transform: scale(0.98);
}

.bims-popup__btn--primary {
    background: linear-gradient(135deg, #009355 0%, #007a46 100%);
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(0, 147, 85, 0.35);
}

.bims-popup__btn--primary:hover {
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(0, 147, 85, 0.45);
}

.bims-popup__btn--ghost {
    background: #f8fafc;
    color: #475569 !important;
    border: 1px solid #e2e8f0;
}

.bims-popup__btn--ghost:hover {
    background: #f1f5f9;
    color: #334155 !important;
}

.bims-popup__close-icon {
    position: relative;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.bims-popup__close-icon:hover {
    background: #fff;
    color: #0f172a;
    transform: scale(1.05);
}

body.bims-popup-open {
    overflow: hidden;
}

@media (max-width: 480px) {
    .bims-popup {
        padding: 10px;
        align-items: flex-end;
    }

    .bims-popup__dialog {
        max-width: 100%;
        border-radius: 20px 20px 16px 16px;
        max-height: 88dvh;
    }

    .bims-popup__header {
        padding: 18px 16px 0;
    }

    .bims-popup__header-actions {
        gap: 8px;
    }

    .bims-popup__timer {
        width: 40px;
        height: 40px;
    }

    .bims-popup__timer svg {
        width: 40px;
        height: 40px;
    }

    .bims-popup__close-icon {
        width: 34px;
        height: 34px;
        font-size: 20px;
    }

    .bims-popup__body {
        padding: 14px 16px;
    }

    .bims-popup__footer {
        padding: 14px 16px 16px;
        flex-direction: column;
    }

    .bims-popup__btn {
        width: 100%;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bims-popup,
    .bims-popup__backdrop,
    .bims-popup__dialog,
    .bims-popup__timer-progress {
        transition: none !important;
    }
}
