/* 基礎重置 */
body, h1, h2, p, ul, li {
    margin: 0;
    padding: 0;
    list-style: none;
}

html, body {
    height: 100%; /* 視窗高度100% */
    font-family: 'Arial', sans-serif; /* 統一字體設定 */
    color: white; /* 文字顏色設定 */
    background: none; /* 移除原有背景設定 */
    overflow-x: hidden; /* 禁止橫向滾動 */
}

body {
    display: flex;
    flex-direction: column;
}

header {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(153, 0, 0, 0.6);
    z-index: 10; /* 確保 header 在視頻上方 */
    position: relative;
}

nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav li {
    margin: 10px;
}

nav a {
    color: white; /* 設置超連結顏色為白色 */
    text-decoration: none; /* 移除下劃線 */
    font-size: 18px;
    font-weight: bold; /* 字體加粗 */
    transition: color 0.3s ease; /* 漸變動畫，時長0.3秒 */
}

nav a:hover {
    color: #ff0000; /* 指著時顏色變為紅色 */
}

main {
    flex: 1 0 auto; /* 使main元素佔據剩餘空間 */
    padding: 20px;
    overflow-y: auto; /* 允許垂直捲動 */
}

section {
    padding: 20px;
    text-align: center;
    transition: transform 0.5s, background-color 0.5s;
    z-index: 10;
    position: relative;
}

footer {
    background-color: #222;
    text-align: center;
    padding: 10px 0;
    z-index: 10;
    position: fixed; /* 固定位置在視窗底部 */
    bottom: 0; /* 定位到底部 */
    width: 100%; /* 擴展到整個視窗的寬度 */
    left: 0; /* 從左邊界開始 */
    flex-shrink: 0;
}

dialog {
    width: 70%; /* 設定對話框的寬度為視窗的 70% */
    margin: auto; /* 水平居中 */
    border: none; /* 移除邊框 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px; /* 如果需要，可添加內間距 */
    position: fixed;
    top: 15%;  /* 頂部位置，可調整 */
    left: 15%; /* 左側位置，可調整 */
    right: 15%; /* 右側位置，保持與左側相同 */
    background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
    color: white; /* 文字顏色設為白色，若有文字需求 */
}

iframe {
    width: 100%; /* iframe 寬度填滿 dialog */
    height: 80vh; /* 設定 iframe 高度為視窗高度的 80% */
    border: none; /* 移除邊框 */
}

@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
    }

    nav li {
        margin: 5px;
    }

    .product-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .product-item {
        max-width: none;
        width: 100%;
    }

    .product-item img {
        max-height: none;
    }
}

#myVideo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover; /* 覆蓋整個可視區域，保持比例 */
    z-index: -1; /* 位於所有內容之下 */
}

.product-grid {
    padding: 30px;
    gap: 30px;
    display: flex;
    justify-content: center; /* 水平居中 */
    flex-wrap: wrap; /* 允許項目換行 */
}

.product-item {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #555;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    max-width: 600px; /* 調整為更大或根據需要移除 */
    width: 100%; /* 確保在允許的最大寬度內自動調整寬度 */
    overflow: hidden;
    display: flex; /* 新增 */
    flex-direction: column; /* 新增 */
    justify-content: space-between; /* 新增 */
    height: 100%; /* 新增 */
}

.product-item img {
    width: 100%; /* 設置寬度為100% */
    height: auto; /* 高度自動調整以保持比例 */
    max-height: 300px; /* 設置圖片的最大高度 */
    border-radius: 10px;
    object-fit: contain; /* 保持圖片比例並適應容器 */
}

.product-item h3, .product-item p {
    color: #fff;
    margin: 5px 0;
}
