﻿@charset "UTF-8";

@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700;800;900&display=swap");


/* =====================================================
   01. Base
===================================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        "Noto Sans TC",
        "Microsoft JhengHei",
        Arial,
        sans-serif;

    color: #252525;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}


/* =====================================================
   02. Header
===================================================== */

.header {
    width: 100%;
    height: 50px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: calc(100% - 40px);
    height: 50px;
    margin: 0 auto;
}


/* Logo */

.logo img {
    display: block;

    width: auto;
    height: 40px;

    float: left;

    margin-right: 10px;
}


/* =====================================================
   03. 活動選單
===================================================== */
/* 橫式 */
.event-nav {
    position: sticky;

    top: 0;

    z-index: 999;

    width: 100%;

    background: #eef6fb;

    border-bottom: 1px solid #dbeaf3;

    box-shadow: 0 3px 12px rgba(0, 0, 0, .10);
}

.event-nav-inner {
    width: min(1200px, 95%);

    margin: 0 auto;
    padding: 12px 0;
}

.event-nav-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;

    gap: 8px;
}


/* 第一排 */

.event-nav-main {
    margin-bottom: 9px;
}

.event-nav-main a {
    display: block;

    padding: 8px 15px;

    background: #19568d;
    color: #fff;

    border-radius: 20px;

    font-size: 15px;
    font-weight: bold;

    transition: .2s;
}

.event-nav-main a:hover {
    background: #0c3d69;

    transform: translateY(-2px);
}
.event-nav-main a.active {
    background: #0c3d69;
}

/* 第二排 */

.event-nav-sub a {
    display: block;

    padding: 7px 17px;

    background: #f4c64d;
    color: #333;

    border-radius: 20px;

    font-size: 15px;
    font-weight: bold;

    transition: .2s;
}

.event-nav-sub a:hover {
    background: #efa900;

    transform: translateY(-2px);
}


.event-nav-sub a.active {
    background: #efa900;
}


/* 右側 */
.side-menu {
    position: fixed;

    right: 12px;
    left: auto;
    top: 300px;

    z-index: 900;

    display: flex;
    flex-direction: column;

    gap: 9px;

    width: 110px;

        transition:
        right .3s ease,
        transform .2s ease;
        
}
body.cart-open .side-menu {
    right: 370px;
    z-index: 2600;
}

.side-menu a {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 44px;

    padding: 10px 12px 10px 28px;

    background: rgba(255, 255, 255, .94);

    border: 1px solid rgba(23, 61, 114, .15);
    border-radius: 22px;

    color: #173d72;

    font-size: 14px;
    font-weight: 700;

    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);

    transition:
        transform .2s ease,
        background .2s ease,
        color .2s ease;
}


/* 側黃色圓點 */

.side-menu a::before {
    content: "";

    position: absolute;

    top: 50%;
    left: 12px;

    width: 8px;
    height: 8px;

    background: #f3b900;
    border-radius: 50%;

    transform: translateY(-50%);
}

.side-menu a:hover {
    background: #173d72;
    color: #fff;

    transform: translateX(5px);
}

.side-menu a:hover::before {
    background: #ffd94f;
}

/* =====================================================
   03. 電腦版右側購物車按鈕
===================================================== */

.floating-cart-btn {
    position: fixed;

    top: 5%;
    right: 0;

    z-index: 1500;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 5px;

    min-width: 92px;

    padding: 18px 9px;

    border: 0;
    border-radius: 12px 0 0 12px;

    background: #173d72;
    color: #fff;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;

    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);

    cursor: pointer;

    transform: translateY(-50%);

    transition: background .2s ease;
}

.floating-cart-btn:hover {
    background: #24558b;
}

.cart-icon {
    font-size: 22px;
}

.cart-count {
    color: #ffd84d;
    font-size: 13px;
}


/* =====================================================
   04. Hero 共用結構
   ※ 高度、背景、圖片大小放到活動 CSS
===================================================== */

.hero {
    position: relative;

    width: 100%;
    margin: 0 auto;

    overflow: hidden;

    text-align: center;
}

.hero-title {
    position: absolute;

    height: auto;
}

.hero_m {
    display: none;
}


/* =====================================================
   05. Main 共用結構
===================================================== */

.main-content {
    width: 100%;
    margin: 0 auto;

    padding: 35px 0 20px;
}

.page-section {
    width: min(1500px, calc(100% - 50px));
    margin: 0 auto;
}

