/* Mobile Floating Bar Styles */
.mobile-floating-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    border-top: 1px solid #e5e5e5;
}

/* Button styles for floating bar */
.mobile-floating-bar .mobile-floating-bar-right button,
.mobile-floating-bar .mobile-floating-bar-right .mobile-floating-bar-btn,
.mobile-floating-bar .mobile-floating-bar-right .buy-now-btn,
.mobile-floating-bar .mobile-floating-bar-right .checkout-btn,
.mobile-floating-bar .mobile-floating-bar-right .payment-btn,
.mobile-floating-bar .mobile-floating-bar-right [type="submit"],
.mobile-floating-bar .mobile-floating-bar-right [type="button"] {
    background-color: #fed700;
    color: #ffffff;
    border: none;
    box-shadow: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: center;
}

/* Button hover states */
.mobile-floating-bar .mobile-floating-bar-right button:hover,
.mobile-floating-bar .mobile-floating-bar-right .mobile-floating-bar-btn:hover,
.mobile-floating-bar .mobile-floating-bar-right .buy-now-btn:hover,
.mobile-floating-bar .mobile-floating-bar-right .checkout-btn:hover,
.mobile-floating-bar .mobile-floating-bar-right .payment-btn:hover,
.mobile-floating-bar .mobile-floating-bar-right [type="submit"]:hover,
.mobile-floating-bar .mobile-floating-bar-right [type="button"]:hover {
    background-color: #e6c200;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Price text styles */
.mobile-floating-bar .mobile-floating-bar-left,
.mobile-floating-bar .mobile-floating-bar-left .mobile-cart-total,
.mobile-floating-bar .mobile-floating-bar-left span {
    color: #fed700;
    font-weight: 600;
}

.mobile-floating-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    min-height: 60px;
}

.mobile-floating-bar-left {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: #fed700 !important;
    display: flex;
    align-items: center;
}

/* Override theme styles for price text */
.mobile-floating-bar-left .mobile-cart-total {
    color: #fed700 !important;
    font-weight: 600 !important;
}

.mobile-floating-bar-right {
    flex-shrink: 0;
    margin-left: 16px;
}

/* Additional button styles */
.mobile-floating-bar .mobile-floating-bar-btn,
.mobile-floating-bar button.mobile-floating-bar-btn,
.mobile-floating-bar .buy-now-btn,
.mobile-floating-bar .checkout-btn,
.mobile-floating-bar .payment-btn {
    background-color: #fed700;
    color: #ffffff;
    border: none;
    box-shadow: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: center;
}

/* Additional button hover styles */
.mobile-floating-bar .mobile-floating-bar-btn:hover,
.mobile-floating-bar button.mobile-floating-bar-btn:hover,
.mobile-floating-bar .buy-now-btn:hover,
.mobile-floating-bar .checkout-btn:hover,
.mobile-floating-bar .payment-btn:hover {
    background-color: #e6c200;
    color: #ffffff;
    transform: translateY(-1px);
}

.mobile-floating-bar-btn:hover {
    background-color: #e6c200;
    transform: translateY(-1px);
}

.mobile-floating-bar-btn:active {
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .mobile-floating-bar-content {
        padding: 10px 12px;
        min-height: 55px;
    }
    
    .mobile-floating-bar-left {
        font-size: 16px;
    }
    
    .mobile-floating-bar-btn {
        padding: 8px 16px;
        font-size: 14px;
        min-width: 100px;
    }
}

/* Show only on mobile devices - more reliable detection */
@media (min-width: 769px) {
    .mobile-floating-bar {
        display: none;
    }
}

/* Ensure mobile display on smaller screens */
@media (max-width: 768px) {
    .mobile-floating-bar {
        display: block;
    }
}

/* Loading state */
.mobile-floating-bar.loading .mobile-floating-bar-btn {
    background-color: #28a745;
    opacity: 0.9;
    cursor: pointer;
}

/* Success state */
.mobile-floating-bar.success .mobile-floating-bar-btn {
    background-color: #28a745;
}

/* Error state */
.mobile-floating-bar.error .mobile-floating-bar-btn {
    background-color: #dc3545;
}

/* RTL Support */
.rtl .mobile-floating-bar-content {
    flex-direction: row-reverse;
}

.rtl .mobile-floating-bar-right {
    margin-left: 0;
    margin-right: 16px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mobile-floating-bar {
        border-top: 2px solid #000000;
    }
    
    .mobile-floating-bar .mobile-floating-bar-btn {
        border: 1px solid #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .mobile-floating-bar .mobile-floating-bar-btn {
        transition: none;
    }
    
    .mobile-floating-bar .mobile-floating-bar-btn:hover {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mobile-floating-bar {
        background-color: #1a1a1a;
        border-top-color: #333333;
    }
    
    .mobile-floating-bar-left,
    .mobile-floating-bar-left .mobile-cart-total {
        color: #fed700 !important;
    }
}

/* WooCommerce specific overrides */
.woocommerce .mobile-floating-bar {
    z-index: 9999; /* Ensure it's above WooCommerce elements */
}

.woocommerce-page .mobile-floating-bar {
    z-index: 9999;
}

/* Hide when WooCommerce overlays are active */
.woocommerce .woocommerce-overlay + .mobile-floating-bar {
    display: none !important;
}

/* Adjustments for different WooCommerce themes */
.storefront .mobile-floating-bar {
    bottom: 0;
}

.astra .mobile-floating-bar {
    bottom: 0;
}

.oceanwp .mobile-floating-bar {
    bottom: 0;
}

.generatepress .mobile-floating-bar {
    bottom: 0;
}