/* ===== 背景色 ===== */
.background{overflow: hidden; background:#feb100;}

.category-section {
    align-content: center;
    display: flex;
    justify-content: center;
}

/* 1. Grid 排版：桌面 3 欄、平板 2 欄、手機 1 欄 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2vw;         /* 欄間距 */
    padding: 0 2vw;
    margin-top: 2.5vw;
    width: 100%;
    box-sizing: border-box;
    .category-section nav {
        margin-bottom: 0;
    }
}



/* 2. 進場動畫 + 延遲效果 */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.category-item {
    text-align: center;
    opacity: 0;
    animation: fadeInUp 0.5s forwards ease-out;
    color: #000000;         /* 繼承父層文字色 */
    text-decoration: none;  /* 去掉底線 */
}
/* 每列三個，依序給不同延遲 */
.category-item:nth-child(3n+1) { 
    animation-delay: 0.1s; 
    /* margin-right:10px; */
}
.category-item:nth-child(3n+2) { animation-delay: 0.2s; }
.category-item:nth-child(3n)   { 
    animation-delay: 0.3s; 
}

/* 3. 卡片樣式 - 以1920px為基準等比例縮放 */
.category-item {
    background: linear-gradient(180deg, #08779c 0%, #003c50 100%);
    border-radius: 0.78vw; /* 15px / 1920 * 100 */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 32.5vw; /* 600px / 1920 * 100 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-top: 2.5vw;
}
.category-item:hover {
    transform: translateY(-0.26vw); /* -5px */
    box-shadow: 0 0.42vw 1.04vw rgba(0, 0, 0, 0.15);
}

/* 圖片容器 - 上半部 (正方形) */
.item-image-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* 1:1 正方形 */
    background-color: #fff;
    box-sizing: border-box;
}
/* 圖片本體 */
.item-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.item-image-wrapper:hover .item-image {
    transform: scale(1.05);
}

/* 4. 文字樣式 - 下半部 */
.item-title {
    margin-top: 0;
    margin-bottom: 0.42vw; /* 8px */
    padding: 0.78vw 0.78vw 0 0.78vw; /* 15px */
    font-size: 1.77vw; /* 34px / 1920 * 100 */
    font-weight: bold;
    font-stretch: normal;
    font-style: normal;
    line-height: 2;
    letter-spacing: 0.06vw; /* 1.13px */
    text-align: center;
    color: #fff;
}
.item-title.sub {
    margin-top: 0;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: ellipsis;
    white-space: normal;
}
.item-description {
    margin-top: 0;
    padding: 0 1.56vw 1.56vw 1.56vw; /* 30px */
    font-size: 1.15vw; /* 22px / 1920 * 100 */
    font-weight: normal;
    font-stretch: normal;
    font-style: normal;
    line-height: 1.6;
    text-align: justify;
    color: #fff;
    display: -webkit-box;
    overflow: hidden;
    /* -webkit-box-orient: vertical; */
    -webkit-line-clamp: 4;
    text-overflow: ellipsis;
    white-space: normal;
}

.product-grid{
    display: grid;
    grid-template-columns: 3fr 6fr;
    /* gap: 1vw; */
}

.subnav .list-group {
    background: linear-gradient(180deg, #026d91 0%, #026d91 40%,  #003c50 70%, #003c50 100%);
    padding: 2vw 0.4vw !important;
    display: flex;
    flex-direction: column;
    /* gap: 10px; */
    border-radius: 10px;
}

.subnav .list-group a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 4.6vw;
    font-size: 1.67vw; /* 32px / 1920 * 100 */
    font-weight: normal;
    line-height: 1.39;
    color: #ffffff;
    background-color: transparent;
    border: none;
    padding: 0 0.78vw; /* 15px */
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    position: relative;
    font-stretch: normal;
    font-style: normal;
    letter-spacing: 0.1vw; /* 1.83px */
}

.subnav .list-group a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 0.1vw;
    background-color: #ffffff;
}

.subnav .list-group a:last-child::after {
    display: none;
}

.subnav .list-group a:hover {
    color: #feb100;
}

.subnav .list-group a.active {
    color: #feb100;
}

.cards-grid{
    display: grid;
    gap: 1.56vw; /* 30px */
}

/* ── 單張卡片 - 以1920px為基準等比例縮放 ── */
.product-card{
    padding: 0.89vw 1.3vw 3.39vw 1.35vw; /* 17px 25px 65px 26px */
    transition: transform .25s, box-shadow .25s;
    width: 14.06vw; /* 270px */
    height: 17.19vw; /* 330px */
    border: none;
    background: #fff;
    border-radius: 0.52vw; /* 10px */
}
.product-card:hover{
    transform: translateY(-0.31vw); /* -6px */
    box-shadow: 0 0.31vw 0.83vw rgba(255,255,255,.12);
}
.product-card img {
    width: 11.41vw; /* 219px */
    height: 11.41vw; /* 219px */
}
.ratio{
    border-radius: 0.42vw; /* 8px */
}
.card-img-top{
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .35s;
}
.product-card:hover .card-img-top{
    transform: scale(1.08);
}
.card-body h3{
    color: #0f2331;
    font-size: 1.04vw; /* 20px */
}

/* ── 分頁 - 以1920px為基準等比例縮放 ── */
.pagination-nav {
    margin-top: 4.69vw; /* 90px */
    margin-bottom: 5.05vw; /* 97px */
    align-content: center;
    display: flex;
    justify-content: center;
    width: 100%;
    clear: both;
    text-align: center;
}
.pagination .page-link {
    color: #6c757d;
    background-color: #f8f9fa;
    border: 0.05vw solid #dee2e6; /* 1px */
    font-weight: 500;
    font-size: 0.83vw; /* 16px */
    height: 2.45vw; /* 47px */
    width: 2.14vw; /* 41px */
    line-height: 2.34vw; /* 45px */
    border-radius: 0 !important;
    padding: 0;
    text-align: center;
}

/* 2. 滑鼠移過（非 active 頁碼）*/
.pagination .page-item:not(.active):hover .page-link {
    color: #007396;
    border-color: #007396;
    background-color: #fff;
    height: 2.45vw; /* 47px */
    width: 2.14vw; /* 41px */
    line-height: 2.34vw; /* 45px */
    border-radius: 0 !important;
    padding: 0;
}

/* 3. 已選定頁碼（active）*/
.pagination .page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: #007396;
    border-color: #007396;
    height: 2.45vw; /* 47px */
    width: 2.14vw; /* 41px */
    line-height: 2.34vw; /* 45px */
    border-radius: 0 !important;
    padding: 0;
}

/* 4. 如果想調整邊框厚度，可額外覆寫 border-width */
.pagination .page-item:not(.active):hover .page-link,
.pagination .page-item.active .page-link {
    height: 2.45vw; /* 47px */
}

/* 無商品提示 - 以1920px為基準等比例縮放 */
.no-product {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 15.63vw; /* 300px */
    font-size: 1.25vw; /* 24px */
    font-weight: bold;
    color: #ffffff;
    border-radius: 0.52vw; /* 10px */
    margin: 3vw 2vw;
    padding: 2vw;
    text-align: center;
}

/* 無分類提示 - 以1920px為基準等比例縮放 */
.no-category {
    display: block;
    padding: 2vw 1vw;
    font-size: 1.04vw; /* 20px */
    color: #ffffff;
    text-align: center;
}


