/* Reset 基礎設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基礎樣式 */
body {
    font-family: "Microsoft JhengHei", "微軟正黑體", sans-serif;
    background: #8a0a30 url(../images/bg.jpg);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

.ribbon {
    z-index: -1;
    position: absolute;
    max-width: 100%;
}

.ribbon:nth-child(1) {
    transform: scaleX(-1) translateY(80%);
    position: absolute;
    top: 0;
}

.ribbon:nth-child(2) {
    position: absolute;
    bottom: 5%;
    display: none;
}

.kv-container {
    position: relative;
    z-index: -1;
    width: 100%;
}


/* 容器設定 */
.wrap-container {
    font-family: "Noto Serif TC", "思源宋體", "Source Han Serif TC", "Microsoft JhengHei", "微軟正黑體", sans-serif;
    color: #fff;
    max-width: 1440px;
    margin: 3% auto 5%;
    line-height: 1.6;
}

/* 商品切換 */
.category-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: -10% auto 20px;
    max-width: 1000px;
}
.tab-btn {
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
    border: none;
    padding: 10px 18px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 10px;
    transition: 0.3s;
    color: #fff;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.tab-btn:hover {
    transform: translateY(-5px); /* 滑入上移 */
    background-color: #000; /* 視覺上可以微微變色，例如黑色 */
    color: #fff; /* 字體變白，反差明顯 */
}

.tab-btn.active {
    background-color: rgba(0, 0, 0, 1);
}

.wrap-content {
    display: none;
}

.wrap-content.active {
    display: block;
}

/* 頁首設定 */
.header {
    text-align: center;
    margin-bottom: 100px;
    padding: 0 20px;
}

.gift-package-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column; /* 垂直排列：文字在上，按鈕在下 */
    justify-content: space-around;
    margin: 20px 0;
    gap: 2rem;
}

.gift-package {
    position: relative; /* 使伪元素相对于父元素定位 */
    display: flex; /* 加上這一行讓內容左右排列 */
    flex-direction: row; /* 預設就是 row，不寫也行 */
    background: url(../images/box_bg.png); /* 中间部分的背景 */
    background-size: contain; /* 确保背景图像适应 */
    background-repeat: repeat; /* 重复背景图像 */
    width: 70%;
    margin: auto;
    box-shadow: 0 10px 100px rgba(0, 0, 0, 0.3); /* 添加阴影效果 */
}

.gift-package::before,
.gift-package::after {
    content: ""; /* 必须设置 content 属性 */
    position: absolute; /* 绝对定位 */
    width: 7%; /* 根据需要调整宽度 */
    height: 100%; /* 高度与父元素相同 */
    background-size: cover; /* 等比例拉伸背景 */
    background-repeat: no-repeat; /* 不重复背景图像 */
}

.gift-package::before {
    left: -7%; /* 左侧 */
    background-image: url(../images/box_left_bg.png); /* 左侧图案 */
}

.gift-package::after {
    right: -7%; /* 右侧 */
    background-image: url(../images/box_right_bg.png); /* 右侧图案 */
}

.gift-package:nth-child(even) {
    flex-direction: row-reverse; /* 對於奇數項，反轉排列 */
}

.gift-package img {
    width: 45%;
    padding: 10% 0 10% 0;
    object-fit: cover;
    margin: auto;
    height: auto;
}

.gift-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 35%;
    margin: auto;
    text-align: center;
}

.gift-info h2 {
    font-size: clamp(10px, 1.15vw, 16px);
    font-weight: 300;
    line-height: 1.5;
    color: #fff;
    letter-spacing: 0;
    background-clip: text;
    -webkit-background-clip: text;
}

