﻿/* style.css */

/* ========== 原本的全域設定 ========== */
html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    margin: 0;
    font-size: var(--font-size-base);
}

main {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* ✅ 從這裡直接開始，不需要定義變數 ✅ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Serif TC', serif;
}

body {
    background-color: var(--light-color);
    color: var(--brown-color);
    line-height: 1.6;
}

/* 通用卡片樣式 */
.card {
    background: var(--light-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.container {
    width: 90%;
    max-width: 1500px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* 輪播 Banner 樣式 */
.carousel {
    position: relative;
    height: 70vh;
    overflow: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}

.carousel-inner {
    height: 100%;
    width: 300%;
    display: flex;
    transition: transform 0.6s ease;
    max-width: none !important;
}

.carousel-item {
    height: 100%;
    width: 33.333%;
    position: relative;
}

.carousel-item video,
.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

    .carousel-text h2 {
        font-size: var(--font-size-xlarge);
        margin-bottom: var(--spacing-unit);
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    }

.carousel-text p {
    font-size: 1.2rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background-color: white;
    width: 25px;
    border-radius: 10px;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: white;
    background-color: rgba(0, 0, 0, 0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-control:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.carousel-control-prev {
    left: 20px;
}

.carousel-control-next {
    right: 20px;
}

.form-actions {
    display: flex; /* 讓按鈕同一行 */
    gap: 15px; /* 按鈕間距 */
    justify-content: center; /* 水平置中 */
    margin-top: 20px; /* 上方間距 */
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 1.5rem;
}

.submit-btn {
    flex: 2 !important;
}

.form-actions .btn {
    padding: 0.8rem;
    font-size: 1rem;
    height: 48px;
    border: none;
    box-sizing: border-box;
    line-height: 1;
    margin: 0;
    vertical-align: top;
    display: flex;
    align-items: center;
    justify-content: center;
}



.view-order-btn {
    flex: 1;
    background-color: #888;
}

    .view-order-btn:hover {
        background-color: #666;
    }

 /*特色區塊*/ 
.features {
    padding: 4rem 0;
    background-color: white;
}

.section-title {
    font-family: 'Cinzel', 'Noto Serif TC', serif;
    text-align: center;
    font-size: var(--font-size-large);
    font-weight: 400;
    letter-spacing: 0.1em;
    color: #5C4033;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.05);
}

    .section-title:after {
        content: '';
        display: block;
        width: 120px;
        height: 2px;
        background: linear-gradient(90deg, transparent, #FF8C42, transparent);
        margin: 1.5rem auto 0;
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
    }
 /*輪播容器 */
.features-carousel {
    position: relative;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    overflow: hidden;
    padding: 1rem 6rem;
}
.feature-card:hover {
    transform: translateY(-15px); /* 往上移更多 */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* 加上更深的陰影 */
}
.feature-card .feature-img {
    height: 200px;
    width: 100%;
    overflow: hidden;
}

    .feature-card .feature-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 1s ease; /* 平滑過渡動畫 */
    }
.feature-card:hover .feature-img img {
    transform: scale(1.1); /* 放大到1.1倍 */
}
.feature-content {
    padding: 1.5rem;
}

    .feature-content h3 {
        font-size: var(--font-size-medium);
        margin-bottom: 0.8rem;
        color: #ff6b35;
    }

 /*控制按鈕 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
    opacity: 0; /* 預設隱藏 */
    transition: opacity 0.3s ease; /* 淡入淡出效果 */
}
/* 滑鼠移到輪播容器時顯示箭頭 */
.features-carousel:hover .carousel-btn {
    opacity: 1; 
}
.prev-btn { 
    left: -70px; 
}

.next-btn { 
    right: -70px; 
}

/* 響應式顯示幾張 */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr); /* 手機顯示2張 */
    }
    .features-grid {
        padding: 1rem 1rem;
    }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr; /* 小手機顯示1張 */
    }
}

@media (min-width: 1200px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr);/*  大螢幕顯示4張 */
    }
}
/* 特色區塊 最新商品 滑動出現動畫 */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }


/* 最新商品區塊 */
.products {
    padding: 6rem 6rem;
    background-color: var(--light-color);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.product-card {
    position: relative;
    display: flex;
    flex-direction: column; 
}
/* 商品卡片 */
.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 8px;
    /*box-shadow: 0 2px 6px rgba(0,0,0,0.1);*/
    overflow: hidden;
    transition: transform 0.2s ease;
}

