/**
 * FOE Brands Owl Carousel Module Styles
 * @package     FOE Brands Module
 * @subpackage  mod_foe_brands
 * @author      FOE Development
 * @copyright   Copyright (C) 2024. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */

/* Container and Module Header Styles */
.foe-container-banner .moduletable {
    border: 1px solid #0000002d;
}

.foe-container-banner .moduletable h3 {
    background-color: #000000;
    color: #FFF;
    margin-top: 0;
    margin-bottom: 0;
    padding: 15px 20px 16px;
    font-size: 16px;
    text-transform: uppercase;
}

/* Main Carousel Wrapper */
.mod-foe-brands-wrapper {
    position: relative;
    margin: 0 auto;
    max-width: 100%;
}

/* Owl Carousel Container */
.mod-foe-brands-carousel {
    position: relative;
    width: 100%;
}

/* Brand Item Styles */
.brand-item {
    position: relative;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.brand-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
}

/* Brand Images */
.brand-image {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 0.375rem;
}

.brand-image.img-responsive {
    width: 100%;
}

/* Brand Links */
.brand-link {
    display: block;
    width: 100%;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    outline: none;
}

.brand-link:hover,
.brand-link:focus {
    transform: translateY(-2px);
    text-decoration: none;
}

.brand-link:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Hover Effects */
.brand-link:hover .brand-image {
    transform: scale(1.05);
    opacity: 0.95;
}

/* Brand Titles */
.brand-title-container {
    margin-top: 1rem;
    width: 100%;
}

.brand-title {
    margin: 0;
    padding: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #333333;
    text-align: center;
    line-height: 1.4;
}

.brand-title-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.brand-title-link:hover,
.brand-title-link:focus {
    color: #0d6efd;
    text-decoration: none;
}

/* Owl Stage Wrapper for Navigation Positioning */
.mod-foe-brands-carousel .owl-stage-outer {
    position: relative;
    padding: 0 5rem;
    margin: 0 4.25rem;
}

/* Owl Carousel Navigation Customization */
.mod-foe-brands-carousel .owl-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 0;
    margin: 0;
    pointer-events: none; /* Allow clicks to pass through to buttons */
}

.mod-foe-brands-carousel .owl-nav button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    background-color: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    outline: none;
    pointer-events: auto; /* Re-enable clicks for buttons */
    z-index: 10;
    cursor: pointer;
}

.mod-foe-brands-carousel .owl-nav .owl-prev {
    left: 0.5rem;
}

.mod-foe-brands-carousel .owl-nav .owl-next {
    right: 0.5rem;
}

.mod-foe-brands-carousel .owl-nav button:hover,
.mod-foe-brands-carousel .owl-nav button:focus {
    background-color: rgba(0, 0, 0, 0.9) !important;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mod-foe-brands-carousel .owl-nav button:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.mod-foe-brands-carousel .owl-nav button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.mod-foe-brands-carousel .owl-nav button.disabled:hover {
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.7) !important;
}

/* Owl Carousel Dots Customization */
.mod-foe-brands-carousel .owl-dots {
    text-align: center;
    margin-top: 2rem;
    padding: 0;
}

.mod-foe-brands-carousel .owl-dots button {
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    background-color: rgba(0, 0, 0, 0.25) !important;
    border: none !important;
    margin: 0 6px !important;
    transition: all 0.3s ease !important;
    outline: none !important;
    cursor: pointer;
    padding: 0 !important;
}

.mod-foe-brands-carousel .owl-dots button:hover {
    background-color: rgba(0, 0, 0, 0.5) !important;
    transform: scale(1.2);
}

.mod-foe-brands-carousel .owl-dots button:focus {
    outline: 2px solid #0d6efd !important;
    outline-offset: 2px;
}

.mod-foe-brands-carousel .owl-dots button.active {
    background-color: #0d6efd !important;
    transform: scale(1.3);
}

/* Fullwidth Mode Specific Styles */
.mod-foe-brands-carousel.owl-carousel-fullwidth .brand-item {
    padding: 0.75rem;
}

.mod-foe-brands-carousel.owl-carousel-fullwidth .brand-title {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background-color: rgba(248, 249, 250, 0.9);
    border-radius: 0.25rem;
}

/* Single Mode Specific Styles */
.mod-foe-brands-carousel.owl-carousel-single .brand-item {
    padding: 1rem;
}

.mod-foe-brands-carousel.owl-carousel-single .brand-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Lazy Loading Placeholder */
.owl-lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.owl-lazy.loaded {
    opacity: 1;
}

/* Accessibility Improvements */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus Management */
.mod-foe-brands-carousel:focus-within .owl-nav {
    opacity: 1;
}

/* Animation Support */
.mod-foe-brands-carousel .owl-item {
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Responsive Design */
@media (max-width: 767.98px) {
    .mod-foe-brands-carousel .owl-stage-outer {
        padding: 0 3rem; /* Reduce spacing on tablets */
    }
    
    .mod-foe-brands-carousel .owl-nav button {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .mod-foe-brands-carousel .owl-nav .owl-prev {
        left: 0.25rem;
    }

    .mod-foe-brands-carousel .owl-nav .owl-next {
        right: 0.25rem;
    }
    
    
    .brand-item {
        padding: 0.25rem;
    }
    
    .brand-title {
        font-size: 0.75rem;
        padding: 0.375rem;
    }
    
    .brand-title-container {
        margin-top: 0.5rem;
    }
}

@media (max-width: 575.98px) {
    .mod-foe-brands-carousel .owl-stage-outer {
        padding: 0 2.5rem; /* Even less spacing on mobile */
    }

    
    .brand-title {
        font-size: 0.625rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .mod-foe-brands-carousel .owl-nav button {
        background-color: rgba(0, 0, 0, 0.9) !important;
        border: 2px solid #ffffff !important;
    }
    
    .mod-foe-brands-carousel .owl-dots button {
        border: 2px solid #000000 !important;
        background-color: #ffffff !important;
    }
    
    .mod-foe-brands-carousel .owl-dots button.active {
        background-color: #000000 !important;
        border-color: #ffffff !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .mod-foe-brands-carousel,
    .mod-foe-brands-carousel *,
    .brand-image,
    .brand-link,
    .owl-nav button,
    .owl-dots button {
        transition: none !important;
        animation: none !important;
    }
}

/* Print Styles */
@media print {
    .mod-foe-brands-carousel .owl-nav,
    .mod-foe-brands-carousel .owl-dots {
        display: none !important;
    }
    
    .mod-foe-brands-carousel .owl-stage-outer {
        overflow: visible !important;
    }
    
    .mod-foe-brands-carousel .owl-stage {
        display: block !important;
        width: auto !important;
        transform: none !important;
    }
    
    .mod-foe-brands-carousel .owl-item {
        display: block !important;
        width: auto !important;
        float: left;
        margin-right: 1rem;
    }
}