.group {
    width: min(1200px, 100%);

    margin: 60px auto;

    scroll-margin-top: 10px;
}

.group:first-child {
    margin-top: 0;
}

.group:last-child {
    margin-bottom: 0;
}


/* =====================================================
   06. Section Title 共用結構
   ※ 顏色放活動 CSS
===================================================== */

.section-title {
    display: flex;
    align-items: center;

    gap: 12px;

    margin-bottom: 25px;

    font-size: 28px;
    font-weight: 900;
}

.section-title::before {
    content: "";

    width: 7px;
    height: 30px;

    border-radius: 10px;
}


/* =====================================================
   07. 共用內容區
===================================================== */

.content-panel {
    width: min(1150px, 100%);

    margin: 0 auto;
    padding: 10px 0;
}


/* =====================================================
   08. 商品列表
===================================================== */

.book-grid {
    display: grid;

    grid-template-columns: repeat(5, 1fr);

    gap: 20px;
}

.book-item {
    margin: 0;

    padding: 0 10px 15px;

    text-align: center;

    box-shadow:
        0 8px 28px rgba(0, 0, 0, .08);
}

.book-item img {
    display: block;

    width: 100%;

    aspect-ratio: 1 / 1;

    padding: 15px;

    object-fit: contain;

    transition: .25s;
}

.book-item figcaption {
    display: -webkit-box;

    min-height: 50px;

    margin: 0 0 5px;

    overflow: hidden;

    font-size: .95rem;
    font-weight: 600;
    line-height: 1.45;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    align-content: center;
}


/* =====================================================
   09. 價格
===================================================== */

.price {
    margin-bottom: 3px;
}

.price strong {
    margin-bottom: 8px;
    padding-right: 5px;

    color: #e33c39;

    font-size: .935rem;
    font-weight: 500;
}

.price span {
    color: #6c7b8d;

    font-size: 13px;
}


/* =====================================================
   10. 一般購買按鈕
===================================================== */

.buy-btn {
    display: inline-block;

    margin-top: 10px;
    padding: 5px 10px;

    background: #2f8cf0;

    border-radius: 8px;

    color: #fff;

    font-size: .9rem;
    font-weight: 700;

    text-align: center;

    transition: background .25s ease;
}

.buy-btn:hover {
    background: #c92529;
    color: #fff;
}


/* =====================================================
   11. 購物車側欄
===================================================== */

.cart-panel {
    position: fixed;

    top: 0;
    right: -420px;

    z-index: 3000;

    display: flex;
    flex-direction: column;

    width: 350px;
    max-width: 90vw;
    height: 100vh;

    background: #fff;

    box-shadow: -5px 0 25px rgba(0, 0, 0, .18);

    transition: right .3s ease;
}

.cart-panel.open {
    right: 0;
}


/* 購物車 Header */

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 12px 20px;

    background: #2376d8;
    color: #fff;
}

.cart-title {
    font-size: 18px;
    font-weight: 800;
}

.qty {
    margin-left: 5px;

    color: #ffd43b;
}

.cart-close {
    width: 35px;
    height: 35px;

    padding: 0;

    border: 0;

    background: none;
    color: #fff;

    font-size: 30px;
    line-height: 1;

    cursor: pointer;
}


/* =====================================================
   12. 購物車商品列表
===================================================== */

.cart-content {
    flex: 1;

    overflow-y: auto;

    padding: 10px;
}

.cart-list {
    width: 100%;
}

.cart-item {
    display: grid;

    grid-template-columns: 30px 60px 1fr;

    align-items: center;

    gap: 12px;

    padding: 12px 0;

    border-bottom: 1px solid #ddd;
}

.cart-no {
    color: #999;

    font-size: 13px;

    text-align: center;
}

.cart-item-image {
    display: block;

    width: 60px;
    height: 60px;

    object-fit: cover;

    border: 1px solid #eee;
}

.cart-item-info {
    min-width: 0;
}

.cart-item-category {
    margin-bottom: 3px;

    color: #999;

    font-size: 12px;
}

.cart-item-name {
    color: #333;

    font-size: 15px;
    font-weight: 700;
}

.cart-item-price {
    margin-top: 10px;

    color: #e36b26;

    font-size: 15px;
    font-weight: 800;
}


/* =====================================================
   13. 結帳
===================================================== */

