/* ==========================================
   EMDY HEADER.CSS - FIXED FULL VERSION
   Sửa lỗi:
   - Tài khoản dẫn đúng account/index.php trong header.php
   - Đơn hàng dẫn đúng account/orders.php trong header.php
   - Dropdown header không ảnh hưởng sidebar tài khoản
========================================== */

*{
    box-sizing: border-box;
}

body{
    margin: 0;
    font-family: "Times New Roman", Times, serif;
}

/* ==========================================
   HEADER MAIN
========================================== */

.emdy-header{
    position: sticky;
    top: 0;
    z-index: 99999;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
    transition: 0.3s ease;
}

.emdy-header.is-scrolled{
    box-shadow: 0 12px 35px rgba(255,46,116,0.14);
}

.emdy-header-container{
    width: min(1400px, 92%);
    margin: 0 auto;
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 28px;
}

/* ==========================================
   LOGO
========================================== */

.emdy-logo{
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ff2e74;
    font-size: 22px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.emdy-logo img{
    width: 58px;
    height: 58px;
    object-fit: contain;
}

/* ==========================================
   NAVIGATION
========================================== */

.emdy-nav{
    flex: 1;
}

.emdy-nav-list{
    list-style: none;
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 0;
    margin: 0;
}

.emdy-nav-list a{
    color: #222;
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s;
}

.emdy-nav-list a:hover{
    color: #ff2e74;
}

/* ==========================================
   ACTIONS
========================================== */

.emdy-actions{
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

/* ==========================================
   SEARCH
========================================== */

.emdy-search{
    width: 270px;
    height: 46px;
    display: flex;
    align-items: center;
    border-radius: 50px;
    background: #fff0f6;
    overflow: hidden;
    border: 1px solid rgba(255,46,116,0.12);
}

.emdy-search input{
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 0 16px;
    font-family: inherit;
}

.emdy-search button{
    width: 48px;
    height: 100%;
    border: none;
    background: #ff2e74;
    color: white;
    cursor: pointer;
}

/* ==========================================
   CART
========================================== */

.emdy-cart{
    position: relative;
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 50%;
    background: #fff0f6;
    color: #ff2e74;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: 0.3s;
    flex: 0 0 auto;
}

.emdy-cart:hover{
    background: #ff2e74;
    color: white;
}

.emdy-cart span{
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #222;
    color: white;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   LOGIN / REGISTER
========================================== */

.emdy-login,
.emdy-register{
    height: 44px;
    border-radius: 50px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: 0.3s;
}

.emdy-login{
    color: #ff2e74;
    background: #fff0f6;
}

.emdy-register{
    color: white;
    background: linear-gradient(135deg,#ff7aa5,#ff2e74);
}

.emdy-login:hover,
.emdy-register:hover{
    transform: translateY(-3px);
}

/* ==========================================
   HEADER ACCOUNT DROPDOWN
   Scope bằng .emdy-header .emdy-actions để KHÔNG ảnh hưởng
   sidebar .emdy-account-menu trong trang tài khoản.
========================================== */

.emdy-header .emdy-actions .emdy-account{
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: max-content;
    z-index: 999999;
}

.emdy-header .emdy-actions .emdy-account::after{
    content: "";
    position: absolute;
    left: -8px;
    right: -8px;
    top: 100%;
    height: 10px;
    display: block;
}

.emdy-header .emdy-actions .emdy-account-button{
    height: 46px;
    min-width: 118px;
    padding: 0 18px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    color: white;
    background: linear-gradient(135deg,#ff7aa5,#ff2e74);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(255,46,116,0.16);
    transition: 0.25s;
}

.emdy-header .emdy-actions .emdy-account-button:hover{
    transform: translateY(-2px);
}

.emdy-header .emdy-actions .emdy-account-menu{
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    padding: 8px;
    border-radius: 20px;
    background: white;
    border: 1px solid rgba(255,46,116,0.16);
    box-shadow: 0 18px 45px rgba(255,46,116,0.18);
    display: none;
    z-index: 9999999;
}

.emdy-header .emdy-actions .emdy-account:hover .emdy-account-menu,
.emdy-header .emdy-actions .emdy-account:focus-within .emdy-account-menu{
    display: grid;
    gap: 4px;
}

.emdy-header .emdy-actions .emdy-account-menu a{
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    color: #21151b;
    background: #fff3f8;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.15;
    transition: 0.22s ease;
}

.emdy-header .emdy-actions .emdy-account-menu a:hover,
.emdy-header .emdy-actions .emdy-account-menu a.active{
    color: white;
    background: linear-gradient(135deg,#ff7aa5,#ff2e74);
}

.emdy-header .emdy-actions .emdy-account-menu a.logout{
    color: #b42318;
    background: #fff0ef;
}

.emdy-header .emdy-actions .emdy-account-menu a.logout:hover{
    color: white;
    background: #b42318;
}

/* ==========================================
   MOBILE MENU TOGGLE
========================================== */

.emdy-menu-toggle{
    display: none;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: #ff2e74;
    color: white;
    cursor: pointer;
}

/* ==========================================
   CATEGORY NAV
========================================== */

.emdy-category-nav{
    background: white;
    border-top: 1px solid #ffe0eb;
    border-bottom: 1px solid #ffe0eb;
    overflow-x: auto;
    position: relative;
    z-index: 50;
}

.emdy-category-wrapper{
    width: min(1400px, 92%);
    margin: 0 auto;
    display: flex;
    gap: 18px;
    padding: 16px 0;
}

.emdy-category-item{
    min-width: 170px;
    padding: 10px 14px;
    border-radius: 18px;
    background: #fff8fb;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #222;
    transition: 0.3s;
}

.emdy-category-item:hover{
    background: #ff2e74;
    color: white;
    transform: translateY(-3px);
}

.emdy-category-item img{
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: cover;
}

.emdy-category-item span{
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.emdy-category-item small{
    margin-left: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    color: #ff2e74;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}

/* ==========================================
   RESPONSIVE
========================================== */

@media(max-width:1100px){
    .emdy-search{
        width: 220px;
    }

    .emdy-register{
        display: none;
    }
}

@media(max-width:900px){
    .emdy-header-container{
        min-height: 72px;
    }

    .emdy-menu-toggle{
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .emdy-nav{
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: white;
        padding: 25px 6%;
        box-shadow: 0 15px 35px rgba(0,0,0,0.12);
        transform: translateY(-140%);
        transition: 0.35s;
    }

    .emdy-nav.active{
        transform: translateY(0);
    }

    .emdy-nav-list{
        flex-direction: column;
        align-items: flex-start;
    }

    .emdy-actions{
        margin-left: auto;
    }

    .emdy-search{
        display: none;
    }

    .emdy-login{
        display: none;
    }
}

@media(max-width:700px){
    .emdy-header .emdy-actions .emdy-account-button{
        min-width: 54px;
        padding: 0 16px;
    }

    .emdy-header .emdy-actions .emdy-account-button span{
        display: none;
    }

    .emdy-header .emdy-actions .emdy-account-menu{
        width: 185px;
        min-width: 185px;
        max-width: 185px;
    }
}

@media(max-width:600px){
    .emdy-logo span{
        display: none;
    }

    .emdy-category-item{
        min-width: 145px;
    }
}
