/* ===== ����˦� ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ===== Top Banner ===== */
.top-banner {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    color: white;
    padding: 8px 0;
    font-size: 14px;
}

.top-banner .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.banner-content {
    display: flex;
    gap: 30px;
}

.banner-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 500;
    transition: opacity 0.3s;
}

.banner-link:hover {
    opacity: 0.9;
}

.banner-link i.fa-tag,
.banner-link i.fa-gift {
    font-size: 16px;
}

.banner-link i.fa-chevron-right {
    font-size: 12px;
}

.banner-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.banner-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.language-selector {
    position: relative;
}

.lang-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.3s;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.share-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 16px;
    transition: opacity 0.3s;
}

.share-btn:hover {
    opacity: 0.8;
}

/* ===== Main Header ===== */
.main-header {
    background: var(--primary-color);
    padding: 15px 0;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* 漢堡選單按鈕 */
.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.sidebar-toggle-btn:active {
    transform: scale(0.95);
}

/* 手機版隱藏漢堡選單按鈕 */
@media (max-width: 768px) {
    .sidebar-toggle-btn {
        display: none !important;
    }
}

/* Logo */
.logo {
    flex-shrink: 0;
}

.logo-text {
    font-size: 32px;
    font-weight: 700;
    color: white;
    letter-spacing: -1px;
    font-family: 'Georgia', 'Times New Roman', serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Search Bar */
.search-container {
    flex: 1;
    max-width: 600px;
}

.search-form {
    position: relative;
    display: flex;
}

.search-input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    color: #666;
    font-size: 18px;
    transition: color 0.3s;
}

.search-btn:hover {
    color: var(--primary-color);
}

/* User Actions */
.user-actions {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-shrink: 0;
}

.user-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
    transition: opacity 0.3s;
}

.user-link:hover {
    opacity: 0.8;
}

.user-link i {
    font-size: 20px;
}

.cart-link {
    position: relative;
    color: white;
    font-size: 24px;
    transition: opacity 0.3s;
}

.cart-link:hover {
    opacity: 0.8;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff5722;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    /* 預設隱藏，直到 JavaScript 明確顯示 */
    display: none;
}

/* ===== 手機版語系選單 ===== */
/* ==================== 語系切換 ==================== */

/* 電腦版語系選擇器 */
.desktop-language-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.desktop-language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.desktop-language-btn:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-soft);
}

.desktop-language-btn i {
    font-size: 16px;
}

.desktop-language-btn .current-lang {
    font-weight: 600;
}

/* 電腦版語系下拉選單 */
.desktop-language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.desktop-language-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.desktop-language-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #333;
}

.desktop-language-item:hover {
    background: #f8f8f8;
}

