/* Default styles for desktop */
.floating-top-btn {
    position: fixed;
    bottom: 25px;
    right: 240px; /* Positioned correctly for desktop view */
    width: 60px;
    height: 60px;
    background-color: #cc0000; /* Using the red color from the site's palette */
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, background-color 0.3s ease;
    z-index: 1000;
    border: none;
    overflow: hidden;
}

.floating-top-btn:hover {
    transform: translateY(-3px);
    background-color: #cc0000; /* Same red color on hover */
}

.floating-top-btn i {
    font-size: 32px;
    color: white;
    margin-bottom: 0;
}

.floating-top-text {
    font-size: 12px;
    color: white;
    text-align: center;
    line-height: 1.3;
    font-weight: bold;
    max-width: 90%;
    margin-top: 0px;
}

/* Container for the grid layout */
.floating-buttons-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    max-width: 100%;
    padding: 0 10px;
    z-index: 1000;
}

/* We removed the min-width: 997px media query as it was causing conflicts */

/* Tablet view */
@media (max-width: 1024px) and (min-width: 769px) {
    .floating-top-btn {
        bottom: 60px;
        right: 10px; /* Improved position for tablet view */
        width: 50px;
        height: 50px;
    }

    .floating-top-btn i {
        font-size: 28px;
    }
    
    .floating-top-text {
        font-size: 12px;
    }
}

/* Small tablets and large phones */
@media (max-width: 996px) and (min-width: 769px) {
    .floating-top-btn {
        bottom: 1%;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}

/* Mobile view */
@media (max-width: 768px) {
    .floating-top-btn {
        bottom: 1%;
        right: 10px;
        width: 40px;
        height: 40px;
    }
    
    .floating-top-btn::before {
        margin: 1px;
    }

    .floating-top-btn i {
        font-size: 24px;
    }
    
    .floating-top-text {
        font-size: 12px;
    }
}