/**
 * Brand Carousel Styles
 * 
 * Styles for the brand carousel component that displays
 * two basic galleries with 4 logos per row in carousel format
 */

.brand-carousel-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}

.brand-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.brand-carousel-inner {
    position: relative;
    width: 100%;
    height: auto;
}

.brand-gallery-slide {
    display: none;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.brand-gallery-slide.active {
    display: block;
    opacity: 1;
}

.brand-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 30px 0;
    align-items: center;
    min-height: 150px;
}

/* Column-based alignment for all rows - 每行的第1列靠左，第4列靠右 */
.brand-carousel-wrapper .brand-gallery-grid .brand-item:nth-child(4n+1) {
    text-align: left !important; /* 每行第1列：1, 5, 9, 13... 靠左 */
}

.brand-carousel-wrapper .brand-gallery-grid .brand-item:nth-child(4n+2),
.brand-carousel-wrapper .brand-gallery-grid .brand-item:nth-child(4n+3) {
    text-align: center !important; /* 每行第2,3列：2,3, 6,7, 10,11, 14,15... 居中 */
}

.brand-carousel-wrapper .brand-gallery-grid .brand-item:nth-child(4n) {
    text-align: right !important; /* 每行第4列：4, 8, 12, 16... 靠右 */
}

.brand-item {
    display: block; /* 改为block布局 */
    padding: 15px;
    transition: transform 0.3s ease;
    text-align: center; /* 默认居中对齐 */
}

.brand-item:hover {
    transform: scale(1.05);
}

.brand-link {
    display: inline-block;
    text-decoration: none;
    max-width: 200px;
    width: auto;
}

.brand-logo {
    width: 100%;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    filter: grayscale(0%);
    transition: filter 0.3s ease;
}

.brand-logo:hover {
    filter: grayscale(0%);
}

/* Carousel Controls Container */
.brand-carousel-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 0;
}

/* Carousel Indicators - 左侧对齐 */
.brand-carousel-indicators {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    padding: 0;
    margin: 0;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background-color: rgba(3, 105, 186, 0.3); /* #0369ba 透明版本 */
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    padding: 0;
}

.carousel-indicator:hover {
    background-color: rgba(3, 105, 186, 0.6);
    transform: scale(1.1);
}

.carousel-indicator.active {
    background-color: #0369ba; /* 激活状态使用完整颜色 */
}

/* Carousel Arrows - 右侧对齐 */
.brand-carousel-arrows {
    display: flex;
    gap: 8px;
}

.carousel-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #0369ba;
    background-color: transparent;
    color: #0369ba;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-arrow:hover {
    background-color: #0369ba;
    color: white;
    transform: scale(1.05);
}

.carousel-arrow:active {
    transform: scale(0.95);
}

.carousel-arrow:disabled {
    border-color: #ccc;
    color: #ccc;
    cursor: not-allowed;
}

.carousel-arrow:disabled:hover {
    background-color: transparent;
    color: #ccc;
    transform: none;
}

/* Responsive Design */
@media (max-width: 992px) {
    .brand-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* 平板：2列布局时的对齐 */
    .brand-carousel-wrapper .brand-gallery-grid .brand-item:nth-child(2n+1) {
        text-align: left !important; /* 奇数列靠左：1, 3, 5, 7... */
    }
    
    .brand-carousel-wrapper .brand-gallery-grid .brand-item:nth-child(2n) {
        text-align: right !important; /* 偶数列靠右：2, 4, 6, 8... */
    }
}

@media (max-width: 576px) {
    .brand-carousel-wrapper {
        padding: 20px 15px;
    }
    
    .brand-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 20px 0;
    }
    
    /* 手机：2列布局，但为了美观都居中 */
    .brand-carousel-wrapper .brand-gallery-grid .brand-item:nth-child(2n+1),
    .brand-carousel-wrapper .brand-gallery-grid .brand-item:nth-child(2n) {
        text-align: center !important; /* 手机端都居中对齐 */
    }
    
    .brand-item {
        padding: 10px;
    }
    
    .brand-logo {
        max-height: 60px;
    }
}

/* Animation for slide transitions */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.brand-gallery-slide.active {
    animation: slideIn 0.5s ease-in-out;
}