.gift-info p {
    font-size: clamp(20px, 2.2vw, 36px);
    font-weight: bolder;
    line-height: 1.2;
    margin: 0.5vw 0 1.2vw;
    color: transparent;
    background: linear-gradient(to bottom, #F4CB8B 0%, #F4CB8B 40%, #fff 50%, #F4CB8B 60%, #F4CB8B 100%);
    background-clip: text;
    -webkit-background-clip: text;
}

.gift-info span {
    font-size: clamp(12px, 1vw, 26px);
    font-weight: 100;
    line-height: 1.2;
    margin: 0.5vw 0 1.2vw;
    color: #fff;
}

.shop-now {
    position: relative; /* 使伪元素相对于按钮定位 */
    font-size: clamp(13px, 2.4vw, 20px); /* 最小18px，最大25px */
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    display: inline-block;
    padding: clamp(5px, 0.8vw, 8px) clamp(20px, 5vw, 40px); /* 上下內邊距最小5px，最大10px；左右內邊距最小20px，最大40px */
    background-color: #000; /* 按钮背景颜色 */
    color: #fff; /* 按钮文字颜色 */
    text-decoration: none; /* 去掉下划线 */
    border-radius: 10px; /* 圆角 */
    overflow: hidden; /* 隐藏溢出部分 */
}

.shop-now::before {
    content: ""; /* 必须设置 content 属性 */
    position: absolute; /* 绝对定位 */
    top: 0;
    left: -100%; /* 从左侧开始 */
    width: 100%; /* 覆盖整个按钮 */
    height: 100%; /* 高度与按钮相同 */
    background: rgba(255, 255, 255, 0.7); /* 光泽颜色 */
    transition: left 0.5s ease; /* 动画过渡效果 */
    transform: rotate(45deg);
}

.shop-now:hover::before {
    left: 100%; /* 鼠标移入时移动到右侧 */
}

.pc,
.mobile {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* 預設隱藏手機版圖片 */
.mobile {
    display: none;
}


/* RWD 斷點設定 */

@media screen and (max-width: 1024px) {
    .category-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 三欄 */
        gap: 10px;
        padding: 0 12px;
        width: 90%; /* 確保寬度不會超出 */
        box-sizing: border-box;
    }
    
    .gift-info {
        padding: 5% 3%;
    }

    .gift-package {
        width: 80%;
    }
    .ribbon {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    .wrap-container {
        margin-top: 6%;
        padding: 0 10px;
    }

    .category-tabs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin: 0 auto;
        padding: 0 10px;
    }

    .tab-btn {
        padding: 8px 14px;
        font-size: 2.8vw;
        border-radius: 20px;
    }

    .tab-btn:hover {
        transform: inherit
    }

    .header {
        margin-bottom: 40px;
    }

    .gift-package-container {
        gap: 2.5vw;
    }

    .gift-info {
        width: 100%;
        padding: 0 15%;
        margin-top: 5%;
        transform:scale(1.2);
    }
    
    .gift-package {
        flex-direction: column;
        position: relative;
        width: 90%;
        padding: 15% 0;
        background: url(../images/box_bg_m.png);
        background-size: contain;
        background-repeat: repeat;
    }

    .gift-package::before,
    .gift-package::after {
        display: none;
    }

    .gift-package:nth-child(even) {
        flex-direction: inherit;
    }

    .gift-package img {
        width: 100%;
        padding: 0 5%;
    }

    .shop-now {
        margin-top: 2%;
    }
    
    /* 小螢幕顯示手機版圖片，隱藏電腦版圖片 */
    .pc {
        display: none;
    }
    
    .mobile {
        display: block;
    }
}

@media screen and (max-width: 480px) {
    .wrap-container {
        margin-top: 0;
        padding: 0 8px;
    }

    .category-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 三欄 */
        gap: 3px;
        padding: 0 10px;
        width: 100%; /* 確保寬度不會超出 */
        box-sizing: border-box;
    }

    .tab-btn {
        width: 100%;
        max-width: 150px; /* 每個按鈕最大寬度 */
        font-size: 14px;
        padding: 10px 8px;
        border-radius: 10px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; /* 如果文字太長，顯示省略號 */
    }
    .gift-package-container {
        gap: 2.5vw;
    }
    .gift-package {
        width: 95%;

        margin: auto;
    }

    .gift-package img {
        width: 100%;
        height: auto;
    }

    .gift-info {
        transform: scale(1.1);
        margin-top: 5%;
    }

}