/* ============================================
   雪霧山莊 — 清新茶綠風格 v3
   以綠色為主調，清新、明亮、如茶香撲鼻
   ============================================ */

:root {
    --green: #3b8a4a;
    --green-dark: #2e7a3d;
    --green-light: #5aad68;
    --green-pale: #e8f5e9;
    --green-mist: #f0f7f1;
    --leaf: #43a047;
    --leaf-light: #66bb6a;
    --ink: #2e2e2e;
    --ink-light: #6e6e6e;
    --cream: #fcfdfb;
    --gold: #b09060;
    --gold-light: #c9a97a;
    --border: #d8e8d8;
    --border-light: #e8f0e8;
    --shadow: rgba(30, 80, 30, 0.05);
    --shadow-md: rgba(30, 80, 30, 0.08);
    --shadow-lg: rgba(30, 80, 30, 0.12);
}

/* ---- 基礎 ---- */
* { box-sizing: border-box; }
html, body {
    overflow-x: hidden;
}
body {
    font-family: 'Noto Sans TC', sans-serif;
    background: var(--cream);
    color: var(--ink);
    line-height: 1.8;
    font-weight: 400;
}
h1, h2, h3, h4, h5 {
    font-family: 'Noto Serif TC', serif;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ink);
}
a { color: var(--green); text-decoration: none; transition: all 0.3s; }
a:hover { color: var(--green-dark); }

/* ---- 導覽列 ---- */
#mainNav {
    background: rgba(252, 253, 251, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(216, 232, 216, 0.5);
    padding: 0.65rem 0;
    transition: all 0.4s ease;
}
#mainNav.scrolled {
    background: rgba(252, 253, 251, 0.97);
    box-shadow: 0 2px 24px var(--shadow-md);
    padding: 0.45rem 0;
}
.navbar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}
.brand-text {
    font-family: 'Noto Serif TC', serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--green);
    letter-spacing: 4px;
}
.brand-sub {
    font-size: 0.6rem;
    color: var(--gold);
    letter-spacing: 5px;
    text-transform: uppercase;
    font-weight: 500;
}
.navbar-nav .nav-link {
    color: var(--ink);
    font-weight: 400;
    padding: 0.5rem 1rem;
    position: relative;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    transition: color 0.3s;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--green);
}
.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--green);
    border-radius: 1px;
}
.navbar-toggler {
    border: 1px solid var(--border);
    padding: 0.4rem 0.6rem;
    font-size: 1.2rem;
    color: var(--ink);
}
.cart-link, .member-link {
    color: var(--ink);
    font-size: 1.1rem;
    position: relative;
    transition: color 0.3s;
}
.cart-link:hover, .member-link:hover { color: var(--green); }
.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--leaf);
    color: #fff;
    font-size: 0.6rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.member-link { font-size: 0.9rem; }

/* ---- 主內容間距 ---- */
.main-content { padding-top: 75px; min-height: 60vh; }

/* ---- Hero Banner（有圖片輪播） ---- */
.hero-banner {
    margin-top: -75px;
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
}
.hero-banner .carousel,
.hero-banner .carousel-inner,
.hero-banner .carousel-item {
    width: 100%;
    height: 92vh;
    min-height: 500px;
}
.hero-banner .hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hero-banner .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.05) 0%,
        rgba(0, 0, 0, 0) 30%,
        rgba(0, 0, 0, 0.4) 100%
    );
    z-index: 1;
    pointer-events: none;
}
.hero-banner .hero-caption {
    z-index: 2;
    bottom: 18%;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    text-align: center;
    padding: 0 1rem;
}
.hero-banner .hero-caption h1 {
    font-family: 'Noto Serif TC', serif;
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: 10px;
    color: #fff;
    text-shadow: 0 2px 30px rgba(0,0,0,0.2);
    margin-bottom: 0.5rem;
}
.hero-banner .hero-caption p {
    font-size: 1.1rem;
    letter-spacing: 4px;
    color: rgba(255,255,255,0.9);
    font-weight: 300;
}
.hero-banner .carousel-control-prev,
.hero-banner .carousel-control-next {
    z-index: 3;
    width: 6%;
    opacity: 0.5;
}
.hero-banner .carousel-control-prev:hover,
.hero-banner .carousel-control-next:hover { opacity: 0.9; }