/*    .product-card:hover {
        transform: translateY(-5px);
    }*/

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.product-img {
    width: 100%;
    aspect-ratio: 3/2; 
   /* max-width: 300px; 
    height: auto;*/
    overflow: hidden;
    /*margin: 0 auto;*/
}

 .product-img img {
     width: 100%;
     height: 100%;
     object-fit: cover; 
     display: block;
 }

.product-content {
    padding: var(--spacing-unit);
    flex: 1; 
    display: flex; 
    flex-direction: column; 
}
/*之後後台限制10個字以內*/
.product-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.product-price {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.product-content p {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 最多2行來容納20字 */
    -webkit-box-orient: vertical;
    line-height: 1.4;
    height: 2.8em; 
}
.product-actions {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    margin-top: 1rem;
}

.product-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.product-hidden {
    display: none !important;
}
/* --------首頁商品詳情蓋板專用 CSS---------- */
#product-modal {
    display: none; 
    position: fixed;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: var(--spacing-unit);
}

    #product-modal .modal-content {
        background-color: var(--light-color);
        padding: 2rem;
        border-radius: 15px;
        width: 90%;
        max-width: 620px; /* 圖片 600 + 邊距 */
        position: relative;
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
        border-top: 5px solid var(--primary-color);
        animation: fadeInModal 0.3s ease-out;
        margin: 0 auto; 
    }


    #product-modal .product-image {
        position: relative;
        width: 100%; /* 讓圖片跟內容寬度一致 */
        height: auto;
        aspect-ratio: 3/2; /* 保持比例 */
        overflow: hidden;
        margin-bottom: 1rem;
    }

        #product-modal .product-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            border-radius: 8px;
        }

/* 響應式 */
/* 響應式 */
@media (max-width: 768px) {
    /* 調整卡片網格佈局 */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .products {
        padding: 1rem 1rem;
    }
    /* 縮小卡片內文字 */
    .product-card .product-title {
        font-size: 0.8rem;
    }

    .product-card .product-price {
        font-size: 0.8rem;
    }

    .product-card .product-content p {
        font-size: 0.7rem;
        line-height: 1.3;
        height: 2.6em;
    }

    /* 縮小卡片上的小按鈕 */
    .product-actions .btn {
        padding: 0.2rem 0.6rem;
        font-size: 0.85rem;
    }

    /* 產品詳情蓋板 (Product Modal) 調整 */
    #product-modal .modal-content {
        padding: 1.5rem;
    }

    #product-modal .product-header .name {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    /* 480px 以下進一步縮小字體 */
    .product-card .product-title {
        font-size: 0.95rem;
    }

    .product-card .product-price {
        font-size: 0.85rem;
    }

    .product-actions .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    /* 產品詳情蓋板 (Product Modal) 調整 */
    #product-modal .modal-content {
        padding: 1rem;
    }

/*    #product-modal .product-header .name {
        font-size: 1rem;
    }*/
}
/* ========== 熱門商品輪播功能 CSS ========== */

/* 讓 products 區塊可以定位圓點 */
.products {
    position: relative;
}

/* 商品網格 - 關鍵修復! */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 電腦版: 固定 4 欄 */
    gap: 1.5rem;
    position: relative;
    min-height: 650px; /* 重要!避免高度跳動 */
}

/* 隱藏「查看更多商品」按鈕(改用輪播)*/
#show-more-btn {
    display: none !important;
}

/* ========== 淡入淡出動畫 ========== */

/*.product-card {
    opacity: 1;*/
/*    transition: opacity 0.5s ease;*/
/*}

    .product-card.product-hidden {
        opacity: 0;
        pointer-events: none;*/ /* 隱藏時不可點擊 */
        /*position: absolute;*/ /* 移出文檔流,不佔空間 */
        /*visibility: hidden;*/ /* 完全隱藏 */
    /*}*/

/* ========== 圓點指示器(在卡片下方)========== */

.products-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 2rem; /* 在 grid 下方 */
    position: relative;
}

.products-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d0d0d0; /* 實心灰色 */
    cursor: pointer;
    transition: all 0.3s ease;
}

    .products-dot.active {
        background: var(--primary-color); /* 橘色 */
        width: 24px;
        border-radius: 4px;
    }

/* ========== 特殊狀態:商品數量少時置中 ========== */

/* 電腦版:8張以下置中 */
.products-grid.few-products-desktop {
    justify-content: center;
}

/* 手機版:4張以下置中 */
.products-grid.few-products-mobile {
    justify-content: center;
}

/* ========== 響應式調整 ========== */

