/* ========================================== */
/* ✨ Global Styles & Variables ✨ */
/* ========================================== */
:root {
    --primary: #000;
    --accent: rgb(34, 57, 90);
    --accent-dark: #0000a9;
    --bg: #f4f4f4;
    --header-bg: rgb(34, 57, 90);
    --text-color: #333;
    --card-bg: #fff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans TC', sans-serif;
}

html {
    scroll-behavior: smooth;
}

html.snap-active {
    scroll-snap-type: y mandatory;
}

body {
    background: var(--bg);
    color: var(--primary);
    padding-bottom: 0;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

img {
    max-width: 100%;
    display: block;
}

/* ========================================== */
/* ✨ Header & Navigation ✨ */
/* ========================================== */
header {
    background: rgba(255, 255, 255, 0.15);
    color: var(--accent);
    padding: 0 1.5rem;
    height: 80px;
    display: flex;
    justify-content: flex-end;
    /* Default for desktop with full nav */
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: none;
}

/* For pages where header content is spread out (like Cart) */
header.spread {
    justify-content: space-between;
}

header h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 1.5rem;
    white-space: nowrap;
    font-weight: bold;
}

header h1 a {
    color: var(--accent);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
}

nav a {
    color: var(--accent);
    font-weight: bold;
}

nav a:hover {
    color: #666;
}

/* 特別的導覽按鈕 (如碳酸泉) */
.btn-nav {
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 5px 15px;
    border-radius: 20px;
    transition: all 0.3s;
}

.btn-nav:hover {
    background: var(--accent);
    color: white !important;
}

/* Cart Count */
.cart-count {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 0.8rem;
    margin-left: 5px;
    vertical-align: middle;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--accent);
    transition: all 0.3s ease;
}

/* Header Responsive */
@media (max-width: 768px) {
    /* ========================================== */
    /* ✨ [Mobile] Header - 輕薄簡潔風格 ✨ */
    /* ========================================== */
    header {
        justify-content: center;
        padding: 0 1rem;
        height: 60px;
        box-shadow: none;
        border-bottom: none;
    }

    header h1 {
        position: static;
        transform: none;
        font-size: 1.15rem;
        letter-spacing: 2px;
        text-align: center;
        flex: 1;
    }

    /* ========================================== */
    /* ✨ [Mobile] Hamburger - 精緻按鈕 ✨ */
    /* ========================================== */
    .hamburger {
        display: flex;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        background: transparent;
        padding: 10px;
        border-radius: 6px;
        gap: 4px;
    }

    .hamburger span {
        width: 20px;
        height: 2px;
        border-radius: 2px;
    }

    /* Fix: Remove nav from flex flow so H1 and Hamburger align */
    nav:has(ul.mobile-menu) {
        position: absolute;
        width: 0;
        height: 0;
        overflow: visible;
    }

    nav:not(:has(ul.mobile-menu)) {
        position: static;
        width: auto;
        height: auto;
    }

    /* ========================================== */
    /* ✨ [Mobile] Side Menu - 全屏覆蓋面板 ✨ */
    /* ========================================== */
    nav ul.mobile-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100dvh;
        background: rgba(20, 40, 70, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        margin: 0;
        padding: 80px 0 40px 0;
        z-index: 1000;
        gap: 0;
    }

    nav ul.mobile-menu.active {
        right: 0;
    }

    /* 選單背景遮罩 */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .menu-overlay.active {
        display: block;
    }

    nav ul.mobile-menu li {
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    nav ul.mobile-menu li a {
        display: block;
        padding: 18px 28px;
        font-size: 1rem;
        font-weight: 400;
        letter-spacing: 1px;
        color: white;
    }

    nav ul.mobile-menu li a:hover {
        color: #ccc;
    }

    /* 關閉按鈕 */
    .menu-close-btn {
        display: block;
        position: absolute;
        top: 16px;
        right: 16px;
        font-size: 1.6rem;
        color: white;
        cursor: pointer;
        width: 36px;
        height: 36px;
        line-height: 36px;
        text-align: center;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        transition: background 0.2s;
        z-index: 1001;
    }

    .menu-close-btn:hover {
        background: rgba(255, 255, 255, 0.25);
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* 手機版 dropdown 修正 */
    nav ul.mobile-menu .dropdown {
        flex-direction: column;
        height: auto;
    }

    nav ul.mobile-menu .dropdown > a {
        padding: 18px 28px;
    }

    nav ul.mobile-menu .dropdown-content {
        position: static;
        transform: none;
        display: none;
        background: rgba(255, 255, 255, 0.06);
        box-shadow: none;
        border-radius: 0;
        margin-top: 0;
        width: 100%;
        max-height: 300px;
        overflow-y: auto;
    }

    nav ul.mobile-menu .dropdown.active .dropdown-content {
        display: block;
    }

    nav ul.mobile-menu .dropdown-content a {
        color: rgba(255, 255, 255, 0.8);
        padding: 14px 28px 14px 44px;
        font-size: 0.9rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    nav ul.mobile-menu .dropdown-content a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    /* 碳酸泉按鈕在選單中去除邊框 */
    nav ul.mobile-menu .btn-nav {
        border: none;
        padding: 18px 28px;
        border-radius: 0;
    }
}

/* Dropdown */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 4px 4px;
    overflow: hidden;
    z-index: 1001;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-align: center;
    display: block;
}

.dropdown-content a:hover {
    background: #f1f1f1;
    color: var(--accent);
}


/* ========================================== */
/* ✨ Layout Containers ✨ */
/* ========================================== */
.container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1rem;
}

/* ========================================== */
/* ✨ Hero / Story Section (Index) ✨ */
/* ========================================== */
.story-section {
    position: relative;
    width: 100%;
    height: 100vh;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    min-height: 100vh;
    height: 100dvh;
    /* Better for mobile browsers */
}

.video-section {
    position: relative;
    overflow: hidden;
}

/* [影片] 絕對定位，確保永遠填滿區塊且不變形 */
.bg-video,
.bg-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.bg-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.story-content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 800px;
    padding: 2rem;
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease-out;
}