.checkout-area {
    padding: 15px 20px;

    border-top: 1px solid #ddd;
}

.cart-checkout-btn {
    display: block;

    width: 100%;

    padding: 13px;

    background: #ef762c;

    border-radius: 4px;

    color: #fff;

    font-size: 16px;
    font-weight: 800;

    text-align: center;
}


/* =====================================================
   14. 購物車注意事項
===================================================== */

.event-notice {
    padding: 10px 20px;

    color: #777;

    font-size: 12px;
    line-height: 1.7;
}

.event-notice strong {
    display: block;

    margin-bottom: 4px;

    color: #555;
}

.event-notice p {
    margin: 0;
}


/* =====================================================
   15. 購物車遮罩
===================================================== */

.cart-overlay {
    position: fixed;

    inset: 0;

    z-index: 2500;

    visibility: hidden;

    opacity: 0;

    background: rgba(0, 0, 0, .35);

    transition:
        opacity .3s ease,
        visibility .3s ease;
}

.cart-overlay.show {
    visibility: visible;
    opacity: 1;
}


/* 手機底部購物車，PC 隱藏 */

.mobile-cart-bar {
    display: none;
}


/* =====================================================
   16. 回頂端
===================================================== */

#TOP {
    position: fixed;

    right: 10px;
    bottom: 50px;

    z-index: 9;

    display: none;

    width: 60px;
    height: 60px;

    border-radius: 50%;

    opacity: .65;

    text-align: center;

    box-shadow:
        rgba(60, 64, 67, .3) 0 1px 2px 0,
        rgba(60, 64, 67, .15) 0 2px 6px 2px;

    transition: opacity .5s ease;
}

.material-symbols-outlined {
    padding-top: 3px;

    font-size: 2.5rem;
}


/* =====================================================
   17. 頁碼
===================================================== */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;

    gap: 8px;

    margin: 35px 0 0;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 40px;
    height: 40px;

    padding: 0 12px;

    border: 1px solid #dce5ef;
    border-radius: 9px;

    background: #fff;
    color: #607089;

    font-size: 14px;

    transition: .2s;
}

.page-btn:hover,
.page-btn.active {
    border-color: #2376d8;

    background: #2376d8;
    color: #fff;
}

.page-prev,
.page-next {
    min-width: auto;

    padding: 0 15px;
}

.page-dot {
    color: #8d9aac;

    font-size: 16px;
}


/* =====================================================
   18. Footer
===================================================== */

.site-footer {
    padding: 12px 20px;

    background: #37424b;
    color: #fff;

    text-align: center;
}

.site-footer p {
    margin: 0;

    font-size: 13px;
}


/* =====================================================
   19. Tablet
   769px ～ 1024px
===================================================== */

@media screen and (min-width: 769px) and (max-width: 1024px) {

    .header {
        width: 100%;
        height: 50px;
    }

    .main-content {
        width: calc(100% - 20px);
    }

    .hero {
        display: none;
    }

    .hero_m {
        display: block;
    }

    .hero_m img {
        width: 100%;
    }

    .hero_m .logo img {
        width: 230px;
        height: auto;

        margin: 8px 5px;
    }

    .book-grid {
        grid-template-columns: repeat(4, 1fr);

        gap: 20px;

        padding: 0;
    }

}


/* =====================================================
   20. Mobile
   768px 以下
===================================================== */