/* Hero 靜態背景（無 banner 時） */
.hero-static {
    position: relative;
    width: 100%;
    height: 92vh;
    min-height: 560px;
    margin-top: -75px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        170deg,
        #f5faf5 0%,
        #dcefd8 15%,
        #b5d9a8 35%,
        #7aba6e 55%,
        #55a04a 70%,
        #3d8a3d 85%,
        #2d6e30 100%
    );
}
/* 雲霧效果 */
.hero-static::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 130% 50% at 15% 45%, rgba(255,255,255,0.45) 0%, transparent 65%),
        radial-gradient(ellipse 100% 40% at 85% 55%, rgba(255,255,255,0.25) 0%, transparent 55%),
        radial-gradient(ellipse 90% 35% at 50% 80%, rgba(255,255,255,0.35) 0%, transparent 50%);
    z-index: 1;
    animation: mistDrift 15s ease-in-out infinite alternate;
}
/* 山巒輪廓 */
.hero-static::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background:
        linear-gradient(172deg, transparent 45%, rgba(45,110,48,0.25) 65%, rgba(35,90,38,0.4) 85%),
        linear-gradient(168deg, transparent 50%, rgba(55,120,55,0.15) 70%, rgba(40,100,42,0.3) 90%);
    z-index: 1;
}
@keyframes mistDrift {
    0%   { opacity: 0.6; transform: translateX(-5px) translateY(0); }
    100% { opacity: 1;   transform: translateX(5px) translateY(-8px); }
}

.hero-content {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 0 1rem;
}
.hero-content h1 {
    font-family: 'Noto Serif TC', serif;
    font-size: 3.8rem;
    font-weight: 900;
    letter-spacing: 12px;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 0 2px 30px rgba(0,60,0,0.2), 0 0 60px rgba(255,255,255,0.15);
}
.hero-content .hero-divider {
    display: inline-block;
    width: 50px;
    height: 1px;
    background: rgba(255,255,255,0.6);
    margin: 0.6rem 0;
}
.hero-content p {
    font-size: 1.1rem;
    letter-spacing: 4px;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 15px rgba(0,40,0,0.15);
    font-weight: 300;
}
.hero-content .btn-hero,
.hero-banner .btn-hero {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.7rem 2.5rem;
    border: 1px solid rgba(255,255,255,0.55);
    color: #fff;
    border-radius: 3px;
    letter-spacing: 3px;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 400;
    transition: all 0.4s;
    background: transparent;
}
.hero-content .btn-hero:hover,
.hero-banner .btn-hero:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.9);
    color: #fff;
    transform: translateY(-2px);
}

/* ---- 區段標題 ---- */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
}
.section-title h2 {
    font-size: 1.8rem;
    letter-spacing: 5px;
    margin-bottom: 0.5rem;
    font-weight: 700;
}
.section-title .divider {
    display: inline-block;
    width: 40px;
    height: 2px;
    background: var(--green);
    margin: 0.5rem 0;
    border-radius: 1px;
}
.section-title p {
    color: var(--ink-light);
    font-size: 0.9rem;
    letter-spacing: 2px;
    font-weight: 300;
}

/* ---- 商品卡片 ---- */
.product-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.4s ease;
    height: 100%;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px var(--shadow-lg);
    border-color: var(--green-pale);
}
.product-card .card-img-wrap {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: var(--green-mist);
}
.product-card .card-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.product-card:hover .card-img-wrap img { transform: scale(1.06); }
.product-card .card-body {
    padding: 1.2rem 1.25rem;
}
.product-card .card-body h5 {
    font-family: 'Noto Serif TC', serif;
    font-size: 1rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
    letter-spacing: 1px;
}
.product-card .category-tag {
    font-size: 0.7rem;
    color: var(--green-light);
    letter-spacing: 2px;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    font-weight: 500;
}
.product-card .price {
    font-family: 'Noto Serif TC', serif;
    font-size: 1.15rem;
    color: var(--green);
    font-weight: 700;
}
.product-card .price .original {
    font-size: 0.8rem;
    color: #aaa;
    text-decoration: line-through;
    margin-left: 0.5rem;
    font-weight: 400;
}
.product-card .spec {
    font-size: 0.78rem;
    color: var(--ink-light);
    letter-spacing: 0.5px;
}