.story-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.story-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.story-desc {
    font-size: 1.2rem;
    line-height: 1.8;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
    font-weight: 300;
}

@media (max-width: 768px) {
    .story-section {
        background-attachment: scroll;
    }

    .story-title {
        font-size: 1.6rem;
        letter-spacing: 3px;
        font-weight: 500;
    }

    .story-desc {
        font-size: 1rem;
        letter-spacing: 1px;
        line-height: 2;
    }

    .story-content {
        padding: 1.5rem;
    }

    .overlay {
        background: rgba(0, 0, 0, 0.2);
    }

    /* Fix: Show full 1080x1350 image without zooming/cropping */
    #section-professional .bg-media img {
        object-fit: contain !important;
        background-color: #f4f4f4;
    }
}

/* ========================================== */
/* ✨ Alphabet Section ✨ */
/* ========================================== */
.alphabet-section {
    background: #fdfdfd;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

.scattered-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.scatter-letter {
    position: absolute;
    height: 60px;
    width: auto;
    opacity: 0;
    transform: scale(0.2) rotate(calc(var(--r, 0deg) - 180deg));
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.center-popup {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    width: 100%;
    height: 100%;
    /* Override .story-content default transition behavior for new animation */
    opacity: 1 !important;
    transform: none !important;
}

.mao-twins {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.mao-wrapper {
    position: relative;
    display: inline-block;
    width: 140px;
    opacity: 0;
    transform: translateY(40px) scale(0.6);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mao-main {
    width: 100%;
    height: auto;
    display: block;
}

.welcome-title {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: 4px;
    text-align: center;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.welcome-desc {
    font-size: 1.8rem;
    font-weight: 600;
    color: #444;
    letter-spacing: 2px;
    text-align: center;
    line-height: 1.8;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Scroll Animation Triggered via .visible */
.story-content.visible ~ .scattered-bg .scatter-letter {
    opacity: 0.15; /* 半透明以襯托中央內容 */
    transform: scale(1) rotate(var(--r, 0deg));
    transition-delay: calc(var(--i) * 0.05s);
}

.story-content.visible .mao-wrapper {
    opacity: 0.85; /* 加深髦髦的顏色/能見度 (從0.5再加深調整為0.85) */
    transform: translateY(0) scale(1);
    transition-delay: calc(var(--i) * 0.05s);
}

/* ✨ 亮光掃過動畫 ✨ */
.story-content.visible .mao-wrapper::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    -webkit-mask-image: url("/uploads/髦.svg");
    -webkit-mask-size: 100% 100%;
    mask-image: url("/uploads/髦.svg");
    mask-size: 100% 100%;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.95) 50%, transparent 70%);
    background-position: 150% 0;
    background-size: 250% 100%;
    background-repeat: no-repeat;
    animation: shineSweep 4s infinite linear;
    animation-delay: calc(var(--i) * 0.05s + 1s);
    pointer-events: none;
}

@keyframes shineSweep {
    0% { background-position: 150% 0; }
    25% { background-position: -50% 0; }
    100% { background-position: -50% 0; }
}

.story-content.visible .welcome-title,
.story-content.visible .welcome-desc {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(var(--i) * 0.05s);
}

/* Float animation for the background letters */
.scatter-letter {
    animation: gentleScatterFloat 6s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.5s);
}

.line-float-btn:hover {
    transform: scale(1.05);
}

@keyframes gentleScatterFloat {
    0%, 100% { transform: translateY(0) scale(1) rotate(var(--r, 0deg)); }
    50% { transform: translateY(-15px) scale(1.05) rotate(calc(var(--r, 0deg) + 5deg)); }
}

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .scatter-letter { height: 40px; }
    .mao-wrapper { width: 90px; }
    .welcome-title { font-size: 2.2rem; letter-spacing: 2px; line-height: 1.5; }
    .welcome-desc { font-size: 1.4rem; font-weight: 600; letter-spacing: 1px; }
    .mao-twins { gap: 1rem; }
}

/* ========================================== */
/* ✨ Product Grid & Cards ✨ */
/* ========================================== */
#product-section {
    scroll-snap-align: start;
    scroll-margin-top: 80px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid #eee;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.card-image-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background-color: #ffffff;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
}

