/* --- 通用設定 --- */
html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    color: #333;
}

/* 新增以下程式碼到您的 main.css 檔案中 */
.highlight {
    color: #fad608; /* 這是一個常用的金黃色 */
    font-weight: bold; /* 您也可以選擇加粗字體 */
}

/* --- 區塊1: 頂部橫幅 --- */
.block-1 {
    width: 100%;
    height: 90px; /* 將高度固定為 90px */
    min-height: 90px; /* 將最小高度也設定為 90px */
    background-color: rgb(0, 0, 0);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 20px ;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;

    /* 恢復並修正動畫的初始狀態 */
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* 新增：定義 block-1 的動畫結束狀態 */
.block-1.is-visible {
    opacity: 1;
    transform: translateX(0);
}


body {
    padding-top: 90px;
    margin: 0;
}

.block-1 .logo-link {
    display: flex;
    align-items: center;
    width: 20%;
    max-width: 200px;
    height: 100%;
}

.block-1 .logo-link img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    display: block;
    opacity: 1;
}

.main-nav {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    flex-grow: 1;
}

/* --- 桌面版導航選單 --- */
.desktop-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

.desktop-nav-list li {
    position: relative;
}

.desktop-nav-list li a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: white;
    font-size: 1.5em;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    font-family: "Georgia", serif;
}

.desktop-nav-list li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    left: auto;
    top: 100%;
    min-width: 220px;
    background-color: rgb(25, 25, 25);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 90;
    list-style: none;
    padding: 0;
    margin: 0;
    border-radius: 5px;
    overflow: hidden;
}

.has-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    color: white;
    padding: 12px 25px;
    font-size: 1.2em;
    white-space: nowrap;
    font-family: "Georgia", serif;
    text-align: right;
}

.dropdown-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* 漢堡選單按鈕 */
.menu-toggle-btn {
    display: none;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: white;
    padding: 10px;
    z-index: 101;
    align-self: flex-end;
    margin-bottom: -5px;
}

/* 手機版下推選單區塊 */
.push-menu {
    position: fixed;
    top: var(--header-height, 200px);
    left: 0;
    width: 100%;
    height: auto;
    max-height: calc(100vh - var(--header-height, 200px));
    background-color: rgb(25, 25, 25);
    color: white;
    transform: translateY(-100%);
    transition: transform 0.3s ease-out;
    z-index: 999;
    overflow-y: auto;
    display: none;
}

.push-menu.active {
    transform: translateY(0);
}

.push-menu ul.push-nav-list {
    list-style: none;
    margin: 0;
    padding: 20px 0;
    text-align: center;
}

.push-menu ul.push-nav-list li a {
    display: block;
    padding: 18px 20px;
    text-decoration: none;
    color: white;
    font-size: 1.4em;
    transition: background-color 0.3s ease;
    font-family: "Georgia", serif;
}

.push-menu ul.push-nav-list li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.push-nav-list .mobile-dropdown-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    background-color: rgb(40, 40, 40);
}

.push-nav-list .mobile-dropdown-menu li a {
    padding: 12px 20px 12px 40px;
    font-size: 1.1em;
    text-align: left;
    font-family: "Georgia", serif;
}

.push-nav-list .mobile-dropdown-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* 主要內容容器，它會被往下推 */
.content-wrapper {
    transition: transform 0.3s ease-out;
}

.content-wrapper.pushed {
    transform: translateY(var(--push-menu-height, 165px));
}

/* --- 區塊2: 首頁圖片 (index.html 專用) --- */
.block-2 {
    width: 100%;
    height: 500px;
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    overflow: hidden;
    position: relative; /* 新增：設定為相對定位 */
}

.block-2 .image-half {
    width: 100%;
    height: 100%;
}

.block-2 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* 新增：區塊2 的文字容器樣式 */
.block-2 .banner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    z-index: 2;
    width: 90%; /* 新增：限制文字容器的寬度 */
    max-width: 800px; /* 新增：設定最大寬度 */
    box-sizing: border-box; /* 確保寬度包含內邊距 */
}

