/*
Theme Name: ePay365 By 均造源源
Theme URI: https://gg100gg.com
Author: Your Name
Author URI: https://gg100gg.com
Description: A brief description of your theme.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: theme-textdomain
*/

.mainBlock img{display:block;width: 100vw;}
html, body, div, section, p, a{box-sizing: border-box;margin: 0;
    
  font-family: "Poppins", sans-serif;
  font-weight: 200;
  font-style: normal;
}
.woocommerce img, .woocommerce-page img{height:40px;}
    
.Wpagebanner img {
    width: 100%;
}

/* 導航選單樣式 - navigation.css */

/* 基礎重置和變數 */
:root {
    --nav-bg-color: #2c3e50;
    --nav-text-color: #ffffff;
    --nav-hover-color: #3498db;
    --nav-border-color: #34495e;
    --nav-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --nav-transition: all 0.3s ease;
    --nav-height: 70px;
    --nav-z-index: 1000;
}

/* 主要導航容器 */
.custom-navigation {
    background-color: #e0dfdf;
    box-shadow: var(--nav-shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--nav-z-index);
    height: var(--nav-height);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo 區域 */
.nav-logo {
    flex-shrink: 0;
}

.logo-link {
    display: inline-block;
    text-decoration: none;
    transition: var(--nav-transition);
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    color: var(--nav-text-color);
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
}

/* 桌面版選單 */
.nav-menu-desktop {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 40px;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: #464444;
    text-decoration: none;
    font-weight: 300;
    font-size: 16px;
    padding: 10px 0;
    display: block;
    transition: var(--nav-transition);
    position: relative;
}

.nav-menu a:hover,
.nav-menu a:focus {
    color: #5a773b;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #5a773b;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a:focus::after {
    width: 100%;
}

/* 子選單 */
.nav-menu .sub-menu {
       position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border: none;
    border-radius: 8px;
    box-shadow: var(--nav-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--nav-transition);
    z-index: 1001;
    list-style: none;
    padding: 0 0 0 12px;
    min-width: 150px;
}

.nav-menu li:hover .sub-menu,
.nav-menu li:focus-within .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu a {
    padding: 12px 20px;
    border-bottom: 1px solid var(--nav-border-color);
}

.nav-menu .sub-menu a:last-child {
    border-bottom: none;
}

/* 右側工具列 */
.nav-tools {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-toggle,
.mobile-menu-toggle {
    background: none;
    border: none;
    color: var(--nav-text-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: var(--nav-transition);
}

.search-toggle:hover,
.search-toggle:focus,
.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
    background-color: var(--nav-hover-color);
    color: white;
}

.language-switcher {
    color: var(--nav-text-color);
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: var(--nav-transition);
}

.language-switcher:hover {
    background-color: var(--nav-hover-color);
}

/* 漢堡選單 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background-color: var(--nav-text-color);
    transition: var(--nav-transition);
    transform-origin: center;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* 手機版選單 */
.nav-menu-mobile {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--nav-bg-color);
    border-top: 1px solid var(--nav-border-color);
    box-shadow: var(--nav-shadow);
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
}

.nav-menu-mobile.active {
    display: block;
}

.mobile-menu {
    list-style: none;
    margin: 0;
    padding: 20px;
}

.mobile-menu li {
    border-bottom: 1px solid var(--nav-border-color);
}

.mobile-menu a {
    color: var(--nav-text-color);
    text-decoration: none;
    font-size: 18px;
    padding: 15px 0;
    display: block;
    transition: var(--nav-transition);
}

.mobile-menu a:hover {
    color: var(--nav-hover-color);
    padding-left: 10px;
}

/* 搜尋覆蓋層 */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: var(--nav-transition);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-field {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-field:focus {
    border-color: var(--nav-hover-color);
}

.search-submit {
    background-color: var(--nav-hover-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 15px;
    cursor: pointer;
    transition: var(--nav-transition);
}

.search-submit:hover {
    background-color: #2980b9;
}

.search-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.search-close:hover {
    color: #333;
}

/* 響應式設計 - 768px */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 15px;
    }
    
    /* 隱藏桌面版選單 */
    .nav-menu-desktop {
        display: none;
    }
    
    /* 顯示手機版選單按鈕 */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* 調整工具列間距 */
    .nav-tools {
        gap: 15px;
    }
    
    /* Logo 尺寸調整 */
    .logo-image {
        height: 35px;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    /* 語言切換文字縮小 */
    .language-text {
        font-size: 14px;
    }
    
    /* 搜尋容器調整 */
    .search-container {
        width: 95%;
        padding: 20px;
    }
    
    /* 手機版選單樣式調整 */
    .mobile-menu {
        padding: 15px;
    }
    
    .mobile-menu a {
        font-size: 16px;
        padding: 12px 0;
    }
    
    /* 導航高度調整 */
    :root {
        --nav-height: 60px;
    }
}

/* 無障礙改善 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高對比度模式 */
@media (prefers-contrast: high) {
    :root {
        --nav-bg-color: #000000;
        --nav-text-color: #ffffff;
        --nav-hover-color: #ffff00;
        --nav-border-color: #ffffff;
    }
}

/* 深色模式支援 */
@media (prefers-color-scheme: dark) {
    :root {
        --nav-bg-color: #1a1a1a;
        --nav-text-color: #ffffff;
        --nav-hover-color: #4a9eff;
        --nav-border-color: #333333;
    }
}



/* 導航選單增強樣式 - navigation_enhanced.css */

/* 隱藏/顯示導航動畫 */
.custom-navigation {
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.custom-navigation.nav-hidden {
    transform: translateY(-100%);
}

/* 滾動時的樣式變化 */
.custom-navigation.nav-scrolled {
    background-color: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 子選單右對齊樣式 */
.nav-menu .sub-menu.align-right {
    left: auto;
    right: 0;
}

/* 載入動畫 */
.custom-navigation {
    opacity: 0;
    animation: fadeInNav 0.6s ease-out 0.2s forwards;
}

@keyframes fadeInNav {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo 懸停效果增強 */
.logo-link {
    position: relative;
    overflow: hidden;
}

.logo-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.logo-link:hover::before {
    left: 100%;
}

/* 選單項目進場動畫 */
.nav-menu li {
    opacity: 0;
    animation: slideInFromTop 0.6s ease-out forwards;
}

.nav-menu li:nth-child(1) { animation-delay: 0.1s; }
.nav-menu li:nth-child(2) { animation-delay: 0.2s; }
.nav-menu li:nth-child(3) { animation-delay: 0.3s; }
.nav-menu li:nth-child(4) { animation-delay: 0.4s; }
.nav-menu li:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 手機版選單動畫增強 */
.nav-menu-mobile {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.nav-menu-mobile.active {
    transform: translateX(0);
}

.mobile-menu li {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.3s ease-out;
}

.nav-menu-mobile.active .mobile-menu li {
    opacity: 1;
    transform: translateX(0);
}

.nav-menu-mobile.active .mobile-menu li:nth-child(1) { transition-delay: 0.1s; }
.nav-menu-mobile.active .mobile-menu li:nth-child(2) { transition-delay: 0.15s; }
.nav-menu-mobile.active .mobile-menu li:nth-child(3) { transition-delay: 0.2s; }
.nav-menu-mobile.active .mobile-menu li:nth-child(4) { transition-delay: 0.25s; }
.nav-menu-mobile.active .mobile-menu li:nth-child(5) { transition-delay: 0.3s; }

/* 漢堡選單動畫增強 */
.hamburger-line {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mobile-menu-toggle:hover .hamburger-line {
    background-color: var(--nav-hover-color);
}

/* 搜尋覆蓋層動畫 */
.search-overlay {
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: all 0.3s ease-out;
}

.search-overlay.active {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.search-container {
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.search-overlay.active .search-container {
    transform: scale(1) translateY(0);
}

/* 搜尋欄位焦點效果 */
.search-field {
    position: relative;
}

.search-field:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    transform: scale(1.02);
}

/* 工具按鈕脈衝效果 */
.search-toggle,
.language-switcher {
    position: relative;
}

.search-toggle::after,
.language-switcher::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.search-toggle:active::after,
.language-switcher:active::after {
    width: 40px;
    height: 40px;
}

/* 子選單動畫增強 */
.nav-menu .sub-menu {
    transform-origin: top center;
    animation: none;
}

.nav-menu li:hover .sub-menu,
.nav-menu li:focus-within .sub-menu {
    animation: dropDown 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes dropDown {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 載入完成後的樣式 */
body.loaded .custom-navigation {
    opacity: 1;
}

body.loaded .nav-menu li {
    animation-play-state: running;
}

/* 高性能模式 - 減少動畫 */
@media (prefers-reduced-motion: reduce) {
    .custom-navigation,
    .nav-menu-mobile,
    .search-overlay,
    .search-container,
    .hamburger-line,
    .logo-link,
    .nav-menu li,
    .mobile-menu li {
        animation: none !important;
        transition: none !important;
    }
    
    .custom-navigation {
        opacity: 1;
    }
    
    .nav-menu li,
    .mobile-menu li {
        opacity: 1;
        transform: none;
    }
}

/* 深色主題變數覆蓋 */
@media (prefers-color-scheme: dark) {
    .search-container {
        background-color: #2c3e50;
        color: #ffffff;
    }
    
    .search-field {
        background-color: #34495e;
        border-color: #4a6741;
        color: #ffffff;
    }
    
    .search-field::placeholder {
        color: #bdc3c7;
    }
    
    .search-close {
        color: #bdc3c7;
    }
    
    .search-close:hover {
        color: #ffffff;
    }
}

/* 高對比度模式增強 */
@media (prefers-contrast: high) {
    .nav-menu a::after {
        height: 3px;
    }
    
    .search-field:focus {
        box-shadow: 0 0 0 3px #ffff00;
        border-color: #ffffff;
    }
    
    .hamburger-line {
        height: 3px;
    }
}

/* 大螢幕優化 */
@media (min-width: 1400px) {
    .nav-container {
        max-width: 1400px;
    }
    
    .nav-menu {
        gap: 50px;
    }
    
    .nav-menu a {
        font-size: 17px;
    }
}

/* 小螢幕優化 */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 10px;
    }
    
    .nav-tools {
        gap: 10px;
    }
    
    .search-container {
        padding: 15px;
        width: 98%;
    }
    
    .mobile-menu {
        padding: 10px;
    }
    
    .logo-image {
        height: 30px;
    }
    
    .logo-text {
        font-size: 18px;
    }
}

/* 列印樣式 */
@media print {
    .custom-navigation {
        position: static !important;
        box-shadow: none;
        background: transparent !important;
    }
    
    .nav-menu-mobile,
    .search-overlay,
    .mobile-menu-toggle,
    .search-toggle {
        display: none !important;
    }
    
    .nav-menu a {
        color: #000000 !important;
    }
    
    .nav-menu a::after {
        display: none;
    }
}

/* 觸控裝置優化 */
@media (hover: none) and (pointer: coarse) {
    .nav-menu a:hover::after {
        display: none;
    }
    
    .nav-menu a:active::after {
        width: 100%;
    }
    
    .logo-link:hover::before {
        display: none;
    }
    
    .search-toggle,
    .mobile-menu-toggle,
    .language-switcher {
        min-height: 44px;
        min-width: 44px;
    }
}

/* 極小螢幕優化 */
@media (max-width: 320px) {
    :root {
        --nav-height: 50px;
    }
    
    .logo-image {
        height: 25px;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .search-toggle,
    .mobile-menu-toggle {
        padding: 6px;
    }
    
    .hamburger-line {
        width: 18px;
    }
}

/* 橫向模式手機優化 */
@media (max-height: 500px) and (orientation: landscape) {
    .nav-menu-mobile {
        max-height: calc(100vh - 50px);
    }
    
    .mobile-menu {
        padding: 10px;
    }
    
    .mobile-menu a {
        padding: 8px 0;
        font-size: 16px;
    }
}

/* 可訪問性增強 */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Skip link 樣式 */
.skip-link {
    background-color: #21759b;
    color: #ffffff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 0 0 3px 3px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.skip-link:focus {
    color: #ffffff;
    background-color: #d54e21;
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Body 狀態類別 */
body.mobile-menu-open {
    overflow: hidden;
}

body.search-open {
    overflow: hidden;
}

/* 效能優化 */
.custom-navigation,
.nav-menu-mobile,
.search-overlay {
    will-change: transform;
}

.hamburger-line,
.nav-menu a::after {
    will-change: transform, width;
}

/* 當 JavaScript 被禁用時的後備樣式 */
.no-js .mobile-menu-toggle {
    display: none;
}

.no-js .nav-menu-desktop {
    display: block !important;
}

.no-js .nav-menu-mobile {
    display: block;
    position: static;
    background: none;
    border: none;
    box-shadow: none;
}

/* 動畫預載入防閃爍 */
.preload * {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
}