/**
 * Clem WP Chat - Frontend Styles
 * Version: 1.4.0
 * 
 * Ensures carousel/slider navigation arrows display properly on mobile
 */

/* Main WhatsApp Button */
.cwc-whatsapp-button {
    position: fixed;
    z-index: 998; /* Lowered to allow navigation arrows above */
    right: 30px;
    bottom: 30px;
    background: #25D366;
    color: #fff;
    border-radius: 50px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    outline: none;
}

/* Ensure navigation elements appear above WhatsApp button */
.carousel-control-prev,
.carousel-control-next,
.slick-prev,
.slick-next,
.swiper-button-prev,
.swiper-button-next,
.elementor-swiper-button-prev,
.elementor-swiper-button-next,
.owl-prev,
.owl-next,
.tns-nav,
.flickity-prev-next-button,
[class*="arrow"],
[class*="navigation"] {
    z-index: 999 !important; /* Above WhatsApp button */
}

/* Position Variants */
.cwc-whatsapp-button.bottom-left {
    right: auto;
    left: 30px;
}

.cwc-whatsapp-button.bottom-right {
    right: 30px;
    left: auto;
}

/* Icon Styling */
.cwc-whatsapp-button img {
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: none;
    display: block;
    pointer-events: none;
    /* Prevent image dragging */
    -webkit-user-drag: none;
    user-select: none;
}

/* Hover State */
.cwc-whatsapp-button:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

/* Focus State for Accessibility */
.cwc-whatsapp-button:focus {
    outline: 3px solid rgba(37, 211, 102, 0.5);
    outline-offset: 2px;
}

/* Active State */
.cwc-whatsapp-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Shape Variants */
.cwc-whatsapp-button.cwc-square {
    border-radius: 12px !important;
}

.cwc-whatsapp-button.cwc-circle {
    border-radius: 50px !important;
}

/* Device Visibility */
@media (max-width: 767px) {
    .cwc-hide-mobile {
        display: none !important;
    }
    
    /* Position button to not interfere with navigation */
    .cwc-whatsapp-button {
        right: 15px;
        bottom: 20px; /* Lower position since arrows are now above */
        padding: 14px;
        z-index: 998; /* Below navigation arrows */
    }
    
    .cwc-whatsapp-button.bottom-left {
        left: 15px;
        right: auto;
        bottom: 20px;
    }
    
    /* Smaller icon on mobile */
    .cwc-whatsapp-button img {
        width: 24px;
        height: 24px;
    }
    
    /* Ensure all navigation elements are above button */
    .carousel-control-prev,
    .carousel-control-next,
    .slick-prev,
    .slick-next,
    .swiper-button-prev,
    .swiper-button-next,
    .elementor-swiper-button,
    .owl-prev,
    .owl-next,
    button[class*="prev"],
    button[class*="next"],
    button[class*="arrow"],
    .tns-controls button {
        z-index: 999 !important;
        position: relative !important;
    }
}

@media (min-width: 768px) {
    .cwc-hide-desktop {
        display: none !important;
    }
}

/* Text Styling (if text is added in future) */
.cwc-whatsapp-button span {
    display: inline-block;
    vertical-align: middle;
    font-size: 1rem;
    line-height: 1.2;
    margin-left: 8px;
    white-space: nowrap;
}

/* Compact Mode for Very Small Screens */
@media (max-width: 400px) {
    .cwc-whatsapp-button {
        padding: 12px;
        right: 12px;
        bottom: 15px; /* Keep it low on small screens */
    }
    
    .cwc-whatsapp-button.bottom-left {
        left: 12px;
        right: auto;
        bottom: 15px;
    }
    
    .cwc-whatsapp-button img {
        width: 22px;
        height: 22px;
    }
    
    .cwc-whatsapp-button span {
        display: none;
    }
}

/* Remove the special bottom nav handling - arrows are now above */

/* Accessibility: High Contrast Mode Support */
@media (prefers-contrast: high) {
    .cwc-whatsapp-button {
        border: 2px solid currentColor;
    }
}

/* Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .cwc-whatsapp-button {
        transition: none;
    }
    
    .cwc-whatsapp-button:hover {
        transform: none;
    }
}

/* Print Styles - Hide button when printing */
@media print {
    .cwc-whatsapp-button {
        display: none !important;
    }
}

/* RTL Language Support */
[dir="rtl"] .cwc-whatsapp-button {
    left: 30px;
    right: auto;
}

[dir="rtl"] .cwc-whatsapp-button.bottom-left {
    right: 30px;
    left: auto;
}

[dir="rtl"] .cwc-whatsapp-button span {
    margin-left: 0;
    margin-right: 8px;
}

/* Loading State (Optional) */
.cwc-whatsapp-button.cwc-loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: not-allowed;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .cwc-whatsapp-button {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .cwc-whatsapp-button:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }
}
