/* --- 商品分類選單總體樣式 --- */
.side-menu-container { 
    background: #fff; border: 1px solid #eee; border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow: hidden; margin-bottom: 20px; 
}
.side-menu-title { 
    background: #87b22f; color: #fff; padding: 15px; font-weight: 700; 
    font-size: 18px; margin: 0; display: flex; align-items: center; 
    cursor: pointer; justify-content: space-between;
}
.side-menu-title i { margin-right: 10px; }

/* 大類按鈕 */
.menu-item-group { border-bottom: 1px solid #f5f5f5; }
.kind-btn { 
    width: 100%; text-align: left; border: none; background: #fff; padding: 12px 15px;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 15px; color: #444; font-weight: 600; transition: all 0.3s; cursor: pointer;
}
.kind-btn:hover { background: #f9f9f9; color: #87b22f; }
.kind-btn.active { background: #87b22f; color: #fff; }

/* 子類列表 */
.sub-menu-list { background: #fcfcfc; display: none; padding: 5px 0; }
.sub-menu-list.show { display: block; }
.sub-item { 
    display: block; padding: 10px 15px 10px 35px; font-size: 14px; 
    color: #666; text-decoration: none; position: relative; transition: 0.2s;
}
.sub-item:before { content: '•'; position: absolute; left: 20px; color: #ccc; }
.sub-item.active { background: #f0f7e6; color: #87b22f; font-weight: 700; border-left: 4px solid #87b22f; padding-left: 31px; }

/* --- 產品列表對齊與圖片等比例核心 --- */
.product-row { display: flex; flex-wrap: wrap; margin: 0 -15px; }
.product-item-container { display: flex; flex-direction: column; margin-bottom: 30px; padding: 0 15px; }
.portfolio-item { 
    background: #fff; border: 1px solid #eee; border-radius: 5px; 
    height: 100%; display: flex; flex-direction: column; transition: 0.3s; overflow: hidden;
}
.portfolio-item:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

/* 圖片正方形比例容器 */
.img-wrapper { 
    width: 100%; position: relative; padding-top: 100%; /* 1:1 比例 */
    background: #fff; flex-shrink: 0; border-bottom: 1px solid #f5f5f5;
}
.product-img-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: contain; background-position: center; background-repeat: no-repeat;
}

figcaption { 
    padding: 15px; flex-grow: 1; display: flex; align-items: center; 
    justify-content: center; text-align: center; height: 90px;
}
figcaption h4 { 
    margin: 0; font-size: 16px; line-height: 1.4; 
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* --- 手機版 RWD 優化 --- */
@media (max-width: 1000px) {
    .side-menu-container { margin: 10px 15px; border: 2px solid #87b22f; }
    .side-menu-title::after {
        content: '\f078'; font-family: "Font Awesome 6 Free"; font-weight: 900;
        font-size: 14px; transition: transform 0.3s;
    }
    .side-menu-container.is-active .side-menu-title::after { transform: rotate(180deg); }
    .side-menu-body { display: none; max-height: 55vh; overflow-y: auto; }
    .side-menu-container.is-active .side-menu-body { display: block; }
    
    /* 手機版產品間距縮小 */
    .product-row { margin: 0 -5px; }
    .product-item-container { padding: 0 5px 15px 5px; }
    figcaption { height: 75px; }
    figcaption h4 { font-size: 14px; }
}