.card-img.active {
    opacity: 1;
    z-index: 2;
}

/* ✨ 滑鼠懸停放大效果 ✨ */
.card-image-box img {
    --rot: 0deg;
    /* 預設無旋轉 */
    transform: rotate(var(--rot));
    transition: transform 0.4s ease, opacity 0.5s ease-in-out;
}

.product-card:hover .card-image-box img {
    transform: scale(1.08) rotate(var(--rot));
}

.product-info {
    padding: 1.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: white;
    z-index: 2;
}

.product-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.product-info p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.btn-buy,
.btn-submit,
.checkout-btn,
.btn-add {
    background: rgb(2, 80, 119);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    font-size: 0.95rem;
    transition: background 0.2s;
    display: inline-block;
}

.btn-buy:hover,
.btn-submit:hover,
.checkout-btn:hover,
.btn-add:hover {
    background: var(--accent);
}

@media (max-width: 768px) {

    /* Larger touch targets for mobile */
    .btn-buy,
    .btn-submit,
    .checkout-btn,
    .btn-add {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
    }
}

.btn-add {
    width: 100%;
    font-size: 1.2rem;
    padding: 1rem;
    margin-top: 1rem;
}

/* ========================================== */
/* ✨ Product Detail Page ✨ */
/* ========================================== */
.detail-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    display: flex;
    gap: 2rem;
    flex-wrap: nowrap;
    /* Desktop: side by side */
}

@media (max-width: 768px) {
    .detail-card {
        flex-wrap: wrap;
        /* Mobile: stack */
        flex-direction: column;
        padding: 1rem;
    }
}

/* Swiper Carousel for Product Detail */
.product-swiper {
    flex: 1;
    min-width: 300px;
    border-radius: 10px;
    overflow: hidden;
    background: #eee;
    aspect-ratio: 1 / 1;
    --swiper-theme-color: #fff;
    --swiper-navigation-size: 20px;
}

.product-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Custom Navigation Buttons */
.product-swiper .swiper-button-prev,
.product-swiper .swiper-button-next {
    background: rgba(0, 0, 0, 0.25);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    backdrop-filter: blur(4px);
    transition: background 0.3s;
}

.product-swiper .swiper-button-prev:hover,
.product-swiper .swiper-button-next:hover {
    background: rgba(0, 0, 0, 0.5);
}

.product-swiper .swiper-button-prev:after,
.product-swiper .swiper-button-next:after {
    font-size: 16px;
    font-weight: bold;
}

.product-swiper .swiper-pagination-bullet {
    background: #fff;
    opacity: 0.5;
}

.product-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.2);
}

/* Old slideshow styles removed */

.info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.variant-group {
    margin-bottom: 1.5rem;
}

.variant-title {
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
    color: #555;
}

.variant-btn {
    padding: 8px 15px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px;
    margin-bottom: 10px;
    transition: 0.2s;
}

