.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
    z-index: 9999;
}
.popup-content {
    background: transparent;
    padding: 0;
    position: relative;
    max-width: 67.5%; /* ลดลง 25% จาก 90% */
    text-align: center;
    z-index: 10000;
}
.popup-content img {
    max-width: 100%;
    height: auto;
}
.popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 20px;
    cursor: pointer;
    background: #0E9B79;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.3);
    line-height: 0;
}
/* popup carousel (หลายรูป) */
.popup-content:has(#popupCarousel) {
    width: 67.5%;
}
#popupCarousel {
    width: 100%;
}
#popupCarousel .carousel-item img {
    width: 100%;
    max-height: 85vh;
    object-fit: contain;
}
#popupCarousel .carousel-control-prev,
#popupCarousel .carousel-control-next {
    width: 10%;
    opacity: 1;
}
#popupCarousel .carousel-control-prev-icon,
#popupCarousel .carousel-control-next-icon {
    width: 44px;
    height: 44px;
    background-color: rgba(0, 0, 0, 0.55);
    background-size: 50% 50%;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s;
}
#popupCarousel .carousel-control-prev:hover .carousel-control-prev-icon,
#popupCarousel .carousel-control-next:hover .carousel-control-next-icon {
    background-color: #0E9B79;
}
#popupCarousel .carousel-indicators {
    margin-bottom: 0.5rem;
}
@media (max-width: 768px) {
    .popup-content:has(#popupCarousel) {
        width: 92%;
        max-width: 92%;
    }
}
