﻿html {
    position: relative;
    min-height: 100%;
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}


body {
    margin-bottom: 60px;
    background-color: white;
}



    .bk-image {
        background-image: url(/img/HOME-PC.jpg);
        background-size: cover;
    }

    @media (max-width: 768px) {
        .bk-image {
            background-image: url(/img/HOME-Phone.jpg);
        }
    }

    /* Mobile 版調整 */
    @media (max-width: 767px) {
        .navbar-brand-image {
            height: 28px !important;
        }
    }

    .navbar .navbar-nav .nav-link {
        min-height: 4rem;
    }



    @media (min-width: 768px) {
        .w-50 {
            width: 50% !important;
        }
    }


    @media (min-width: 992px) {
        .w-25 {
            width: 25% !important;
        }

        .navbar .navbar-nav .nav-link {
            min-height: 2rem;
        }
    }

    /*row 防止移動解析度太小的狀況下會跑位*/
    .row {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }


    /* ===== 底部導航欄 ===== */
    .nav {
        padding: 0.5rem 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1030;
    }

    .nav-link-bottom {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.5rem;
        color: #777c81;
        text-decoration: none;
        transition: all 0.3s ease;
        position: relative;
    }

        .nav-link-bottom:hover {
            color: #212121;
        }

        .nav-link-bottom .icon {
            margin-bottom: 0.25rem;
            stroke-width: 2;
            transition: stroke-width 0.3s ease;
        }

        .nav-link-bottom .nav-text {
            font-size: 0.75rem;
            line-height: 1.2;
            font-weight: 400;
            transition: font-weight 0.3s ease;
        }

        /* 選中狀態 */
        .nav-link-bottom.active {
            color: #212121;
        }

            /* 選中狀態 - SVG 圖標變粗 */
            .nav-link-bottom.active .icon {
                stroke-width: 2.5;
            }

            /* 選中狀態 - 文字變粗 */
            .nav-link-bottom.active .nav-text {
                font-weight: 700;
            }






    /* ===== 商品列表高度縮小（緊湊版 + 更小的數量選擇器） ===== */
    .product-group-item {
        border: 1px solid #dddddd9e;
    }


        .product-group-item .row {
            margin-left: -0.5rem;
            margin-right: -0.5rem;
        }

        .product-group-item .col-auto {
            padding-left: 0.5rem;
            padding-right: 0.5rem;
        }

        .product-group-item .avatar {
            border-radius: 30px !important;
        }

        .product-group-item .text-body {
            font-size: 0.875rem;
            line-height: 1.2;
        }



    /* ===== 其他調整 ===== */
    .form-control:focus {
        color: var(--tblr-body-color);
        background-color: var(--tblr-bg-forms);
        border-color: var(--tblr-border-color);
        box-shadow: unset;
    }


    .btn-self:hover {
        color: unset;
        background-color: var(--tblr-border-color);
        border-color: #b9bcbf;
    }

    .btn-self:checked + .btn, .btn-self.active, .btn-self.show, .btn-self:first-child:active, :not(.btn-self) + .btn-self:active {
        color: unset;
        background-color: var(--tblr-border-color);
        border-color: #b9bcbf;
        box-shadow: var(--tblr-btn-active-shadow);
    }



    /*調整中間整體寬度*/
    @media (min-width: 1400px) {
        .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
            max-width: 1200px;
        }
    }

    /* ===== 購物車徽章 ===== */
    .cart-badge-top {
        position: absolute;
        top: -8px;
        right: -10px;
        min-width: 20px;
        height: 20px;
        background: #ef4444;
        color: white;
        font-size: 11px;
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        padding: 0 5px;
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
        z-index: 10;
    }

    /* 響應式 */
    @media (max-width: 576px) {
        .cart-badge-top {
            top: -8px;
            right: -11px;
            min-width: 18px;
            height: 18px;
            font-size: 10px;
        }
    }

    /* 徽章跳動動畫 */
    .cart-badge-top.badge-scale {
        animation: badgeScale 0.6s ease;
    }

    @keyframes badgeScale {
        0%, 100% {
            transform: scale(1);
        }

        50% {
            transform: scale(1.3);
        }
    }




    /* ========================================
   搜尋框樣式（底線版）
   ======================================== */

    .search-input-wrapper-inline {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding-top: 4px;
    }

    .search-input-underline {
        flex: 1;
        border: none;
        border-bottom: 1px solid #d1d5db;
        padding: 0.5rem 0;
        font-size: 15px;
        background: transparent;
        outline: none;
        transition: border-color 0.2s;
    }

        .search-input-underline:focus {
            border-bottom-color: #1e293b;
        }

        .search-input-underline::placeholder {
            color: #9ca3af;
        }

    .search-icon-btn {
        border: none;
        background: none;
        padding: 0.25rem;
        cursor: pointer;
        color: #6c757d;
        transition: color 0.2s;
        display: flex;
        align-items: center;
    }

        .search-icon-btn:hover {
            color: #1e293b;
        }

    /* Navbar 模式切換 */
    .navbar-normal-mode,
    .navbar-search-mode {
        transition: opacity 0.2s;
        min-height: 64px;
    }

    /* Navbar 樣式 */
    .navbar.sticky-top {
        position: sticky;
        top: 0;
        z-index: 1040;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

/* Secondary Navbar (Desktop) - 緊接在主 navbar 下方 */
.secondary-navbar.sticky-top {
    position: sticky;
    top: 55px; /* 主 navbar 的高度 */
    z-index: 1030;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}


    .cart-badge-top {
        position: absolute;
        top: -9px;
        right: 0px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        font-size: 10px;
        line-height: 18px;
        border-radius: 9px;
        color: white;
    }

    @media (max-width: 767px) {
        .navbar-brand-image {
            height: 28px !important;
        }
    }


    @media (max-width: 767px) {
        #navbarNormal,
        #navbarSearchMode {
            padding-left: 0.75rem;
            padding-right: 0.75rem;
        }
    }



    /* step 樣式 */
    .circle-number {
        display: inline-block;
        width: 1.5em;
        height: 1.5em;
        line-height: 1.5em;
        border-radius: 50%;
        text-align: center;
        font-weight: bold;
        margin-right: 0.25em;
        font-size: 0.9em;
        color: white;
    }

        /* 狀態顏色 */
        .circle-number.gray {
            background-color: #bbbbbb;
        }

    .breadcrumb-item.disabled {
        color: #8d8c8c; /* 設定購物車文字顏色 */
    }

    .breadcrumb-item + .breadcrumb-item::before {
        content: ">";
        padding-right: 1rem;
        padding-left: 1rem;
        font-size: 1.5rem;
        line-height: 0.7;
        vertical-align: middle;
    }

    @media (max-width: 767px) {
        .breadcrumb-item + .breadcrumb-item::before {
            content: ">";
            padding-right: 0.5rem;
            padding-left: 0.5rem;
            font-size: 1rem;
        }
    }

    @media (max-width: 575.98px) {
        .breadcrumb {
            font-size: 11px;
        }
    }



    .card-header {
        justify-content: center;
    }



    /* ========================================
   加減數量按鈕及數量文字
   ======================================== */

    .btn-group {
        display: flex;
        align-items: center;
        box-shadow: none;
        gap: 4px;
    }

    /*數量*/
    .qty-input {
        width: 36px;
        border-left: 0;
        border-right: 0;
        border: none;
        box-shadow: none;
    }


    @media (max-width: 768px) {
        .qty-input {
            width: 50px;
        }
    }


    /*加減鍵*/
    .btn-circle {
        width: 30px;
        height: 30px;
        border-radius: 50% !important; /* 覆蓋 btn-group 規則 */
        display: flex;
        justify-content: center;
        align-items: center;
        border: none;
        background-color: #e1e1e1;
    }



    /*========sweetalert2=========*/
    /* Confirm 按鈕 */
    .swal2-confirm {
        background-color: #E95458 !important;
        box-shadow: 0 0 0 3px rgba(189, 45, 49, 0.5) !important;
    }

        /* Hover */
        .swal2-confirm:hover {
            background-color: #d94347 !important;
        }

        /* Focus（點擊後的藍框） */
        .swal2-confirm:focus {
            box-shadow: 0 0 0 3px rgba(189, 45, 49, 0.7) !important;
        }

        /* Active（按下瞬間） */
        .swal2-confirm:active {
            background-color: #c63a3e !important;
        }


    /*=========footer===========*/
    .footer-bk {
        background-color: #f9f9f9;
    }