.variant-btn:hover {
    border-color: var(--accent);
}

.variant-btn.selected {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.variant-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9f9f9;
}

/* ========================================== */
/* ✨ Cart Page ✨ */
/* ========================================== */
.cart-container {
    max-width: 900px;
    margin: 2rem auto;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 1rem;
    text-align: left;
    background: #f2e9e6;
    color: #5e4b4b;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.cart-product-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e0d6d3;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-control button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    font-size: 20px;
    background: var(--accent);
    color: white;
    cursor: pointer;
}

.qty-control input {
    width: 45px;
    text-align: center;
    padding: 5px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.total-area {
    text-align: right;
    margin-top: 2rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.input-group {
    margin-top: 2rem;
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid #eee;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: 12px;
    margin-top: 1.5rem;
}

/* Cart Responsive */
@media (max-width: 600px) {
    .cart-container {
        padding: 1rem;
    }

    td {
        display: block;
        text-align: center;
        width: 100%;
    }

    td::before {
        /* Optional: Add labels for data if needed via data-label attribute */
        content: attr(data-label);
        float: left;
        font-weight: bold;
    }

    th {
        display: none;
    }

    .cart-product-img {
        margin-bottom: 10px;
    }

    .qty-control {
        justify-content: center;
    }

    .total-area {
        text-align: center;
    }
}

/* ========================================== */
/* ✨ About & Admin shared ✨ */
/* ========================================== */
.about-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 2rem;
}

@media (min-width: 769px) {
    .about-img {
        max-height: 500px;
        object-fit: cover;
    }
}

input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

/* ========================================== */
/* ✨ Category Scroll Bar (Desktop & Mobile) ✨ */
/* ========================================== */
.category-bar {
    display: none; /* Managed by JS */
    overflow-x: auto;
    gap: 12px;
    padding: 16px 2rem;
    background: var(--bg);
    position: sticky;
    top: 80px; /* desktop header height */
    z-index: 100;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .category-bar {
        top: 60px;
        padding: 12px 1rem;
        justify-content: flex-start;
        flex-wrap: nowrap;border-bottom: 1px solid #eee;
    }
}

.category-bar::-webkit-scrollbar {
    display: none;
}

.category-bar a {
    flex-shrink: 0;
    padding: 8px 20px;
    border: 2px solid var(--accent);
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--accent);
    background: white;
    white-space: nowrap;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.category-bar a:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.category-bar a.active {
    background: #e74c3c; /* 跳色/Pop color */
    color: white;
    border-color: #e74c3c;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

/* ========================================== */
/* ✨ [Mobile] Product Grid Redesign ✨ */
/* ========================================== */
@media (max-width: 768px) {
    #product-section {
        scroll-margin-top: 60px;
        margin: 0 auto;
        padding: 0.5rem 0.75rem;
    }

    #product-section #page-title {
        font-size: 1.1rem;
        font-weight: 500;
        letter-spacing: 2px;
        margin-bottom: 1rem;
        color: #333;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-card {
        border-radius: 8px;
        border: none;
        box-shadow: none;
        background: #fafafa;
    }

    .product-card:hover {
        transform: none;
        box-shadow: none;
    }

    .product-card:active {
        transform: scale(0.98);
    }

    .card-image-box {
        border-radius: 8px 8px 0 0;
        aspect-ratio: 4 / 5;
    }

    .product-info {
        padding: 0.8rem;
    }

    .product-info h3 {
        font-size: 0.9rem;
        font-weight: 500;
        margin-bottom: 0.3rem;
        line-height: 1.4;
    }

    .product-info p {
        font-size: 0.75rem;
        color: #999;
        margin-bottom: 0.5rem;
    }

    .product-info .btn-buy {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
        border-radius: 4px;
        background: var(--accent);
    }
}

/* ========================================== */
/* ✨ Back to Top Button ✨ */
/* ========================================== */
.back-to-top {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(34, 57, 90, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 44px;
    text-align: center;
    z-index: 500;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
    display: block;
}

.back-to-top:hover {
    background: rgba(34, 57, 90, 1);
    transform: translateY(-2px);
}

/* ========================================== */
/* ✨ [Mobile] Menu Overlay ✨ */
/* ========================================== */
.menu-overlay {
    display: none;
}

/* Hide close button on desktop */
.menu-close-btn {
    display: none;
}