/* ---- 按鈕 ---- */
.btn-tea {
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.65rem 1.8rem;
    font-weight: 500;
    letter-spacing: 2px;
    font-size: 0.88rem;
    transition: all 0.3s;
}
.btn-tea:hover {
    background: var(--green-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59, 138, 74, 0.3);
}
.btn-tea-outline {
    background: transparent;
    color: var(--green);
    border: 1.5px solid var(--green);
    border-radius: 4px;
    padding: 0.6rem 1.8rem;
    font-weight: 500;
    letter-spacing: 2px;
    font-size: 0.88rem;
    transition: all 0.3s;
}
.btn-tea-outline:hover {
    background: var(--green);
    color: #fff;
}
.btn-gold {
    background: var(--gold);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.65rem 1.8rem;
    letter-spacing: 1px;
    transition: all 0.3s;
}
.btn-gold:hover {
    background: #9a7a50;
    color: #fff;
}

/* ---- 品牌故事區 ---- */
.story-section {
    background: var(--green-mist);
    padding: 6rem 0;
    position: relative;
}
.story-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 10%, var(--border) 50%, transparent 90%);
}
.story-section .story-text {
    font-size: 1rem;
    line-height: 2.2;
    color: var(--ink-light);
    letter-spacing: 0.5px;
}
.story-image-placeholder {
    background: linear-gradient(135deg, var(--green-pale) 0%, #c8e6c9 50%, #a5d6a7 100%);
    border-radius: 8px;
    padding: 5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ---- 分類卡片 ---- */
.category-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 280px;
    transition: all 0.4s ease;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--shadow-lg);
}
.category-card .cat-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
}
.category-card:hover .cat-img { transform: scale(1.08); }
.category-card .cat-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.02) 0%, rgba(0,50,0,0.45) 100%);
    z-index: 1;
}
.category-card .cat-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    z-index: 2;
    color: #fff;
}
.category-card .cat-content h5 {
    font-family: 'Noto Serif TC', serif;
    color: #fff;
    font-size: 1.15rem;
    letter-spacing: 3px;
    margin-bottom: 0.25rem;
}
.category-card .cat-content p {
    font-size: 0.8rem;
    opacity: 0.8;
    margin: 0;
    letter-spacing: 1px;
}
.category-card.no-img {
    background: linear-gradient(135deg, var(--green-pale) 0%, #c8e6c9 60%, #a5d6a7 100%);
}
.category-card .cat-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: var(--green);
    opacity: 0.15;
}

/* ---- 商品列表頁 ---- */
.filter-sidebar .category-list {
    list-style: none;
    padding: 0;
}
.filter-sidebar .category-list li a {
    display: block;
    padding: 0.6rem 0;
    color: var(--ink-light);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: all 0.3s;
}
.filter-sidebar .category-list li a:hover,
.filter-sidebar .category-list li a.active {
    color: var(--green);
    font-weight: 600;
    padding-left: 0.5rem;
}

/* ---- 商品詳情 ---- */
.product-gallery img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}
.product-gallery .thumb-list {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.product-gallery .thumb-list img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s;
    border-radius: 4px;
    border: 2px solid transparent;
}
.product-gallery .thumb-list img:hover { opacity: 0.8; }
.product-gallery .thumb-list img.active {
    opacity: 1;
    border-color: var(--green);
}
.product-info { padding-left: 2rem; }
.product-info h1 { font-size: 1.8rem; letter-spacing: 3px; margin-bottom: 0.5rem; }
.product-info .meta { color: var(--ink-light); margin-bottom: 1.5rem; letter-spacing: 1px; }
.product-info .price-big {
    font-family: 'Noto Serif TC', serif;
    font-size: 2rem;
    color: var(--green);
    font-weight: 700;
}
.quantity-selector { display: flex; align-items: center; gap: 0; }
.quantity-selector button {
    width: 38px; height: 38px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}