/* 手機版(768px 以下)*/
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr); /* 手機版: 固定 2 欄 */
        gap: 1rem;
        min-height: 550px;
    }

    .products-dots {
        margin-top: 1.5rem;
    }
}

/* 小手機版(480px 以下)*/
@media (max-width: 480px) {
    .products-grid {
        min-height: 500px;
    }

    .products-dots {
        gap: 6px;
        margin-top: 1rem;
    }

    .products-dot {
        width: 6px;
        height: 6px;
    }

        .products-dot.active {
            width: 20px;
        }
}
/* ========== 活動資訊區塊（大理石高級風格）========== */
.events {
    padding: 4rem 0;
    position: relative;
    background-color: #f5f0ea;
    background-image: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(245,240,234,0.9) 100%), url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwMCIgaGVpZ2h0PSIxMDAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxmaWx0ZXIgaWQ9Im5vaXNlIj4KICAgIDxmZVR1cmJ1bGVuY2UgdHlwZT0iZnJhY3RhbE5vaXNlIiBiYXNlRnJlcXVlbmN5PSIwLjkiIG51bU9jdGF2ZXM9IjQiIHNlZWQ9IjE1Ii8+CiAgICA8ZmVDb2xvck1hdHJpeCB0eXBlPSJzYXR1cmF0ZSIgdmFsdWVzPSIwIi8+CiAgPC9maWx0ZXI+CiAgPHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsdGVyPSJ1cmwoI25vaXNlKSIgb3BhY2l0eT0iMC4xNSIvPgo8L3N2Zz4=');
  /*  background-attachment: scroll;*/
    overflow: hidden;
}

    /* 光暈裝飾 */
    /*.events::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(ellipse at top right, rgba(255, 140, 66, 0.08), transparent 60%), radial-gradient(ellipse at bottom left, rgba(92, 64, 51, 0.05), transparent 60%);
        pointer-events: none;
    }*/

    /* 容器 */
    .events .container {
        position: relative;
        z-index: 1;
        max-width: 1200px; /* ✅ 改回標準寬度 */
        width: 90%; /* ✅ 改為 90% 與其他區塊一致 */
        margin: 0 auto;
        overflow: hidden;
    }

    /* 標題 */
    .events .section-title {
        font-family: 'Cinzel', 'Noto Serif TC', serif;
        text-align: center;
        font-size: var(--font-size-large);
        font-weight: 400;
        letter-spacing: 0.1em;
        color: #5C4033;
        margin-bottom: 1rem;
        position: relative;
        padding-bottom: 1rem;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.05);
    }

        .events .section-title::after {
            content: '';
            display: block;
            width: 120px;
            height: 2px;
            background: linear-gradient(90deg, transparent, #FF8C42, transparent);
            margin: 1.5rem auto 0;
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
        }

/* 活動說明文字 */
.events-note {
    text-align: center;
    color: #7a6a5a;
    font-size: var(--font-size-small);
    margin-bottom: 3rem;
}

/* 輪播容器 - 🔥 加入 overflow: hidden */
.events-carousel-wrapper {
    overflow: hidden; /* 🔥 關鍵：隱藏超出的卡片 */
    width: 100%;
}

/* 活動網格 */
.events-grid {
    display: flex;
    gap: 2rem;
    transition: transform 0.5s ease;
    width: 100%; /* 🔥 確保容器寬度 */
    min-width: 0;
}

    .events-grid.no-transition {
        transition: none;
    }

/* ========== 活動卡片 ========== */
.event-card {
    flex: 0 0 calc(50% - 1rem); /* 電腦版：顯示 2 張 */
    min-width: 0; /* 🔥 防止 flex item 超出 */
    background: rgba(255, 255, 255, 0.95);
    /*  backdrop-filter: blur(10px);*/
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 140, 66, 0.1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
}

    /* 頂部裝飾線 */
    .event-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #FF8C42, #FFB366);
        transform: scaleX(0);
        transition: transform 0.5s ease;
        transform-origin: left;
        z-index: 2;
    }

    .event-card:hover {
        transform: none;
/*        box-shadow: 0 20px 60px rgba(92, 64, 51, 0.15), inset 0 1px 0 rgba(255, 255, 255, 1);
*/    }

       /* .event-card:hover::before {
            transform: scaleX(1);
        }*/

