/* 
 * Sticky Header Fix for JD Consult Template - Joomla 5
 * 專門修復 sticky header 功能的 CSS 檔案
 * Created: 2025-06-14
 */

/* 重要：覆蓋任何可能衝突的樣式 */
#sp-header.menu-fixed {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    width: 100% !important;
    background: #CB9B42 !important;
    box-shadow: 0 3px 3px rgba(0,0,0,0.25) !important;
    transition: all 0.4s ease !important;
}

/* 確保在 menu-fixed 狀態下選單文字是白色 */
#sp-header.menu-fixed .sp-megamenu-parent > li > a {
    color: #fff !important;
}

#sp-header.menu-fixed .sp-megamenu-parent > li > a::before {
    background: #fff !important;
}

#sp-header.menu-fixed #offcanvas-toggler > i {
    color: #4F3005 !important;
}

/* nav-placeholder 確保頁面不會跳動 */
.nav-placeholder {
    width: 100% !important;
    display: block !important;
}

/* 動畫效果 */
#sp-header.animated {
    transition: all 0.4s ease !important;
}

#sp-header.menu-fixed-out {
    position: relative !important;
    transition: all 0.4s ease !important;
}

/* 確保在 boxed layout 下也正常工作 */
.layout-boxed #sp-header.menu-fixed {
    max-width: 1240px !important;
    margin: 0 auto !important;
    left: 0 !important;
    right: 0 !important;
}

/* 手機版本調整 */
@media (max-width: 767px) {
    #sp-header.menu-fixed {
        position: fixed !important;
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }
}

/* 調試用：暫時加上明顯的標記 */
#sp-header.menu-fixed {
    border-top: 3px solid red !important; /* 調試用，成功後可移除 */
}
