.tm-popup-test-page {
    min-height: 70vh;
}

.tm-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.65);
}

.tm-popup.is-open {
    display: flex;
}

.tm-popup__dialog {
    position: relative;
    width: min(458px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #f3eddf;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3);
}

.tm-popup__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0 0 5px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #222;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.18);
}

.tm-popup__close:hover {
    background: #fff;
}

.tm-popup__close:focus-visible {
    outline: 3px solid #1f654c;
    outline-offset: 2px;
}

.tm-popup__header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 145px;
    padding: 12px 0 0;
}

.tm-popup__brand-line {
    flex: 1;
    height: 9px;
    background:
        linear-gradient(to bottom,
            #176a4b 0 44%,
            #f3eddf 44% 56%,
            #bb1f2d 56% 100%);
}

.tm-popup__logo {
    position: relative;
    z-index: 2;
    width: 130px;
    height: 130px;
    margin: 0 -2px;
    object-fit: contain;
}

.tm-popup__intro {
    padding: 5px 28px 18px;
    text-align: center;
}

.tm-popup__intro h2 {
    margin: 0;
    color: #a76f19;
    font-size: 38px;
    line-height: 0.98;
    font-weight: 700;
}

.tm-popup__intro h2 span {
    display: block;
}

.tm-popup__chinese {
    margin: 12px 0 0;
    color: #a76f19;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
}

.tm-popup__favorites {
    position: relative;
    padding: 14px 24px 26px;
    overflow: hidden;
    background:
        url("/wp-content/themes/twinmarquis2024/inc/img/top-red.jpg") top center / 100% auto no-repeat,
        url("/wp-content/themes/twinmarquis2024/inc/img/bottom-red.jpg") bottom center / 100% auto no-repeat,
        #c62032;
    color: #fff;
}

.tm-popup__favorites-content {
    position: relative;
    z-index: 1;
}

.tm-popup__favorites-heading {
    text-align: center;
}

.tm-popup__favorites-heading h3 {
    margin: 0;
    color: #fff;
    font-size: 22px;
    line-height: 1.05;
}

.tm-popup__favorites-heading p {
    margin: 4px 0 0;
    font-size: 17px;
}

.tm-popup__products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 16px;
}

.tm-popup__product {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tm-popup__product img {
    width: 100%;
    max-width: 120px;
    height: 115px;
    object-fit: contain;
}

.tm-popup__product p {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.15;
    font-weight: 700;
}

.tm-popup__product p span {
    display: block;
}

.tm-popup__stores {
    padding: 20px 24px 28px;
    background: #f3eddf;
    text-align: center;
}

.tm-popup__cta {
    display: block;
    max-width: 300px;
    margin: 0 auto;
    padding: 10px 15px 11px;
    border: 2px solid #c9a76f;
    background: #21654d;
    color: #fff;
    text-align: center;
    text-decoration: none;
    box-shadow:
        0 2px 0 rgba(112, 78, 32, 0.18);
}

.tm-popup__cta strong,
.tm-popup__cta span {
    display: block;
}

.tm-popup__cta strong {
    font-size: 25px;
    line-height: 1.05;
}

.tm-popup__cta span {
    margin-top: 2px;
    font-size: 17px;
    line-height: 1.15;
    font-weight: 700;
}

.tm-popup__cta:hover {
    background: #174d3a;
    color: #fff;
}

.tm-popup__local-market {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 18px auto;
    max-width: 240px;
}

.tm-popup__local-market h3 {
    text-align: left;
}

.tm-popup__market-icon {
    width: 65px;
    height: auto;
}

.tm-popup__local-market p {
    margin: 0;
    color: #111;
    font-size: 23px;
    line-height: 0.95;
    font-weight: 700;
    text-align: left;
}

.tm-popup__local-market span {
    display: block;
}

.tm-popup__store-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.tm-popup__store-logos img {
    display: block;
    width: auto;
    max-width: 30%;
    max-height: 42px;
    object-fit: contain;
}

body.tm-popup-open {
    overflow: hidden;
}

@media (max-width: 520px) {
    .tm-popup {
        padding: 12px;
    }

    .tm-popup__dialog {
        max-height: calc(100vh - 24px);
    }

    .tm-popup__header {
        min-height: 115px;
    }

    .tm-popup__logo {
        width: 105px;
        height: 105px;
    }

    .tm-popup__intro {
        padding-left: 18px;
        padding-right: 18px;
    }

    .tm-popup__intro h2 {
        font-size: 31px;
    }

    .tm-popup__chinese {
        font-size: 23px;
    }

    .tm-popup__favorites {
        padding-left: 15px;
        padding-right: 15px;
    }

    .tm-popup__favorites-heading h3 {
        font-size: 23px;
    }

    .tm-popup__favorites-heading p {
        font-size: 15px;
    }

    .tm-popup__products {
        gap: 8px;
    }

    .tm-popup__product img {
        height: 95px;
    }

    .tm-popup__product p {
        font-size: 11px;
    }

    .tm-popup__cta strong {
        font-size: 22px;
    }

    .tm-popup__cta span {
        font-size: 15px;
    }

    .tm-popup__local-market p {
        font-size: 20px;
    }

    .tm-popup__store-logos {
        gap: 12px;
    }
}