/* 標題和段落的樣式 */
.block-2 .banner-text h2 {
    font-size: 3em;
    margin: 0;
    line-height: 1.2;
}

.block-2 .banner-text p {
    font-size: 1.2em;
    margin: 0;
}


.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

/* 動畫的最終狀態：透明度為1，回到原位 */
.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- 區塊3: 解決方案 (index.html 專用) --- */
.block-3 {
    width: 100%;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 50px 20px;
    box-sizing: border-box;
}

.solution-section-title {
    text-align: center;
    margin-bottom: 40px;
}

.solution-section-title h3 {
    font-size: 2.5em;
    color: #333;
    margin: 0;
}

.solution-section-title p {
    font-size: 1.2em;
    color: #666;
    margin: 5px 0 0;
}

.solution-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 1200px;
}

.solution-item {
    text-align: center;
    width: 150px;
}

.solution-icon {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #ddd;
    margin-bottom: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.solution-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    /* 新增：為過渡效果作準備 */
    transition: transform 0.3s ease; 
}

/* 新增：滑鼠懸停時的放大效果 */
.solution-icon:hover img {
    transform: scale(1.1); /* 將圖片放大 1.1 倍 */
}

.solution-item h4 {
    font-size: 1.2em;
    color: #333;
    margin: 0;
}

.solution-item p {
    font-size: 1em;
    color: #666;
    margin: 5px 0 0;
}


/* --- 區塊4: 版權區塊 --- */
.block-4 {
    width: 100%;
    height: 400px;
    background-color: #3a3535;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    color: #fff;
    flex-wrap: wrap;
}

.map-container {
    flex: 1;
    height: 100%;
    min-width: 300px;
    margin-right: 20px;
    background-color: #eee;
    overflow: hidden;
}

.map-container iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

.company-info {
    flex: 1;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
}

.company-info h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.company-info p {
    font-size: 1em;
    line-height: 1.5;
    margin: 5px 0;
}

