* {
    padding: 0;
    margin: 0;
    /*box-sizing: border-box;*/
}
html, body {
  margin: 0 !important;
  padding: 0;
}

header {
  position: fixed;
  top: 0;       /* 關鍵：貼齊上緣 */
  left: 0;
  right: 0;
  height: 80px; /* 你原本就有 */
  z-index: 1200;
}

/* --- 頂部 Header & 導覽列 (通用/電腦版) --- */
header {
    background-color: rgba(10, 28, 26, 0.8);
    height: 80px; 
    width: 100%;
    position: fixed;
    z-index: 1200;
}


/* 電腦版選單：預設顯示 (右上角) */
header ul {
    position: absolute;
    right: 5vw;
    top: 0;
    line-height: 80px;
}

header li {
    display: inline;
    margin-right: 2vw;
}

header a {
    color: white;
    text-decoration: none;
}

header a:hover {
    text-decoration: underline;
}
.slogan {
    background-color: #485652;
    color: white;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    line-height: 1.8em;
  
}

section {
    background-color: #4ec5b7;
}

 .product {
    display: flex;
    background-color: #ede9db;
    justify-content: space-between;
    align-items: center;
    padding: 100px 180px 80px;
}

.product div {
    width: 300px;
    text-align: center;
}

.product img {
    width: 100%;
    border-radius: 10px;
}

.product h3 {
    font-size: 20px;
    margin: 20px 0;
}

.product p {
    font-size: 14px;
    line-height: 1.6em;
}

input::placeholder {
    color: #DDDDDD;
}

input:focus {
    outline: none;
    border-color: #E0E9A3;
}

footer {
    background-color: #000000;
    color: #B7B7B7;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
}


/* --- 響應式設計語法 (手機模式 $\le 768px$) --- */
@media screen and (max-width: 768px) {
    /* 1. 隱藏電腦版選單 */
    header ul {
        display: none;
    }
    
    /* 2. H1 置中 */
    header h1 {
        left: 50%;
        transform: translateX(-50%);
    }

   
    
    

    /* 5. 側欄內的 UL 顯示且無定位影響 */
    header nav ul {
        display: block !important;
        position: static !important;
        margin: 0;
        padding: 0 16px;
        line-height: 1.6;
    }
    
    /* 6. 側欄 LI/A 樣式 */
    header nav li {
        display: block;
        margin: 0 0 12px 0;
    }
    
    header nav a {
        display: block;
        padding: 12px 10px;
        border-radius: 8px;
        color: #fff;
    }
    
    header nav a:hover {
        background: rgba(255, 255, 255, 0.08);
        text-decoration: none;
    }

    /* 7. 開啟狀態：移動側欄 */
    body.nav-open header nav {
        transform: translateX(0);
    }
    
    /* 8. 開啟時鎖定捲動 (手機模式限定) */
    body.nav-open {
        overflow: hidden;
    }

    /* 9. 背景遮罩 */
    .backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 900; 
    }
    
    body.nav-open .backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    

    /* 10. 動畫減量偏好 */
    @media (prefers-reduced-motion: reduce) {
        header nav, .backdrop {
            transition: none !important;
        }
    }
    
    /* --- 其他手機版面修正 --- */
    .news h2 {
        font-size: 40px;
    }
    
    .product {
        flex-direction: column;
        padding: 60px 0;
    }
    
    .product div {
        margin-bottom: 30px;
        width: 80%; 
    }
  
}
/* 專門修正：強制確保大螢幕下 nav-open 不會鎖定滾動 */
/* 僅在寬度大於 768px 時生效 (電腦版) */
@media screen and (min-width: 769px) {
    body.nav-open {
        overflow: visible !important; /* 確保滾動條能顯示 */
    }

    /* 確保背景遮罩在大螢幕下是隱藏的，因為不需要 */
    .backdrop {
        display: none !important;
    }
}
