﻿/* =========================================
           共用 CSS
        ========================================= */
.custom-brand {
    display: flex;
    align-items: center;
}

body {
    font-family: "Noto Sans TC";
    top: 0 !important;
    position: static !important; /* 修正被 Google 翻譯往下推的問題 */
}

.boius {
    border-radius: 3rem;
}

.navbar {
    position: relative;
    background-color: #ffffff; /* 必須有實心背景色，陰影才不會透過去 */
    transition: box-shadow 0.3s ease-in-out; /* 陰影漸變效果 */
}

    /* 現代瀏覽器支援：當 mega-dropdown 被 hover 時，Navbar 產生下陰影 */
    .navbar:has(.mega-dropdown:hover),
    .navbar.navbar-shadow-active { /* 給舊版瀏覽器的 JS 備用 Class */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
        z-index: 1055;
    }

.navbar-nav .nav-item {
    margin: 0 0.5rem;
}

.navbar-nav .nav-link {
    position: relative;
    color: #000;
    font-size: 16px;
    font-weight: 400;
    padding: 0.5rem 1rem;
}

.nav-tools {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
}

.btn-lang {
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 2px 12px;
    color: #999;
    text-decoration: none;
    font-size: 0.9rem;
    background: transparent;
    transition: all 0.3s;
    cursor: pointer;
}

    .btn-lang:hover {
        border-color: #e85a64;
        color: #e85a64;
    }

.btn-search {
    border: none;
    background: none;
    padding: 0;
    color: #ccc;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s;
}

    .btn-search:hover {
        color: #e85a64;
    }

.dropdown-menu {
    min-width: 80px;
    border-radius: 10px;
}

.dropdown-item {
    text-align: center;
    padding: 0.5rem 1rem;
}

    .dropdown-item:hover {
        background-color: #f8f9fa;
        color: #e85a64;
    }

/* Mega Menu 共用 */
.navbar .mega-dropdown {
    position: static !important;
}

.navbar .mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    margin-top: 0;
    padding: 30px 0;
    border: none;
    border-radius: 0;
    background-color: #fcfcfc;
    display: none;
    z-index: 1050;
}

.mega-link {
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 0;
    transition: all 0.3s ease;
}

    .mega-link:hover {
        color: #e60012 !important;
        transform: translateX(5px);
    }

/* =========================================
           桌機版 CSS
        ========================================= */
@media (min-width: 992px) {
    .custom-brand {
        margin-left: auto;
        padding-left: 13%;
    }

    .logo-img {
        height: auto;
        max-width: 85%;
    }

    .navbar-nav .nav-link::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 3px;
        background-color: #FABE00;
        transition: width 0.3s ease, left 0.3s ease;
    }

    .navbar-nav .nav-item:hover .nav-link::after {
        width: 100%;
        left: 0;
    }

    .navbar .mega-dropdown:hover .mega-menu {
        display: block;
        animation: fadeIn 0.3s ease-in-out;
    }

    /* 加入 上方內陰影 與 底部懸浮陰影 */
    .navbar .mega-menu {
        border-top: 1px solid #f0f0f0;
        box-shadow: inset 0 8px 10px -8px rgba(0, 0, 0, 0.15), /* 模擬 Navbar 壓在上面的立體感 */
        0 12px 24px rgba(0, 0, 0, 0.05); /* 底部外陰影：脫離背景的懸浮感 */
    }

        .navbar .mega-menu::before {
            content: "";
            position: absolute;
            top: -45px;
            left: 0;
            width: 100%;
            height: 45px;
            background: transparent;
        }
}

/* =========================================
           手機 / 平板 CSS
        ========================================= */
@media (max-width: 991px) {
    .navbar > .container-fluid {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
    }

    /* Logo */
    .custom-brand {
        order: 2;
        margin: 0;
        padding-left: 0 !important;
    }

    .logo-img {
        width: auto;
        height: 70px;
        max-height: 70px;
    }

    /* 漢堡按鈕靠左 */
    .navbar-toggler {
        order: 1;
        margin: 0 10px 0 0 !important;
        padding: 0.25rem 0.5rem;
        align-self: center;
    }

    /* 展開內容在下一行 */
    .navbar-collapse {
        order: 3;
        width: 100%;
    }

    /* 主選單 */
    .navbar-nav {
        text-align: left;
        margin-top: 20px;
    }

        .navbar-nav .nav-item {
            margin: 0;
        }

        .navbar-nav .nav-link {
            display: block;
            padding: 12px 0;
        }

            .navbar-nav .nav-link::after {
                display: none !important;
            }

    /* 手機版不要顯示桌機 mega menu */
    .mega-dropdown {
        display: none !important;
    }

    /* 手機版企業概要 submenu */
    .mobile-submenu {
        display: block;
        width: 100%;
    }

    .mobile-submenu-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: rgb(0 0 0 / 55%);
        text-decoration: none !important;
        padding: 12px 0;
    }

    .mobile-submenu-list {
        display: none;
        width: 100%;
        text-align: left;
        padding-left: 0;
        margin-top: 0.25rem;
    }

        .mobile-submenu-list.show {
            display: block;
        }

    .mobile-submenu-item {
        display: block;
        color: #000 !important;
        padding: 10px 0 10px 1.5rem;
        font-size: 16px;
        font-weight: 400;
        border-bottom: 1px solid #eee;
        text-decoration: none !important;
    }

        .mobile-submenu-item:hover,
        .mobile-submenu-item:focus,
        .mobile-submenu-item:active {
            color: #000 !important;
            text-decoration: none !important;
        }

    /* 右側工具區 */
    .nav-tools {
        margin-left: 0;
        margin-top: 1rem;
        justify-content: center;
        width: 100%;
    }
}

/* =========================================
           動畫
        ========================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
           隱藏 Google 翻譯預設樣式
        ========================================== */
.goog-te-banner-frame.skiptranslate,
iframe.skiptranslate {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    border: none !important;
}

.goog-tooltip,
.goog-tooltip:hover,
.goog-logo-link {
    display: none !important;
}

.goog-text-highlight {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.goog-te-gadget {
    color: transparent !important;
}

/* 右下角「回到最上方」小箭頭 */
#backToTopBtn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #E60012;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
    transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}

    #backToTopBtn.show {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    #backToTopBtn:hover {
        transform: translateY(-2px);
    }

/* 商品頁有底部酒類警語時，將回到最上方按鈕移到警語上方 */
@supports selector(body:has(.alcohol-warning-bar)) {
    body:has(.alcohol-warning-bar) #backToTopBtn {
        bottom: calc(110px + 24px + env(safe-area-inset-bottom));
    }

    body:has(.alcohol-warning-bar[style*="display: none"]) #backToTopBtn {
        bottom: 24px;
    }
}

@supports selector(body:has(.alcohol-warning-bar)) {
    @media (max-width: 576px) {
        body:has(.alcohol-warning-bar) #backToTopBtn {
            right: 16px;
            bottom: calc(80px + 16px + env(safe-area-inset-bottom));
        }

        body:has(.alcohol-warning-bar[style*="display: none"]) #backToTopBtn {
            bottom: 16px;
        }
    }

    @media (min-width: 1200px) {
        body:has(.alcohol-warning-bar) #backToTopBtn {
            bottom: calc(120px + 24px + env(safe-area-inset-bottom));
        }
    }
}