.quantity-selector button:hover { background: var(--green-pale); }
.quantity-selector input {
    width: 50px; height: 38px;
    border: 1px solid var(--border);
    border-left: 0; border-right: 0;
    text-align: center;
    font-size: 0.95rem;
}

/* ---- 購物車 ---- */
.cart-table th {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid var(--border);
}
.cart-table td { vertical-align: middle; }
.cart-table .product-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; }
.cart-summary {
    background: var(--green-mist);
    border-radius: 8px;
    padding: 1.8rem;
    border: 1px solid var(--border);
}
.cart-summary .total-label { font-size: 1rem; letter-spacing: 1px; }
.cart-summary .total-amount {
    font-family: 'Noto Serif TC', serif;
    font-size: 1.8rem;
    color: var(--green);
    font-weight: 700;
}

/* ---- 結帳 ---- */
.checkout-form .form-label {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--ink);
}
.checkout-form .form-control {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.7rem 1rem;
    background: #fff;
    transition: all 0.3s;
}
.checkout-form .form-control:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(59, 138, 74, 0.1);
}

/* ---- 會員頁 ---- */
.auth-card {
    max-width: 420px;
    margin: 3rem auto;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: 0 4px 24px var(--shadow);
}
.auth-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.4rem;
    letter-spacing: 4px;
}
.auth-card .form-control {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.7rem 1rem;
}
.auth-card .form-control:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(59, 138, 74, 0.1);
}

/* ---- 訂單狀態 ---- */
.order-status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ---- 頁尾 ---- */
.site-footer {
    background: #1e3a1e;
    color: #c0d4c0;
    padding: 4.5rem 0 1.5rem;
    margin-top: 5rem;
}
.footer-brand {
    font-family: 'Noto Serif TC', serif;
    color: var(--green-light);
    font-size: 1.4rem;
    letter-spacing: 4px;
    margin-bottom: 1rem;
}
.footer-desc {
    font-size: 0.88rem;
    line-height: 1.9;
    color: #8aaa8a;
    letter-spacing: 0.5px;
}
.footer-title {
    color: var(--green-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    font-weight: 600;
}
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 0.5rem; font-size: 0.88rem; }
.footer-links a { color: #8aaa8a; transition: color 0.3s; }
.footer-links a:hover { color: var(--green-light); }
.footer-links i { margin-right: 0.5rem; color: var(--green-light); opacity: 0.6; }
.footer-bottom {
    border-top: 1px solid #2a4a2a;
    margin-top: 3rem;
    padding-top: 1.5rem;
    text-align: center;
}
.footer-bottom p { color: #5a7a5a; font-size: 0.78rem; margin: 0; letter-spacing: 1px; }

/* ---- Navbar 手機版 ---- */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(252, 253, 251, 0.98);
        border-radius: 0 0 12px 12px;
        padding: 0.5rem 0;
        margin-top: 0.5rem;
        border: 1px solid var(--border-light);
        border-top: none;
        box-shadow: 0 8px 32px var(--shadow-md);
    }
    .navbar-nav {
        padding: 0.5rem 0;
    }
    .navbar-nav .nav-link {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
        border-bottom: 1px solid var(--border-light);
    }
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    .navbar-nav .nav-link.active {
        color: var(--green);
        background: var(--green-mist);
        font-weight: 600;
    }
    .navbar-nav .nav-link.active::after {
        display: none;
    }
    .navbar-actions {
        padding: 0.75rem 1.5rem;
        margin-top: 0;
        border-top: 1px solid var(--border);
        gap: 1.5rem !important;
    }
    .navbar-actions .cart-link,
    .navbar-actions .member-link {
        font-size: 1rem;
    }
    .navbar-toggler {
        border-color: var(--green);
        color: var(--green);
        padding: 0.35rem 0.55rem;
    }
    .navbar-toggler:focus {
        box-shadow: 0 0 0 3px rgba(59, 138, 74, 0.15);
    }
}