/* ========================================
   Mobile 選單修正（完整版）
   ======================================== */
@media (max-width: 767px) {
    /* Secondary navbar 在 mobile 隱藏 */
    .secondary-navbar {
        display: none !important;
    }

    /* Mobile 選單容器 - 固定在主 navbar 下方 */
    .mobile-menu-wrapper {
        position: fixed;
        top: 55px; /* 主 navbar 高度 */
        left: 0;
        right: 0;
        z-index: 1035; /* 在主 navbar 下，但在內容上方 */
        background-color: transparent;
    }

        /* navbar-collapse 展開時的樣式 */
        .mobile-menu-wrapper .navbar-collapse {
            background-color: #fff;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            max-height: calc(100vh - 64px);
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
        }

            /* 確保選單項目可以點擊 */
            .mobile-menu-wrapper .navbar-collapse .navbar {
                padding: 0;
                position: relative;
                z-index: 1;
            }

        .mobile-menu-wrapper .nav-link {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid #f0f0f0;
            display: flex;
            align-items: center; 
            min-height: 56px;
            color: #212529;
            font-size: 15px;
            background-color: #fff;
            position: relative;
            z-index: 1;
        }
   

    /* 確保 page-wrapper 不被選單遮擋 */
    .page-wrapper {
        padding-top: 0;
        /*margin-top: 64px;*/ /* 主 navbar 高度 */
    }

    /* 當選單展開時，防止背景滾動 */
    body.navbar-collapse-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    /* 當選單展開時，添加遮罩層 */
    .navbar-collapse.show::before {
        content: '';
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

/* ========================================
   Desktop 時的調整
   ======================================== */
@media (min-width: 768px) {
    .page-wrapper {
        padding-top: 0;        
    }

    /* 確保內容不被 sticky navbars 遮擋 */
    .page-body {
        position: relative;
    }
}