/**
 * BUFF Contact Buttons Styles
 * Desktop: QR Code box + Floating buttons on the right
 * Mobile: Fixed at footer
 */

.buff-contact-buttons-wrapper {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    gap: 24px;
}

/* QR Code Box */
.buff-qr-box {
    background-color: #ffffff;
    border: 1px solid #3079ff;
    border-radius: 16px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.06);
    pointer-events: auto;
    min-width: 140px;
}

.buff-qr-image {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.buff-qr-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.buff-qr-text {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: center;
    text-align: center;
    width: 100%;
}

.buff-qr-code-text {
    font-size: 14px;
    line-height: 20px;
    color: #34404b;
    margin: 0;
    font-weight: 400;
}

.buff-qr-amount-text {
    font-size: 14px;
    line-height: 20px;
    color: #34404b;
    margin: 0;
    font-weight: 400;
}

.buff-qr-amount-highlight {
    color: #3079ff;
    font-weight: 600;
}

.buff-contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
}

.buff-contact-button {
    width: 48px;
    height: 48px;
    background-color: #3079ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.06);
    cursor: pointer;
}

.buff-contact-button:hover {
    background-color: #2563eb;
    transform: scale(1.1);
    box-shadow: 0px 0px 16px 0px rgba(48, 121, 255, 0.3);
}

.buff-contact-button svg,
.buff-contact-button .buff-contact-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.buff-contact-button .buff-contact-icon {
    object-fit: contain;
}

/* Desktop: QR Code box + Floating buttons on the right */
@media (min-width: 769px) {
    .buff-contact-buttons-wrapper {
        right: 24px;
        left: 24px;
        bottom: 100px;
        top: auto;
        transform: none;
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }

    .buff-qr-box {
        display: flex;
        order: 0;
    }

    .buff-contact-buttons {
        order: 1;
        bottom: 150px;
    }
}

/* Mobile: Floating buttons on right, above app banner */
@media (max-width: 768px) {
    .buff-contact-buttons-wrapper {
        position: fixed;
        right: 24px;
        bottom: auto;
        top: auto;
        left: auto;
        width: auto;
        background-color: transparent;
        border: none;
        padding: 0;
        box-shadow: none;
        flex-direction: column;
        align-items: flex-end;
        z-index: 9998;
    }

    /* Calculate bottom position based on app banner height */
    /* App banner: padding 16px top + 16px bottom = 32px, content height ~48px, total ~80px */
    /* Add 10px gap between buttons and banner = 90px */
    .buff-contact-buttons-wrapper {
        bottom: 90px;
    }

    /* Adjust if app banner height changes */
    .buff-app-banner-mobile {
        min-height: 80px;
    }

    /* Hide QR box on mobile in desktop wrapper */
    .buff-contact-buttons-wrapper .buff-qr-box {
        display: none;
    }

    .buff-contact-buttons {
        flex-direction: column;
        justify-content: flex-end;
        align-items: flex-end;
        gap: 12px;
    }

    .buff-contact-button {
        flex: 0 0 auto;
        width: 48px;
        height: 48px;
    }

    /* Mobile App Download Banner - below footer */
    .buff-app-banner-mobile {
        background-color: #ffffff;
        border-top: 1px solid #e5e7eb;
        padding: 16px 24px;
        width: 100%;
        box-sizing: border-box;
        margin-top: auto;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9997;
        display: block !important;
    }

    .buff-app-banner-content {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        max-width: 100%;
        width: 100%;
    }

    .buff-app-icon {
        width: 48px;
        height: 48px;
        min-width: 48px;
        flex-shrink: 0;
        background-color: #3079ff;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .buff-app-icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .buff-app-icon-default {
        padding: 12px;
    }

    .buff-app-icon-default svg {
        width: 24px;
        height: 24px;
    }

    .buff-app-banner-text {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0;
        min-width: 0;
        overflow: hidden;
    }

    .buff-app-code-text {
        font-size: 14px;
        line-height: 20px;
        color: #34404b;
        margin: 0;
        font-weight: 400;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .buff-app-amount-text {
        font-size: 14px;
        line-height: 20px;
        color: #34404b;
        margin: 0;
        font-weight: 400;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .buff-app-amount-highlight {
        color: #3079ff;
        font-weight: 600;
    }

    .buff-app-download-btn {
        background-color: #3079ff;
        color: #ffffff;
        padding: 12px 20px;
        border-radius: 24px;
        text-decoration: none;
        font-size: 14px;
        line-height: 20px;
        font-weight: 600;
        white-space: nowrap;
        flex-shrink: 0;
        transition: background-color 0.3s ease;
        display: inline-block;
    }

    .buff-app-download-btn:hover {
        background-color: #2563eb;
        color: #ffffff;
    }
}

/* Hide mobile app banner on desktop */
@media (min-width: 769px) {
    .buff-app-banner-mobile {
        display: none !important;
    }
}

/* Ensure mobile banner is visible on mobile */
@media (max-width: 768px) {
    .buff-app-banner-mobile {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Ensure buttons don't overlap with other elements */
@media (min-width: 769px) {
    body.admin-bar .buff-contact-buttons-wrapper {
        bottom: 32px;
    }
}