.company-info .social-icons {
    margin-top: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.company-info .social-icons img {
    width: 40px;
    height: 40px;
    border-radius: 5px;
}


/* --- 響應式設計 --- */
@media (max-width: 768px) {
    /* 區塊1手機版樣式 */
    .block-1 {
        height: auto;
        min-height: 80px;
        padding: 0 20px;
        align-items: center;
    }
    .main-nav {
        flex-grow: 0;
        justify-content: flex-end;
        align-items: center;
    }
    .menu-toggle-btn {
        display: block;
        align-self: center;
        margin-bottom: 0;
    }
    .desktop-nav-list {
        display: none;
    }
    .push-menu {
        display: block;
        top: 80px;
    }
    .content-wrapper.pushed {
        transform: translateY(var(--push-menu-actual-height));
    }
    body {
        padding-top: 80px;
    }

    /* 區塊2手機版樣式 */
    .block-2 {
        min-height: 250px; /* 縮小手機版的最小高度 */
        height: auto; /* 讓高度根據內容調整 */
        margin: 0; /* 再次確保沒有上下留白 */
        padding: 0;
     }

     .block-2 img {
        height: auto; /* 讓圖片高度自動調整 */
        min-height: 250px; /* 圖片最小高度與區塊一致 */
    }

   .block-2 .banner-text {
        width: 90%; /* 限制文字容器寬度，防止溢出 */
        padding: 10px; /* 減少內邊距 */
    }

    .block-2 .banner-text h2 {
        font-size: 2em; /* 縮小手機版的標題字體 */
    }

    .block-2 .banner-text p {
         font-size: 1em; /* 縮小手機版的段落字體 */
 }

 /* ... 其他手機版樣式 ... */
}

   /* 區塊3手機版樣式 */
    .block-3 {
        padding: 30px 10px;
    }
    .solution-section-title h3 {
        font-size: 2em;
    }
    .solution-section-title p {
        font-size: 1em;
    }
    .solution-grid {
        gap: 20px;
    }
    .solution-item {
        width: 120px;
    }
    .solution-icon {
        width: 120px;
        height: 120px;
    }


    /* 區塊4手機版樣式 */
      /* 區塊4手機版樣式 */
    .block-4 {
        flex-direction: column;
        height: auto;
        padding: 20px;
    }
    .map-container {
        width: 100%;
        height: 250px;
        margin-right: 0;
        margin-bottom: 20px;
    }
    .company-info {
        width: 100%;
        max-width: 100%;
        align-items: center;
        text-align: center;
    }


/* 更小螢幕下 (例如單列) */
@media (max-width: 480px) {
    .solution-grid {
        flex-direction: column; /* 超小螢幕下垂直排列 */
        align-items: center;
    }
    .product-item {
        flex: 0 0 calc(100% - 15px);
    }
}

/* --- 桌面版樣式 (大於 769px) --- */
@media (min-width: 769px) {
    .menu-toggle-btn {
        display: none;
    }
    .push-menu {
        display: none;
    }
    .has-dropdown .dropdown-menu {
        display: none;
    }
    .block-1 {
        height: 90px;
        padding: 0 20px ;
        align-items: center;
    }
    body {
        padding-top: 90px;
    }

   
    .content-wrapper {
        margin-top: -90px; /* 新增這一行，使用負值來消除間距 */
        transform: translateY(0) !important;
    }
}

/* --- Product_Deos.html 專用樣式 (產品頁面) --- */
.block-2-product-page {
    width: 100%;
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 0;
    box-sizing: border-box;
    position: relative;
     /* 調整 min-height 或使用 height: 100vh; 以確保圖片填滿視口 */
    min-height: 400px;
    /* 新增：確保區塊底部沒有空隙 */
    margin-bottom: 0;
}

.block-2-product-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.product-page-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.product-page-hero-content h2 {
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

.product-page-hero-content p {
    font-size: 1.2em;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

/* 區塊3: 產品網格 */
.block-3-product-list {
    padding: 40px 20px;
    background-color: #f5f5f5;
    text-align: center;
}

.block-3-product-list h3 {
    font-size: 2.2em;
    color: #333;
    margin-bottom: 30px;
}

.product-grid-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.product-specs span {
    display: block;
    margin: 0;
    padding: 2px 0;
}

.product-specs {
    line-height: 1.2;
    margin-bottom: 10px;
}

.product-item {
    flex: 0 0 calc(25% - 15px);
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    min-width: 200px;
}

.product-item img {
    max-width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: contain;
    margin-bottom: 15px;
}

.product-item h4 {
    font-size: 1.3em;
    color: #232425;
    margin-bottom: 10px;
}

.product-item p {
    margin: 0 0 5px 0;
    padding: 0;
    font-size: 0.95em;
    color: #474646;
    line-height: 1.5;
}

.product-item.product-specs span {
    display: block;
    margin: 0;
    padding: 2px 0;
    font-size: 0.9em;
    color: #444;
    line-height: 1.2;
    text-align: center;
}

/* 手機模式下 (小於 768px): 一列2個產品 */
@media (max-width: 768px) {
   .content-wrapper{
    position: relative; /* 確保 z-index 有效 */
    z-index: 10; /* 設定一個較低的值，確保不覆蓋選單 */
    }

    .push-menu {
        z-index: 100; /* 確保選單在內容上方 */
    }

    
    .block-2-product-page {
        min-height: 300px;
    }
    .product-page-hero-content h2 {
        font-size: 2.2em;
    }
    .product-page-hero-content p {
        font-size: 1em;
    }
    .product-item {
        flex: 0 0 calc(50% - 15px);
    }
    .block-3-product-list h3 {
        font-size: 1.8em;
    }
}

/* 新增以下 CSS 程式碼 */
.slide-in-right {
    opacity: 0;
    transform: translateX(50px); /* 從右側移入 */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.slide-in-right.is-visible {
    opacity: 1;
    transform: translateX(0); /* 最終位置回到原位 */
}