/* ==========================================
   1. 全域重設與字型設定
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background-color: #f5f5f5;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    color: #333;
    line-height: 1.5;
}

a {
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* ==========================================
   2. 主容器架構 (不鎖死高度，避免重疊)
   ========================================== */
#container {
    background: #ffffff;
    margin: 0 auto;
    padding: 20px 40px;
    max-width: 1200px;
    width: 100%;
    min-height: 100vh;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
}

/* ==========================================
   3. 頁首與商標 (Header & Logo)
   ========================================== */
#header {
    display: flex;
    justify-content: flex-end;
    padding: 5px 0;
    color: #999999;
    font-size: 14px;
}

#nav {
    padding: 10px 0;
}

.responsive-logo {
    max-width: 265px;
    width: 100%;
    height: auto;
}

/* ==========================================
   4. 頂部主導航 (Menu)
   ========================================== */
#menu {
    background-color: #000000;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    position: relative;
    z-index: 100;
}

.companymenuli {
    position: relative;
}

.companymenuli > a {
    display: block;
    padding: 15px 20px;
    color: #ffffff;
}

.companymenuli > a:hover {
    background-color: #ff6900;
    color: #000000;
}

/* 下拉選單 */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    list-style: none;
    padding: 5px 0;
}

.submenu li a {
    display: block;
    padding: 10px 15px;
    color: #333333;
}

.submenu li a:hover {
    background-color: #f5f5f5;
    color: #ff6900;
}

.companymenuli:hover .submenu {
    display: block;
}

/* ==========================================
   5. 核心雙欄佈局 (消滅 Absolute 疊位精髓)
   ========================================== */
.main-wrapper {
    display: flex;
    flex-direction: column; /* 確保上、中、下層由上至下垂直排好 */
    margin-top: 25px;
    gap: 35px; /* 每一層之間保持健康的骨骼距離，絕不疊字 */
    width: 100%;
}

.top-content-layer {
    display: flex;
    flex-direction: row; /* 強制左邊 Sidebar，右邊內容 */
    align-items: flex-start;
    gap: 30px; /* 側邊欄同右邊內容嘅間距 */
    width: 100%;
}

/* 左側邊欄 */
#sidebar {
    width: 230px;
    flex-shrink: 0; /* 鎖死寬度，不允許被右邊擠壓 */
}

#sidebar h3 {
    font-size: 18px;
    color: #000;
    margin-bottom: 12px;
    font-weight: bold;
}
.table1 {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e0e0e0;
}

.table1 td {
    padding: 12px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

.table1 td a {
    color: #333;
    display: block;
    width: 100%;
}

.table1 td a:hover {
    color: #ff6900;
}
/* 右側複合內容載體 */
.content-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 40px; /* 將上、中、下三層區域自然撐開，絕不重疊 */
}

/* ==========================================
   6. 各區域細部調校 (輪播圖、Tabs、產品欄)
   ========================================== */

/* 上層：Banner 輪播與右邊小圖並排 */
.top-content-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

#content {
    flex-grow: 1;
    min-width: 0; /* 防止入面圖片太闊撐爆層板 */
}

.effects-products-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
#content1 {
    width: 80%; /* 100% 寬度，徹底擺脫左邊 Sidebar 影響 */
    clear: both; /* 雙重保險：清除所有舊有浮動干擾 */
    display: block;
}
#content2 {
    width: 100%; /* 100% 寬度，徹底擺脫左邊 Sidebar 影響 */
    clear: both; /* 雙重保險：清除所有舊有浮動干擾 */
    display: block;
}
.slider-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f0f0f0;
}

.mySlides {
    width: 100%;
    height: 400px;
    object-fit: cover; /* 確保輪播相片不變形 */
    display: none;
}

/* 輪播左右按鈕 */
.test {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    color: #fff;
    background-color: rgba(0,0,0,0.6);
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 5;
}
.test:hover { background-color: #ff6900; color: #000; }
.prev-btn { left: 10px; }
.next-btn { right: 10px; }

/* 右側置頂海報 */
.minpic-wrapper {
    width: 250px;
    flex-shrink: 0;
}
#minpic {
    width: 100%;
    height: auto;
    border: 1px solid #ddd;
}

/* 中層：Tab 分類切換按鈕 */
.tab-menu {
	width: 500px;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.tab-btn {
    font-size: 16px;
    font-weight: bold;
    color: #999999;
    margin-right: 15px;
    display: inline-block;
}
.tab-btn:hover {
    color: #000000;
}

/* New Arrival 標題 */
.section-title {
    font-size: 20px;
    border-left: 4px solid #ff6900;
    padding-left: 10px;
    margin-bottom: 20px;
    font-weight: bold;
}
/* 下層與通用的產品格標題設定 */
h1 { font-size: 15px; color: #333; margin-top: 8px; font-weight: bold;}
h2 { font-size: 14px; color: #666; margin-bottom: 5px;}


/* ==========================================
   7. 產品表格規範化 (Tables & Images)
   ========================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table2, .table3 {
    width: 100%;
    border-collapse: collapse;
}

.table2, .table3 {
    width: 100%;
    border-collapse: collapse;
}

.table2 td, .table3 td {
    padding: 15px;
    border: 1px solid #eee;
    text-align: center;
    vertical-align: top;
    width: 25%; /* 橫向一排四格，非常標準 */
    background: #ffffff;
}
/* 固定舊網頁中亂填寬高的產品圖片，改用標準比例縮放 */
.prod-img-square { width: 120px; height: 120px; object-fit: contain; }
.prod-img-tall   { width: 110px; height: 180px; object-fit: contain; }
.prod-img-wide   { width: 160px; height: 100px; object-fit: contain; }

/* ==========================================
   8. 頁腳區
   ========================================== */
#lowbar {
    text-align: center;
    margin-top: 50px;
    padding: 20px 0;
    border-top: 1px solid #eee;
}
#lowbar a { color: #333; }
#lowbar a:hover { color: #ff6900; }

#footer {
    text-align: center;
    padding-bottom: 30px;
    color: #999;
    font-size: 13px;
}

/* ==========================================
   📱 9. RWD 手機版自動變形響應式彈性處理
   ========================================== */
@media (max-width: 992px) {
    .top-content-row {
        flex-direction: column;
    }
    #content, .minpic-wrapper {
        max-width: 100%;
        width: 100%;
    }
    .table2 td, .table3 td {
        width: 50%; /* 中螢幕改為兩欄一橫排 */
    }
}

@media (max-width: 768px) {
    /* 手機版時，上半身也變成上下直排，Sidebar 放最頂 */
    .top-content-layer {
        flex-direction: column;
    }
    #sidebar {
        width: 100%;
    }
    .table2 td, .table3 td {
        display: block;
        width: 100%; /* 手機版自動變一格一行，方便睇 */
    }
}