/* Make the main wrapper the stable positioning parent */
.pawnshop-listings-container {
    position: relative;           /* ← Add this if not already present */
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 10px;
    box-sizing: border-box;
    z-index: 1;                   /* helps with stacking */
}

/* Guide Button - Top Right */
.guide-button-container {
    position: absolute;
    top: -19px;                    /* stable pixel value */
    right: max(16px, calc( (100% - 1440px) / 2 + 16px ));
    z-index: 50;
    pointer-events: auto;
}

/* Fallback for screens narrower than 1440px */
@media (min-width: 769px) and (max-width: 1400px) {
    .guide-button-container {
        right: 16px;
        top: -21px;
    }
}

@media (max-width: 450px) {
    .guide-button-container {
        right: 10px;
        top: -13px;
    }
}

.guide-btn {
    background: linear-gradient(135deg, #00ff9d, #00cc7a);
    color: #000;
    font-family: 'Encode Sans SC', sans-serif;
    font-weight: 600;
    font-size: 15px;
    padding: 8px 18px;
    border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 255, 157, 0.3);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 2px solid #000;
}

.guide-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 255, 157, 0.4);
    background: white;
}

.guide-btn:active {
    transform: scale(0.96);
}

body:has(.wp-block-navigation__responsive-container.has-modal-open) .guide-button-container,
body:has(.wp-block-navigation__responsive-container.is-menu-open) .guide-button-container,
body.has-modal-open .guide-button-container {
    display: none !important;
}

body.modal-open .guide-button-container,
#txModalOverlay ~ .guide-button-container,
#pawnshop-nftModalOverlay ~ .guide-button-container,
.nft-modal-overlay ~ .huide-button-container {
    display: none !important;
}
body.toast-visible .guide-button-container {
    z-index: 1 !important;  
}