/*!
 * Offer popup.
 *
 * A separate stylesheet rather than an addition to style.css, so nothing existing is touched
 * and this can be removed by deleting one file. Everything is namespaced under .offerpop; no
 * selector here can reach the booking popup (.popwrap .bookcarpop) or anything else.
 *
 * Loaded only on pages that actually have a popup, so it costs nothing elsewhere.
 */

.offerpop {
    position: fixed;
    inset: 0;
    z-index: 99999;              /* above the sticky header and the social rail */
    display: none;               /* the script switches this on */
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, .72);
    opacity: 0;
    transition: opacity .25s ease;
}

.offerpop.is-open {
    display: flex;
    opacity: 1;
}

.offerpop-inner {
    position: relative;
    max-width: 420px;
    width: 100%;
    max-height: 92vh;
    transform: translateY(12px);
    transition: transform .25s ease;
}

.offerpop.is-open .offerpop-inner {
    transform: translateY(0);
}

/* The creative is one image with the CTA drawn into it, so the image is the link. */
.offerpop-cta {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.offerpop-cta img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 14px;
}

.offerpop-close {
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 2;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #111;
    font-size: 22px;
    line-height: 34px;
    text-align: center;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

.offerpop-close:hover {
    background: #f2f2f2;
}

/* Mobile: keep the close button inside the viewport - at -14px it would sit off-screen
   once the image fills the width. */
@media only screen and (max-width: 767px) {
    .offerpop {
        padding: 12px;
    }

    .offerpop-inner {
        max-width: 100%;
    }

    .offerpop-close {
        top: 6px;
        right: 6px;
    }
}

/* Respect a visitor who has asked for reduced motion. */
@media (prefers-reduced-motion: reduce) {
    .offerpop,
    .offerpop-inner {
        transition: none;
    }
}