/* 圖片區域 - 🔥 修正留白問題 */
.event-media {
    width: 100%;
    height: 400px; /* 電腦版固定高度 */
    overflow: hidden;
    position: relative;
    background: #ffffff; /* 🔥 改為純白背景 */
    display: flex;
    align-items: center;
    justify-content: center;
}

    .event-media::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, transparent, rgba(255, 140, 66, 0.02));
        pointer-events: none;
    }

    .event-media img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* 🔥 改為 cover，填滿整個區域 */
        object-position: center; /* 🔥 圖片置中 */
        transition: transform 0.5s ease;
        position: relative;
        z-index: 1;
        display: block; /* 🔥 移除 inline 元素的預設間距 */
    }

/*.event-card:hover .event-media img {
    transform: scale(1.05);
}*/

/* 內容區域 */
.event-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

    /* 活動標題 */
    .event-content h3 {
        font-family: 'Noto Serif TC', serif;
        font-size: var(--font-size-medium);
        font-weight: 600;
        color: #5C4033;
        margin-bottom: 1rem;
        line-height: 1.4;
    }

/* 活動資訊（日期、地點）- 同一排 */
.event-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: var(--font-size-small);
}

    .event-meta span {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        color: #7a6a5a;
    }

    .event-meta i {
        color: #FF8C42;
        font-size: 0.9rem;
    }

/* 限量資訊 - 獨立一行，跟上面相同樣式 */
.event-quota {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #7a6a5a;
    font-size: var(--font-size-small);
    margin-bottom: 1rem;
}

    .event-quota i {
        color: #FF8C42;
        font-size: 0.9rem;
    }

/* 活動描述 */
.event-content p {
    color: #7a6a5a;
    font-size: var(--font-size-base);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    flex: 1;
}

/* ========== 活動報名按鈕（獨立樣式）========== */
.register-btn {
    display: inline-block;
    background: linear-gradient(135deg, #FF8C42 0%, #FFB366 100%);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: var(--font-size-base);
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 140, 66, 0.3);
    border: none;
    cursor: pointer;
    letter-spacing: 0.05em;
    align-self: flex-start;
}

    .register-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 140, 66, 0.4);
        background: linear-gradient(135deg, #FFB366 0%, #FF8C42 100%);
    }

    .register-btn:active {
        transform: translateY(0);
    }

/* ========== 圓點指示器 ========== */
.events-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 2rem;
}

.events-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d0d0d0;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .events-dot.active {
        background: #FF8C42;
        width: 24px;
        border-radius: 4px;
    }

/* ========== 特殊狀態 ========== */
.events-grid.single-card {
    justify-content: center;
}

    .events-grid.single-card .event-card {
        flex: 0 0 calc(50% - 1rem);
        max-width: 550px;
    }

.events-grid.two-cards {
    justify-content: center;
}

/* ========== 響應式設計 ========== */

/* 手機版（768px 以下）*/
@media (max-width: 768px) {
    .events {
        padding: 3rem 0;
    }

        .events .container {
            padding: 0 1rem;
            width: 100%; /* ✅ 手機版改為 100% */
            max-width: 100%; /* ✅ 移除最大寬度限制 */
        }

    .event-card {
        flex: 0 0 100%; /* 手機版：顯示 1 張 */
    }

    .events-grid {
        gap: 1rem;
    }

    .event-media {
        height: 300px; /* 手機版固定高度 */
    }

    .event-content {
        padding: 1.5rem;
    }

        .event-content h3 {
            font-size: var(--font-size-medium);
        }

    .event-meta {
        gap: 1rem;
    }

    .register-btn {
        width: 100%;
        text-align: center;
    }
    .events .container {
        /*position: relative;
        z-index: 1;
        max-width: 1200px;
        margin: 0 auto;
        overflow: hidden;*/ /* 🔥 關鍵：隱藏超出的卡片 */
        max-width: 100%; /* 確保不要被1200px限制 */
        width: 100%; /* 滿版寬度 */
        margin: 0 auto;
        overflow: hidden; /* 隱藏超出的卡片 */
    }
}

/* 小手機版（576px 以下）*/
@media (max-width: 576px) {
    .events {
        padding: 2rem 0;
    }

    .events-note {
        font-size: 0.8rem;
        padding: 0 1rem;
    }

    .event-media {
        height: 280px;
    }

    .event-content {
        padding: 1.2rem;
    }

        .event-content h3 {
            font-size: var(--font-size-medium);
        }

    .events-dots {
        gap: 6px;
        margin-top: 1.5rem;
    }

    .events-dot {
        width: 6px;
        height: 6px;
    }

        .events-dot.active {
            width: 20px;
        }
}

