/* ===== Below Menu Banner ===== */
.bm-below-menu {
    width: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    gap: 0;
    overflow: hidden;
}
.bm-below-menu a,
.bm-below-menu span {
    display: block;
    flex-shrink: 0;
    width: 728px;
    height: 90px;
    overflow: hidden;
}
.bm-below-menu img {
    width: 728px;
    height: 90px;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}
.bm-below-menu a:hover img { opacity: 0.85; }

/* มือถือ: scale ให้พอดีจอโดยไม่แตก layout */
@media (max-width: 728px) {
    .bm-below-menu a,
    .bm-below-menu span {
        width: 100vw;
        height: calc(100vw * 90 / 728);
    }
    .bm-below-menu img {
        width: 100vw;
        height: calc(100vw * 90 / 728);
    }
}

/* ===== Popup Base ===== */
.bm-popup {
    position: fixed;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.bm-popup.bm-hidden {
    opacity: 0;
    pointer-events: none;
}
.bm-popup img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}
.bm-popup a, .bm-popup span { display: block; }

/* Close button */
.bm-close {
    align-self: flex-end;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px; height: 22px;
    font-size: 12px;
    cursor: pointer;
    line-height: 22px;
    text-align: center;
    padding: 0;
    margin-bottom: 2px;
}

/* ===== Left Popup ===== */
.bm-popup-left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
}
.bm-popup-left.bm-hidden { transform: translateX(-130px) translateY(-50%); }

/* ===== Right Popup ===== */
.bm-popup-right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    align-items: flex-end;
}
.bm-popup-right .bm-close { align-self: flex-start; }
.bm-popup-right.bm-hidden { transform: translateX(130px) translateY(-50%); }

/* ===== Bottom Popup ===== */
.bm-popup-bottom {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(760px, 100vw);
    flex-direction: row;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.85);
    padding: 6px;
    border-radius: 8px 8px 0 0;
}
.bm-popup-bottom .bm-close {
    position: absolute;
    top: -28px;
    right: 8px;
}
.bm-popup-bottom a,
.bm-popup-bottom span {
    flex: 1;
    min-width: 120px;
}
.bm-popup-bottom.bm-hidden { transform: translateX(-50%) translateY(100%); }

@media (max-width: 600px) {
    .bm-popup-left, .bm-popup-right { width: 80px; }
    .bm-popup-bottom { width: 100vw; }
}
