/* carousel.css 合併優化版本 */
.carousel-section {
    margin-top: 76px;
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 38.5%; /* 462/1200 = 0.385 = 38.5% */
    background-color: #f0f0f0;
}

#mainCarousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.carousel-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-item {
    position: relative;
    height: 100%;
}

.carousel-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 移除變色效果 */
.carousel-item::after {
    display: none;
}

/* 標題說明文字樣式 */
.carousel-caption {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
    bottom: 1.4rem;
    z-index: 2;
}

.carousel-caption h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.carousel-caption p {
    font-size: 1rem;
    margin-bottom: 0;
}

/* 控制按鈕樣式 */
.carousel-control-prev,
.carousel-control-next {
    width: 10%;
    opacity: 1;
}

/* 自定義控制按鈕樣式 */
.carousel-control-btn {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.carousel-control-btn i {
    font-size: 24px;
    color: white;
    transition: transform 0.3s ease;
}

/* 懸停效果 */
.carousel-control-prev:hover .carousel-control-btn,
.carousel-control-next:hover .carousel-control-btn {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-control-prev:hover .carousel-control-btn i {
    transform: translateX(-3px);
}

.carousel-control-next:hover .carousel-control-btn i {
    transform: translateX(3px);
}

/* 指示器樣式 */
.carousel-indicators {
    margin-bottom: 0.5rem;
    z-index: 2;
}

.carousel-indicators button {
    width: 70px !important;
    height: 10px !important;
    border-radius: 3px !important;
    margin: 0 6px !important;
    background-color: rgba(255, 255, 255, 0.7) !important;
    border: none !important;
    opacity: 1 !important;
    transition: all 0.3s ease !important;
}

.carousel-indicators button.active {
    background-color: #fff !important;
    width: 60px !important;
}

.carousel-indicators button:hover {
    background-color: rgba(255, 255, 255, 0.8) !important;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .carousel-section {
        margin-top: 62px;
    }
    
    .carousel-caption {
        padding: 0.5rem;
        bottom: 1.4rem;
    }
    
    .carousel-caption h3 {
        font-size: 1.5rem;
    }
    
    .carousel-caption p {
        font-size: 1rem;
    }

    .carousel-control-btn {
        width: 40px;
        height: 40px;
    }

    .carousel-control-btn i {
        font-size: 18px;
    }

    .carousel-indicators {
        margin-bottom: 0.5rem;
    }

    .carousel-indicators button {
        width: 35px !important;
        height: 4px !important;
        margin: 0 4px !important;
    }

    .carousel-indicators button.active {
        width: 35px !important;
    }
}