/* AJAX Dynamic Gallery Popup */
.adgp-open-button {
    display: inline-block;
    padding: 12px 24px;
    background: #b87900;
    color: #fff;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}
.adgp-open-button:hover,
.adgp-open-button:focus {
    background: #925f00;
    color: #fff;
}

#adgp-gallery-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, .72);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
#adgp-gallery-popup.is-open {
    display: flex;
}
#adgp-gallery-popup *,
#adgp-gallery-popup *::before,
#adgp-gallery-popup *::after {
    box-sizing: border-box;
}

/* Fixed-size frame; controls stay positioned inside it. */
#adgp-gallery-popup .adgp-content {
    position: relative;
    width: min(100%, 800px);
    aspect-ratio: 4 / 3;
    height: auto;
    max-height: 75vh;
    margin: auto;
    overflow: hidden;
    border-radius: 12px;
    background: #111;
    flex: none;
}
#adgp-gallery-popup .adgp-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
    margin: 0;
    /* Smooth slide animation */
    transform: translate3d(0, 0, 0);
    transition: transform .45s cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
    backface-visibility: hidden;
}
@media (prefers-reduced-motion: reduce) {
    #adgp-gallery-popup .adgp-image { transition-duration: .01ms; }
}
#adgp-gallery-popup .adgp-control {
    position: absolute;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .78);
    color: #fff;
    cursor: pointer;
    line-height: 1;
    transform: none;
}
#adgp-gallery-popup .adgp-close {
    top: 14px;
    right: 14px;
    font-size: 32px;
}
#adgp-gallery-popup .adgp-prev,
#adgp-gallery-popup .adgp-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
}
#adgp-gallery-popup .adgp-prev { left: 14px; }
#adgp-gallery-popup .adgp-next { right: 14px; }

/* Dots indicator (replaces "1 of 9" counter) */
#adgp-gallery-popup .adgp-dots {
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    max-width: calc(100% - 140px); /* close/fullscreen buttons ke liye jagah */
}
#adgp-gallery-popup .adgp-dot {
    position: relative;
    width: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
#adgp-gallery-popup .adgp-dot::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(170, 170, 170, .9);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .35);
    transform: translate(-50%, -50%);
    transition: background .3s ease, transform .3s ease;
}
#adgp-gallery-popup .adgp-dot:hover::before {
    background: rgba(220, 220, 220, .95);
}
#adgp-gallery-popup .adgp-dot.is-active::before {
    background: #000;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
    transform: translate(-50%, -50%) scale(1.15);
}
#adgp-gallery-popup .adgp-dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
    border-radius: 50%;
}

#adgp-gallery-popup .adgp-fullscreen {
    right: 14px;
    bottom: 14px;
    font-size: 24px;
}
#adgp-gallery-popup .adgp-status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    padding: 20px;
}
#adgp-gallery-popup .adgp-control:hover {
    background: #333;
}
#adgp-gallery-popup [hidden] {
    display: none !important;
}
@media (max-width: 600px) {
    #adgp-gallery-popup { padding: 12px; }
    #adgp-gallery-popup .adgp-content {
        width: 100%;
        max-height: 75vh;
    }
    #adgp-gallery-popup .adgp-control {
        width: 40px;
        height: 40px;
    }
    #adgp-gallery-popup .adgp-close {
        top: 10px;
        right: 10px;
    }
    #adgp-gallery-popup .adgp-prev { left: 10px; }
    #adgp-gallery-popup .adgp-next { right: 10px; }
    #adgp-gallery-popup .adgp-dots {
        bottom: 12px;
        max-width: calc(100% - 110px);
    }
    #adgp-gallery-popup .adgp-fullscreen {
        right: 10px;
        bottom: 10px;
    }
}