@media screen and (max-width: 768px) {

    body {
        padding-bottom: 60px;
        /*
        如果手機 fixed 有問題，
        可以改為：
        background-attachment: scroll;
        */
    }


   
    /* ---------------------------------
       Header
    --------------------------------- */

    .header {
        height: 54px;
    }

    .header-inner {
        width: calc(100% - 20px);
        height: 54px;
    }

    .logo img {
        height: 35px;
    }


    /* ---------------------------------
       隱藏電腦右側購物車按鈕
    --------------------------------- */

    .floating-cart-btn {
        display: none;
    }


    /* ---------------------------------
       手機底部導覽
    --------------------------------- */

    .side-menu {
        position: fixed;

        top: auto;
        right: 0;
        bottom: 58px;
        left: 0;


        z-index: 1900;

        display: flex;
        flex-direction: row;

        width: 100%;

        gap: 6px;

        padding: 8px 10px;

        overflow-x: auto;
        overflow-y: hidden;

        background: rgba(255, 255, 255, .96);

        border-top: 1px solid #eee;
        border-bottom: 1px solid #eee;

        box-shadow: 0 -2px 8px rgba(0, 0, 0, .06);

        scrollbar-width: none;

        -webkit-overflow-scrolling: touch;
    }
    body.cart-open .side-menu {
        right: 0;
    }
    .side-menu::-webkit-scrollbar {
        display: none;
    }

    .side-menu a {
        flex: 0 0 auto;

        min-height: 0;

        padding: 8px 13px;

        background: #fff;

        border: 1px solid #ddd;
        border-radius: 18px;

        color: #173d72;

        font-size: 13px;
        font-weight: 700;

        white-space: nowrap;

        box-shadow: none;
    }

    .side-menu a::before {
        display: none;
    }

    .side-menu a:hover {
        background: #fff;
        color: #173d72;

        transform: none;
    }


    /* ---------------------------------
       Hero
    --------------------------------- */


    .hero {
        display: none;
    }

    .hero_m {
        display: block;
    }

    .hero_m img {
        width: 100%;
    }

    .hero_m .logo img {
        width: 180px;
        height: auto;

        margin: 8px 5px;
    }



    /* ---------------------------------
       Main
    --------------------------------- */
    
    
    .main-content {
        width: calc(100%);
        
    }

    .page-section {
        margin: 0 auto;

        scroll-margin-top: 80px;
    }

    .section-title {
        margin-bottom: -10px;
    }

    .content-panel {
        width: 100%;

        padding: 30px 5px;

        border-radius: 10px;
    }


    /* ---------------------------------
       Books
    --------------------------------- */

    .book-grid {
        grid-template-columns: repeat(2, 1fr);

        gap: 20px;

        padding: 0;
    }

    .book-item {
        padding: 10px 5px;
    }

    .book-item img {
        padding: 0;
    }

    .book-item figcaption {
        font-size: .9rem;
    }

    .price strong,
    .price span {
        display: block;
    }


    /* ---------------------------------
       手機底部購物車列
    --------------------------------- */

    .mobile-cart-bar {
        position: fixed;

        right: 0;
        bottom: 0;
        left: 0;

        z-index: 2000;

        display: flex;
        align-items: center;
        justify-content: space-between;

        width: 100%;
        height: 58px;

        padding: 0 12px 0 18px;

        background: #fff;

        border-top: 1px solid #ddd;

        box-shadow: 0 -3px 12px rgba(0, 0, 0, .12);
    }

    .mobile-cart-info {
        color: #444;

        font-size: 14px;
        font-weight: 500;
    }

    .mobile-cart-info strong {
        margin: 0 3px;

        color: #e76524;

        font-size: 18px;
        font-weight: 800;
    }

    .mobile-cart-btn {
        display: flex;
        align-items: center;

        gap: 7px;

        padding: 9px 15px;

        background: #173d72;

        border: 0;
        border-radius: 4px;

        color: #fff;

        font-family: inherit;
        font-size: 14px;
        font-weight: 700;

        cursor: pointer;
    }

    .cart-arrow {
        font-size: 21px;
        line-height: 1;
    }


    /* ---------------------------------
       手機購物車由左側滑出
    --------------------------------- */

    .cart-panel {
        right: auto;
        left: -100%;

        width: min(88vw, 340px);
        max-width: none;

        height: 100vh;
        max-height: 100dvh;

        padding-bottom: 60px;

        box-shadow: 5px 0 25px rgba(0, 0, 0, .2);

        transition: left .3s ease;
    }

    .cart-panel.open {
        right: auto;
        left: 0;
    }


    /* 購物車打開時隱藏底部兩列 */
    body.cart-open .mobile-cart-bar,
    body.cart-open .side-menu {
        display: none;
    }

    /* ---------------------------------
       回頂端
    --------------------------------- */


    #TOP {
        width: 50px;
        height: 50px;

        bottom: 12%;
    }

    .material-symbols-outlined {
        padding-top: 0;

        font-size: 2rem;
    }


    /* Footer */

    .footer-contact {
        display: none;
    }

    .footer-copyright {
        margin: 0;

        font-size: 11px;
        line-height: 1.7;
    }

    .footer-en {
        display: none;
    }

    .footer-company {
        display: block;

        margin-bottom: 2px;

        font-size: 12px;
        font-weight: 600;
    }

    .footer-copy {
        display: block;

        color: rgba(255, 255, 255, .75);

        font-size: 10px;
    }

}