.desktop-language-item.active {
    background: var(--bg-primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

.desktop-language-check {
    width: 16px;
    font-size: 14px;
    color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.desktop-language-item.active .desktop-language-check {
    opacity: 1;
}

/* 桌面版隱藏手機版語系選單 */
.mobile-language-selector {
    display: none;
}

/* 語系選單彈出層 */
.mobile-language-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-language-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-language-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 2001;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.mobile-language-menu.active {
    transform: translateY(0);
}

.mobile-language-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-language-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.mobile-language-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-language-close:active {
    background: #e0e0e0;
    transform: scale(0.95);
}

.mobile-language-list {
    overflow-y: auto;
    padding: 10px 0;
}

.mobile-language-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
}

.mobile-language-item:active {
    background: #f8f8f8;
}

.mobile-language-check {
    font-size: 18px;
    color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-language-item.active .mobile-language-check {
    opacity: 1;
}

.mobile-language-name {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

.mobile-language-item.active .mobile-language-name {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== Main Content ===== */
.main-content {
    min-height: calc(100vh - 400px);
}

/* ===== Footer ===== */
.main-footer {
    margin-top: 60px;
    background: linear-gradient(to bottom, #f5f5f5 0%, #eeeeee 100%);
}

/* 頁腳連結區 */
.footer-content-grid {
    display: flex;
    justify-content: space-between;
    gap: 50px;
    padding: 20px 0 0px;
    border-bottom: 1px solid #ddd;
}

/* 頁腳區塊 */
.footer-section h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-darker);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-primary);
    display: inline-block;
    letter-spacing: 1.5px;
}

.footer-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.footer-section ul li a {
    color: #555;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
    padding-left: 0;
    letter-spacing: 0.8px;
}

.footer-section ul li a::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.25s ease;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-section ul li a:hover::before {
    width: 100%;
}

/* 聯繫資訊 */
.footer-section .contact-list li {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #555;
    font-size: 14px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    margin-bottom: 18px;
    transition: all 0.25s ease;
    letter-spacing: 0.8px;
    line-height: 1.8;
}

.footer-section .contact-list li:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(5px);
}

.footer-section .contact-list li i {
    color: var(--primary-color);
    width: 18px;
    font-size: 14px;
}

/* 支付方式 */
.footer-payment-section {
    padding: 25px 0;
    border-bottom: 1px solid #ddd;
}

.footer-payment-section .payment-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-payment-section .payment-icons i {
    font-size: 40px;
    padding: 10px 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.25s ease;
}

.footer-payment-section .payment-icons i:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.footer-payment-section .payment-icons i.fa-cc-mastercard {
    color: #eb001b;
}

.footer-payment-section .payment-icons i.fa-cc-visa {
    color: #1a1f71;
}

.footer-payment-section .payment-icons i.fa-cc-paypal {
    color: #003087;
}

/* 版權聲明 */
.footer-copyright-section {
    padding: 25px 0 15px;
    text-align: center;
}

.footer-copyright-section p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.footer-copyright-section strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== 響應式設計 ===== */
@media (max-width: 1200px) {
    .banner-content {
        gap: 20px;
    }

    /* Footer 響應式 */
    .footer-content-grid {
        gap: 40px;
    }
}

@media (max-width: 992px) {
    .banner-content {
        flex-direction: column;
        gap: 8px;
    }

    .top-banner .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .banner-right {
        width: 100%;
        justify-content: space-between;
    }

    .search-container {
        max-width: 100%;
    }

    /* Footer 響應式 */
    .footer-content-grid {
        flex-wrap: wrap;
        gap: 30px;
    }

    .footer-section {
        flex: 1 1 150px;
    }

    /* 平板裝置：下拉選單調整 */

    .submenu-item {
        padding: 10px 20px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .top-banner {
        font-size: 12px;
    }

    .banner-link {
        font-size: 12px;
    }

    .header-content {
        gap: 10px;
    }

    .logo-text {
        font-size: 20px;
    }

    .search-container {
        flex: 1;
        min-width: 0;
    }

    .user-actions {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* 手機版隱藏購物車按鈕 */
    .user-actions .cart-link {
        display: none !important;
    }

    /* 手機版隱藏電腦版語系切換 */
    .desktop-language-selector {
        display: none !important;
    }

    /* 手機版語系切換按鈕 */
    .mobile-language-selector {
        display: flex;
        align-items: center;
    }

    .mobile-language-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: white;
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.3s ease;
        white-space: nowrap;
    }

    .mobile-language-btn:active {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(0.95);
    }

    .mobile-language-btn i {
        font-size: 16px;
    }

    .mobile-language-btn .current-lang {
        font-weight: 600;
        font-size: 13px;
    }

    /* Footer 手機版 */
    .main-footer {
        padding: 30px 0 20px;
    }

    .footer-content-grid {
        flex-direction: column;
        gap: 25px;
        text-align: center;
    }

    .footer-section {
        flex: 1 1 100%;
    }

    .footer-section .contact-list li {
        justify-content: center;
    }

    .footer-payment-section {
        text-align: center;
    }

    .footer-payment-section .payment-icons {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .banner-content {
        font-size: 11px;
    }

    .banner-right {
        flex-wrap: wrap;
        gap: 10px;
    }

    .logo-text {
        font-size: 20px;
    }

    .search-input {
        padding: 10px 45px 10px 15px;
        font-size: 13px;
    }

    .user-link span {
        display: none;
    }

    .cart-badge {
        font-size: 10px;
        padding: 1px 4px;
    }
}

/* ===== �ʵe�ĪG ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 無障礙設計 ===== */
button:focus,
a:focus,
input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== SweetAlert2 高 z-index 樣式 ===== */
.swal-high-z-index {
    z-index: 10000 !important;
}

.swal2-container.swal-high-z-index {
    z-index: 10000 !important;
}

/* ===== �C�L�˦� ===== */
@media print {

    .top-banner,
    .main-header,
    .main-footer {
        display: none;
    }
}

/* ===== 美洽客服按鈕位置調整 ===== */
/* 覆蓋美洽客服插件的預設位置 */
.ehSxKT,
[class*="MeiqiaBtn"],
iframe[title*="meiqia"],
div[id*="meiqia"] {
    bottom: 140px !important;
    right: 10px !important;
}

/* 手機版客服按鈕位置 */
@media (max-width: 768px) {
    .ehSxKT,
    [class*="MeiqiaBtn"],
    iframe[title*="meiqia"],
    div[id*="meiqia"] {
        bottom: 140px !important;
        right: 10px !important;
    }
}