/* ---- 平板 (768-991px) ---- */
@media (max-width: 991px) {
    .hero-content h1 { font-size: 2.8rem; letter-spacing: 8px; }
    .hero-static { height: 70vh; }
    .hero-banner .carousel,
    .hero-banner .carousel-inner,
    .hero-banner .carousel-item { height: 70vh; }
    .hero-banner .hero-caption h1 { font-size: 2.8rem; letter-spacing: 8px; }
    .hero-banner .hero-caption { bottom: 22%; }
    .product-info { padding-left: 0; margin-top: 1.5rem; }
    .category-card { height: 220px; }
    .story-section { padding: 4rem 0; }
}

/* ---- 手機 (576-767px) ---- */
@media (max-width: 767px) {
    .hero-content h1 { font-size: 2.4rem; letter-spacing: 6px; }
    .hero-static { height: 65vh; min-height: 420px; }
    .hero-banner .carousel,
    .hero-banner .carousel-inner,
    .hero-banner .carousel-item { height: 65vh; min-height: 420px; }
    .hero-banner .hero-caption h1 { font-size: 2.4rem; letter-spacing: 6px; }
    .hero-banner .hero-caption { bottom: 20%; }
    .hero-banner .hero-caption p { font-size: 0.95rem; letter-spacing: 3px; }
    .hero-content p { font-size: 0.95rem; letter-spacing: 3px; }
    .hero-content .btn-hero { padding: 0.6rem 2rem; font-size: 0.82rem; }

    /* 區段間距縮減 */
    section.py-5 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
    .section-title { margin-bottom: 2rem; }
    .section-title h2 { font-size: 1.5rem; letter-spacing: 3px; }

    /* 商品 2 欄 */
    .products-grid .col-sm-6 {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
    .products-grid.row {
        margin-left: -6px !important;
        margin-right: -6px !important;
        row-gap: 12px !important;
    }
    .product-card .card-body { padding: 0.8rem 0.75rem; }
    .product-card .card-body h5 { font-size: 0.88rem; }
    .product-card .category-tag { font-size: 0.65rem; letter-spacing: 1.5px; margin-bottom: 0.15rem; }
    .product-card .price { font-size: 1rem; }
    .product-card .price .original { font-size: 0.7rem; display: block; margin-left: 0; }
    .product-card .spec { font-size: 0.72rem; }

    /* 品牌故事 */
    .story-section { padding: 3rem 0; }
    .story-section .story-text { font-size: 0.92rem; line-height: 2; }
    .story-section .section-title h2 { font-size: 1.4rem; }
    .story-section img { max-height: 280px; }

    /* 分類卡片 */
    .category-card { height: 180px; }
    .category-card .cat-content { padding: 1rem; }
    .category-card .cat-content h5 { font-size: 1rem; letter-spacing: 2px; }
    .category-card .cat-content p { font-size: 0.75rem; }

    /* 頁尾 */
    .site-footer { padding: 3rem 0 1rem; margin-top: 3rem; }
    .footer-brand { font-size: 1.2rem; }
    .footer-desc { font-size: 0.82rem; }
    .footer-title { margin-bottom: 0.6rem; margin-top: 0.5rem; }
    .footer-links li { margin-bottom: 0.35rem; font-size: 0.82rem; }
    .footer-bottom { margin-top: 2rem; padding-top: 1rem; }

    /* 商品詳情頁 */
    .product-gallery .thumb-list img { width: 60px; height: 60px; }
    .product-info h1 { font-size: 1.4rem; letter-spacing: 2px; }
    .product-info .price-big { font-size: 1.6rem; }

    /* 購物車 */
    .cart-table .product-thumb { width: 60px; height: 60px; }
    .cart-summary { padding: 1.2rem; }
    .cart-summary .total-amount { font-size: 1.5rem; }

    /* 認證卡片 */
    .auth-card { margin: 1.5rem; padding: 1.8rem; }
    .auth-card h2 { font-size: 1.2rem; }
}

/* ---- 小手機 (≤ 480px) ---- */
@media (max-width: 480px) {
    /* Navbar brand 縮小 */
    .brand-text { font-size: 1.3rem; letter-spacing: 3px; }
    .brand-sub { font-size: 0.5rem; letter-spacing: 3px; }

    /* Hero */
    .hero-content h1 { font-size: 2rem; letter-spacing: 4px; }
    .hero-static { height: 55vh; min-height: 360px; }
    .hero-banner .carousel,
    .hero-banner .carousel-inner,
    .hero-banner .carousel-item { height: 55vh; min-height: 360px; }
    .hero-banner .hero-caption { bottom: 18%; }
    .hero-banner .hero-caption h1 { font-size: 2rem; letter-spacing: 4px; }
    .hero-banner .hero-caption p { font-size: 0.85rem; letter-spacing: 2px; }
    .hero-content p { font-size: 0.88rem; letter-spacing: 2px; }
    .hero-content .btn-hero {
        margin-top: 1.2rem;
        padding: 0.55rem 1.5rem;
        font-size: 0.78rem;
        letter-spacing: 2px;
    }

    /* Banner 控制按鈕隱藏（手機用滑動） */
    .hero-banner .carousel-control-prev,
    .hero-banner .carousel-control-next { display: none; }

    /* 區段 */
    section.py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
    .section-title { margin-bottom: 1.5rem; }
    .section-title h2 { font-size: 1.3rem; letter-spacing: 2px; }
    .section-title p { font-size: 0.82rem; letter-spacing: 1px; }

    /* 商品卡片更緊湊 */
    .product-card .card-body { padding: 0.65rem 0.6rem; }
    .product-card .card-body h5 { font-size: 0.82rem; margin-bottom: 0.2rem; }
    .product-card .category-tag { font-size: 0.6rem; }
    .product-card .price { font-size: 0.92rem; }
    .product-card .spec { font-size: 0.68rem; }

    /* 按鈕 */
    .btn-tea, .btn-tea-outline {
        padding: 0.55rem 1.4rem;
        font-size: 0.82rem;
        letter-spacing: 1.5px;
    }

    /* 品牌故事 */
    .story-section { padding: 2.5rem 0; }
    .story-section .story-text p { margin-bottom: 0.8rem; }
    .story-section img { max-height: 220px; border-radius: 6px; }

    /* 分類 2 欄 */
    .categories-grid .col-sm-6 {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
    .categories-grid.row {
        margin-left: -6px !important;
        margin-right: -6px !important;
        row-gap: 12px !important;
    }
    .category-card { height: 150px; border-radius: 6px; }
    .category-card .cat-content h5 { font-size: 0.9rem; letter-spacing: 1.5px; }
    .category-card .cat-content p { font-size: 0.68rem; letter-spacing: 0.5px; }

    /* 頁尾更緊湊 */
    .site-footer { padding: 2.5rem 0 1rem; margin-top: 2rem; }
    .site-footer .row > div { margin-bottom: 0; }
    .footer-brand { font-size: 1.1rem; letter-spacing: 3px; margin-bottom: 0.5rem; }
    .footer-desc { font-size: 0.78rem; line-height: 1.7; }
    .footer-title { font-size: 0.72rem; letter-spacing: 2px; }
    .footer-links li { margin-bottom: 0.25rem; }
    .footer-links li, .footer-links a { font-size: 0.78rem; }
    .footer-bottom { margin-top: 1.5rem; }
    .footer-bottom p { font-size: 0.7rem; }

    /* 結帳頁 */
    .checkout-form .form-control { padding: 0.6rem 0.8rem; font-size: 0.9rem; }

    /* 量選擇器 */
    .quantity-selector button { width: 34px; height: 34px; }
    .quantity-selector input { width: 44px; height: 34px; font-size: 0.88rem; }
}

/* ---- 極小手機 (≤ 360px) ---- */
@media (max-width: 360px) {
    .brand-text { font-size: 1.15rem; letter-spacing: 2px; }
    .hero-content h1 { font-size: 1.7rem; letter-spacing: 3px; }
    .hero-banner .hero-caption h1 { font-size: 1.7rem; letter-spacing: 3px; }
    .product-card .card-body h5 { font-size: 0.78rem; }
    .product-card .price { font-size: 0.85rem; }
    .product-card .price .original { font-size: 0.65rem; }
    .section-title h2 { font-size: 1.15rem; }
}

/* ---- 觸控優化 ---- */
@media (hover: none) and (pointer: coarse) {
    /* 取消 hover 效果，改善觸控體驗 */
    .product-card:hover {
        transform: none;
        box-shadow: 0 4px 16px var(--shadow);
    }
    .product-card:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
    .category-card:hover {
        transform: none;
    }
    .category-card:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
    /* 確保點擊區域足夠大 */
    .navbar-nav .nav-link { min-height: 44px; display: flex; align-items: center; }
    .btn-tea, .btn-tea-outline, .btn-gold { min-height: 44px; }
    .footer-links a { display: inline-block; min-height: 36px; line-height: 36px; }
}

/* ---- 安全區域（瀏海手機） ---- */
@supports (padding: env(safe-area-inset-top)) {
    #mainNav {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    .site-footer {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

/* ---- 橫向模式 ---- */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-static { height: 100vh; min-height: 300px; }
    .hero-banner .carousel,
    .hero-banner .carousel-inner,
    .hero-banner .carousel-item { height: 100vh; min-height: 300px; }
    .hero-content h1 { font-size: 1.8rem; }
    .hero-banner .hero-caption h1 { font-size: 1.8rem; }
}


/* ---- Hero 手機版增強 ---- */
@media (max-width: 767px) {
    .hero-banner .hero-caption {
        bottom: 25%;
    }
    .hero-banner .hero-caption h1 {
        text-shadow: 0 2px 20px rgba(0,0,0,0.35), 0 0 40px rgba(0,0,0,0.15);
    }
    .hero-banner .hero-caption p {
        text-shadow: 0 1px 12px rgba(0,0,0,0.3);
    }
    .hero-banner .btn-hero,
    .hero-content .btn-hero {
        background: transparent;
        border-color: rgba(255,255,255,0.6);
        padding: 0.6rem 1.8rem;
        font-size: 0.82rem;
    }
    .hero-banner .btn-hero:hover,
    .hero-content .btn-hero:hover {
        background: rgba(255,255,255,0.15);
    }
    /* Hero 靜態背景 */
    .hero-content {
        padding: 0 2rem;
    }
    .hero-content h1 {
        text-shadow: 0 2px 20px rgba(0,60,0,0.3), 0 0 50px rgba(255,255,255,0.2);
    }
}
@media (max-width: 480px) {
    .hero-banner .hero-caption {
        bottom: 22%;
        padding: 0 1.5rem;
    }
}


/* Hero 標題不換行 */
@media (max-width: 480px) {
    .hero-banner .hero-caption h1,
    .hero-content h1 {
        white-space: nowrap;
        font-size: 1.8rem;
        letter-spacing: 3px;
    }
    .hero-banner .hero-caption p,
    .hero-content p {
        word-break: keep-all;
        font-size: 0.82rem;
        letter-spacing: 1.5px;
    }
}
@media (max-width: 360px) {
    .hero-banner .hero-caption h1,
    .hero-content h1 {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }
}
/* ---- 淡入動畫 ---- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ---- 分頁 ---- */
.pagination .page-link {
    color: var(--green);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin: 0 2px;
    font-size: 0.88rem;
}
.pagination .page-item.active .page-link {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

/* ---- 麵包屑 ---- */
.breadcrumb { background: transparent; padding: 0; font-size: 0.82rem; }
.breadcrumb-item a { color: var(--ink-light); }
.breadcrumb-item.active { color: var(--green); }

/* ---- Alert ---- */
.alert-success {
    background: var(--green-pale);
    border: 1px solid #a5d6a7;
    color: var(--green-dark);
    border-radius: 4px;
}
.alert-danger {
    background: #fef5f5;
    border: 1px solid #f5c6cb;
    color: #8b2525;
    border-radius: 4px;
}

/* ---- 手機浮動購物車 ---- */
.floating-cart {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--green);
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    border: 1px solid rgba(59,138,74,0.2);
    z-index: 1000;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
}
.floating-cart:active {
    transform: scale(0.95);
    color: var(--green);
}
.floating-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}
.floating-cart.bounce {
    animation: cartBounce 0.5s ease;
}
@keyframes cartBounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.3); }
    60% { transform: scale(0.9); }
}
@media (max-width: 767px) {
    .floating-cart { display: flex; }
}
