/* Hide default headers and navigation */
.the_content_wrapper .woocommerce-MyAccount-navigation,
.mfn-header-tmpl-menu-sidebar-wrapper,
.mfn-header-tmpl {
    display: none !important;
}

/* Force #Content to stay below header on account pages */
body.woocommerce-account #Content {
    position: relative !important;
    z-index: 1 !important;
}

/* Custom MyAccount Header */
.mfn-myaccount-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999 !important;
    background: #ffffff;
    /*box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);*/
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #F2F4F7;
}

/* Admin bar offset - position header below admin bar */
.admin-bar .mfn-myaccount-header {
    top: 32px;
}

/* Header Container - 70% width, centered */
.myaccount-header-container {
    width: 80%;
    max-width: 1260px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Left: Menu Icon */
.myaccount-header-left {
    flex: 0 0 auto;
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 8px;
}

.menu-icon {
    width: 24px;
    height: 24px;
    display: block;
}

/* Center: Logo */
.myaccount-header-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.myaccount-logo {
    display: inline-block;
    max-height: 40px;
    text-decoration: none;
}

.myaccount-logo img {
    max-height: 40px;
    height: auto;
    width: auto;
    display: block;
}

.myaccount-logo .site-name {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* Right: Notification Icon */
.myaccount-header-right {
    flex: 0 0 auto;
}

.notification-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-toggle svg {
    color: #333;
}

/* Body padding for fixed header */
body.woocommerce-account {
    padding-top: 60px;
}

body.admin-bar.woocommerce-account {
    padding-top: 92px;
}

/* Slide-in Menu Panel */
.myaccount-menu-panel {
    position: fixed;
    top: 60px;
    left: -280px;
    width: 280px;
    height: calc(100vh - 60px);
    background: #ffffff;
    z-index: 10001;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

/* Admin bar offset for menu panel */
.admin-bar .myaccount-menu-panel {
    top: 92px; /* 32px admin bar + 60px header */
    height: calc(100vh - 92px);
}

.myaccount-menu-panel.active {
    left: 0;
}

.menu-panel-header {
    padding: 20px;
    /*border-bottom: 1px solid #eee;*/
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-title {
    margin: 0;
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
    color: #21316A;
}

.menu-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    color: #21316A;
    text-decoration: none;
    display: none;
    align-items: center;
    justify-content: center;
}

.menu-close:hover {
    color: #21316A;
    opacity: 0.7;
}

.menu-panel-nav {
    padding: 20px;
}

.menu-panel-nav .woocommerce-MyAccount-navigation {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    border: none !important;
}

.menu-panel-nav .woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border: none !important;
}

.menu-panel-nav .woocommerce-MyAccount-navigation ul li {
    margin-bottom: 4px;
    border: none !important;
}

.menu-panel-nav .woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 12px 15px;
    color: #21316A;
    font-size: 16px;
    text-decoration: none;
    border-radius: 5px;
    border: none !important;
    transition: background 0.2s ease;
}

.menu-panel-nav .woocommerce-MyAccount-navigation ul li.is-active a {
    background: #1270DE05;
    color: #1270DE;
    border: none !important;
}

.menu-panel-nav .woocommerce-MyAccount-navigation ul li a:hover {
    background: #f5f5f5;
    color: #1270DE;
}

/* Overlay */
.myaccount-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.myaccount-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive */
@media (max-width: 782px) {
    /* WordPress admin bar is 46px on mobile */
    .admin-bar .mfn-myaccount-header {
        top: 46px;
    }
    
    body.admin-bar.woocommerce-account {
        padding-top: 106px;
    }
    
    .admin-bar .myaccount-menu-panel {
        top: 106px; /* 46px admin bar + 60px header */
        height: calc(100vh - 106px);
    }
    
    .myaccount-header-container {
        width: 90%;
    }
}

@media (max-width: 700px) {
    .menu-close {
        display: flex;
    }
    
    .myaccount-menu-panel {
        left: -100%;
        width: 100%;
    }
}