/* 極小螢幕（400px 以下）*/
@media (max-width: 400px) {
    .event-media {
        height: 250px;
    }

    .event-content {
        padding: 1rem;
    }

    .register-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ========== 手機版單張置中 ========== */
@media (max-width: 768px) {
    .events-grid.single-card .event-card {
        flex: 0 0 100%;
        max-width: 450px;
    }
}

/* ======== 活動報名蓋板 =========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    overflow: auto;
    padding: 1rem;
}

    .modal[aria-hidden="false"] {
        display: flex !important;
    }

    .modal[aria-hidden="true"] {
        display: none !important;
    }

/* ========== 蓋板內容容器 ========== */
.modal-content {
    background: var(--light-color, #FFF8E8);
    padding: 2rem;
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    animation: fadeInModal 0.3s ease-out;
    border-top: 5px solid var(--primary-color, #FF8C42);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== 關閉按鈕 ========== */
.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--brown-color, #5C4033);
    transition: color 0.3s ease;
    z-index: 10;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

    .close-btn:hover {
        color: var(--primary-color, #FF8C42);
    }

/* ========== 標題 ========== */
#modal-event-title,
.modal-content h2 {
    font-size: 1.8rem;
    color: var(--brown-color, #5C4033);
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    position: relative;
    font-weight: 700;
}

    #modal-event-title::after,
    .modal-content h2::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
        height: 3px;
        background: var(--primary-color, #FF8C42);
        border-radius: 2px;
    }

/* ========== 表單容器 ========== */
#registration-form,
#check-form {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
}

/* ========== 表單欄位 ========== */
.field {
    margin-bottom: 1rem;
}

    .field label {
        display: block;
        font-size: 1rem;
        color: var(--brown-color, #5C4033);
        margin-bottom: 0.5rem;
        font-weight: 500;
    }

    .field input,
    .field select {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid #ddd;
        border-radius: 8px;
        font-size: 1rem;
        transition: border-color 0.3s ease;
        background-color: white;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }

        .field input:focus,
        .field select:focus {
            outline: none;
            border-color: var(--primary-color, #FF8C42);
            box-shadow: 0 0 5px rgba(255, 140, 66, 0.3);
        }

    /* 下拉選單自訂箭頭 */
    .field select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235C4033' width='18px' height='18px'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.75rem center;
        background-size: 1rem;
        padding-right: 2.5rem;
    }

/* 提示文字 */
.hint {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.3rem;
}

/* ========== 並排欄位容器 ========== */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

    .form-row .field {
        flex: 1;
        margin-bottom: 0;
    }

/* ========== 活動選項容器 ========== */
#registration-events-container {
    margin-top: 0.5rem;
}

    #registration-events-container > div {
        margin-bottom: 0.8rem;
    }

    #registration-events-container input[type="radio"] {
        width: auto;
        margin-right: 0.5rem;
    }

    #registration-events-container label {
        display: inline;
        font-weight: 400;
        cursor: pointer;
    }

/* ========== 按鈕樣式 ========== */
.btn {
    display: inline-block;
    background-color: var(--primary-color, #FF8C42);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 1rem;
    text-align: center;
}

    .btn:hover {
        background-color: var(--secondary-color, #2D7DD2);
        transform: translateY(-3px);
        box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
    }

/* 按鈕容器 */
.form-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.submit-btn {
    flex: 2;
    background-color: var(--primary-color, #FF8C42);
}

.view-order-btn {
    flex: 1;
    background-color: #888;
}

    .view-order-btn:hover {
        background-color: #666;
    }

.checkout-btn {
    width: 100%;
    background-color: var(--accent-color, #97CC04);
}

/* ========== 確認資料頁面 ========== */
.confirmation-summary {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #f0f0f0;
}

    .data-row:last-child {
        border-bottom: none;
    }

.data-label {
    font-weight: 600;
    color: var(--brown-color, #5C4033);
    font-size: 1rem;
    min-width: 100px;
}

.data-value {
    color: #666;
    text-align: right;
    font-size: 1rem;
    word-break: break-word;
}

/* ==================== 響應式設計 - 手機版優化 ==================== */

/* ========== 平板 (768px 以下) ========== */
@media (max-width: 768px) {
    .modal {
        padding: 0.5rem;
    }

    .modal-content {
        width: 90%;
        padding: 1.5rem 1.2rem;
        max-height: 60vh;
    }

        /* 標題縮小 */
        #modal-event-title,
        .modal-content h2 {
            font-size: 1.5rem;
            margin-bottom: 1.2rem;
        }

    /* 表單容器 */
    #registration-form,
    #check-form {
        padding: 1.2rem;
    }

    /* 欄位間距縮小 */
    .field {
        margin-bottom: 0.8rem;
    }

        .field label {
            font-size: 0.95rem;
            margin-bottom: 0.4rem;
        }

        .field input,
        .field select {
            padding: 0.65rem;
            font-size: 0.95rem;
            height: 48px; /* 加高方便點擊 */
        }

    /* 並排欄位改為單欄 */
    .form-row {
        flex-direction: column;
        gap: 0.8rem;
    }

    /* 提示文字縮小 */
    .hint {
        font-size: 0.8rem;
        margin-top: 0.25rem;
    }

    /* 活動選項縮小間距 */
    #registration-events-container > div {
        margin-bottom: 0.6rem;
    }

    #registration-events-container label {
        font-size: 0.95rem;
    }

    /* 按鈕調整 */
    .form-actions {
        gap: 0.6rem;
        margin-top: 1.2rem;
    }

    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.95rem;
        height: 48px;
    }

    /* 確認資料頁面 */
    .confirmation-summary {
        padding: 1.2rem;
    }

    .data-row {
        padding: 0.6rem 0;
    }

    .data-label,
    .data-value {
        font-size: 0.95rem;
    }
}

/* ========== 小手機 (576px 以下) ========== */
@media (max-width: 576px) {
    .modal {
        padding: 0.3rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.2rem 1rem;
        border-radius: 12px;
    }

    /* 關閉按鈕 */
    .close-btn {
        top: 10px;
        right: 10px;
        font-size: 1.3rem;
    }

    /* 標題進一步縮小 */
    #modal-event-title,
    .modal-content h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
        padding-bottom: 0.4rem;
    }

        #modal-event-title::after,
        .modal-content h2::after {
            width: 40px;
            height: 2.5px;
        }

    /* 表單容器 */
    #registration-form,
    #check-form {
        padding: 1rem;
    }

    /* 欄位 */
    .field {
        margin-bottom: 0.7rem;
    }

        .field label {
            font-size: 0.9rem;
            margin-bottom: 0.35rem;
        }

        .field input,
        .field select {
            padding: 0.6rem;
            font-size: 0.9rem;
            height: 46px;
        }

    /* 並排欄位保持單欄 */
    .form-row {
        gap: 0.7rem;
    }

    /* 提示文字 */
    .hint {
        font-size: 0.75rem;
    }

    /* 活動選項 */
    #registration-events-container > div {
        margin-bottom: 0.5rem;
    }

    #registration-events-container label {
        font-size: 0.75rem;
    }

    /* 按鈕 */
    .form-actions {
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .btn {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
        height: 46px;
    }

    /* 確認資料頁面 */
    .confirmation-summary {
        padding: 1rem;
    }

    .data-row {
        padding: 0.5rem 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .data-label {
        min-width: auto;
        font-size: 0.9rem;
    }

    .data-value {
        text-align: left;
        font-size: 0.9rem;
        width: 100%;
    }
}

/* ========== 極小螢幕 (400px 以下) ========== */
@media (max-width: 400px) {
    .modal-content {
        padding: 1rem 0.8rem;
    }

    .close-btn {
        font-size: 1.2rem;
        top: 8px;
        right: 8px;
    }

    #modal-event-title,
    .modal-content h2 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }

    #registration-form,
    #check-form {
        padding: 0.8rem;
    }

    .field {
        margin-bottom: 0.6rem;
    }

        .field label {
            font-size: 0.85rem;
        }

        .field input,
        .field select {
            padding: 0.55rem;
            font-size: 0.85rem;
            height: 44px;
        }

    .btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        height: 30px;
    }

    .form-actions {
        gap: 0.4rem;
    }

    .data-label,
    .data-value {
        font-size: 0.85rem;
    }
}

/* ========== 防止內容溢出 ========== */
.modal-content * {
    box-sizing: border-box;
}

/* 防止長文字破版 */
.data-value,
#registration-events-container label {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ========== 無障礙優化 ========== */
.close-btn:focus,
.btn:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary-color, #FF8C42);
    outline-offset: 2px;
}

/* ========== Loading 覆蓋層 ========== */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
    font-size: 1.1rem;
}

    #loading-overlay > div {
        text-align: center;
        padding: 2rem;
    }

@media (max-width: 576px) {
    #loading-overlay {
        font-size: 1rem;
    }

        #loading-overlay > div {
            padding: 1.5rem;
        }
}