/* 服務項目 */
.service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    width: 90%;
    margin: auto;
    padding: 30px;
    max-width: 1200px;
}

.service-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
}

/* 讓圖片充滿區塊 */
.service-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease-in-out;
}

/* 滑鼠懸停時的反白文字 */
.service-item .overlay {
    font-family: "Noto Serif TC","Noto Sans TC", sans-serif;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0);
    color: #0A1F44;
    opacity: 0;
    transition: opacity 0.4s, background 0.4s;
}

/* 滑鼠 hover 時顯示反白 */
.service-item:hover .overlay {
    background: rgba(255, 255, 255, 0.85);
    opacity: 1;
}

/* 手機版輪播 */
#mobile-carousel {
    display: none;
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: auto;
    text-align: center;
}

.mobile-service-wrapper {
    position: relative;
    width: 100%;
}

#serviceImage {
    max-width: 100%;
    height: auto;
    display: block;
    margin: auto;
    cursor: pointer;
}

#indicator-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.indicator {
    width: 10px;
    height: 10px;
    margin: 0 5px;
    background-color: #ccc;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.indicator.active {
    background-color: #0A1F44;
}

#serviceOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0); /* 初始透明 */
    color: #0A1F44;
    opacity: 0;
    transition: opacity 0.4s, background 0.4s;
    border-radius: 20px; 
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* 手機版反白顯示描述 */
#serviceOverlay.active {
    background: rgba(255, 255, 255, 0.9);
    opacity: 1;
    pointer-events: auto;
}

/* 服務名稱標題 */
.service-title-overlay {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    z-index: 2;
}

/*內文*/
.service-info {
    background: none;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-top: 10px;
}

.service-title {
    font-size: 24px;
    font-weight: bold;
    color: #f8f9fa;
}

.service-description {
    font-size: 20px;
    color: #f8f9fa;
    margin-top: 20px;
}

/* 手機版顯示單張圖片 */
@media (max-width: 800px) {
    .desktop-services {
        display: none !important;
    }

    #mobile-carousel {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
}

/* 桌面版隱藏手機按鈕 */
@media (min-width: 801px) {
    #mobile-carousel {
        display: none;
    }
}