/**
 * Header Design Improvements
 * Fixes alignment, spacing, and styling issues in the header
 */

/* User Account Button Styling - icon with name */
.header-right_area .user-account-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    padding: 0 10px;
    min-width: auto;
}

/* Show user name text next to icon */
.header-right_area .user-account-btn .user-name-text {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    margin-left: 8px;
    line-height: 1.2;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: none;
    letter-spacing: 0;
    color: inherit;
}

/* Ensure icons are properly aligned */
.header-bottom_area.header-bottom_area-2 .header-right_area > ul > li > a {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
}

/* User account button - horizontal layout for icon + name */
.header-bottom_area.header-bottom_area-2 .header-right_area > ul > li > a.user-account-btn {
    flex-direction: row;
}

.header-bottom_area.header-bottom_area-2 .header-right_area > ul > li > a > i {
    font-size: 24px;
    line-height: 1;
    margin-bottom: 0;
}

/* User account icon specific styling */
.header-right_area .user-account-btn > i,
.header-right_area .auth-login-btn > i {
    font-size: 24px;
    line-height: 1;
}

/* Badge positioning improvements - positioned right above icons */
.header-right_area .wishlist-count,
.header-right_area .cart-count,
.header-right_area .minicart-count {
    position: absolute;
    top: 18px;
    right: 12px;
    background-color: #ff6b6b;
    color: #ffffff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    min-width: 18px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
    pointer-events: none;
}

/* Ensure parent links are positioned relatively for absolute badge positioning */
.header-right_area .wishlist-btn,
.header-right_area .minicart-btn {
    position: relative;
}

/* Responsive badge positioning */
@media (max-width: 1199px) {
    .header-right_area .wishlist-count,
    .header-right_area .cart-count,
    .header-right_area .minicart-count {
        top: 18px;
        right: 8px;
    }
}

@media (max-width: 767px) {
    .header-right_area .wishlist-count,
    .header-right_area .cart-count,
    .header-right_area .minicart-count {
        top: 22px;
        right: 8px;
    }
}

/* Hide badges when count is 0 */
.wishlist-count:empty,
.cart-count:empty,
.minicart-count:empty,
.wishlist-count[style*="display: none"],
.cart-count[style*="display: none"],
.minicart-count[style*="display: none"] {
    display: none !important;
}

/* Show badges when count is greater than 0 */
.wishlist-count:not(:empty):not([style*="display: none"]),
.cart-count:not(:empty):not([style*="display: none"]),
.minicart-count:not(:empty):not([style*="display: none"]) {
    display: inline-flex !important;
}

/* Icon hover effects - consistent across all icons */
.header-bottom_area.header-bottom_area-2 .header-right_area > ul > li > a:hover {
    color: #cda557 !important;
    transition: color 0.3s ease;
}

.header-bottom_area.header-bottom_area-2 .header-right_area > ul > li > a:hover > i {
    color: #cda557;
}

/* Spacing between icons */
.header-bottom_area.header-bottom_area-2 .header-right_area > ul > li {
    margin: 0;
    padding: 0;
}

/* Ensure proper vertical alignment for all toolbar items */
.header-right_area > ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-right_area > ul > li {
    display: flex;
    align-items: center;
    height: 100%;
}

/* Dropdown menu styling for user account - hidden by default */
.header-right_area .dropdown-holder .hm-dropdown {
    position: absolute;
    background: #ffffff;
    min-width: 150px;
    padding: 10px 0;
    right: 0;
    left: auto;
    transform-origin: 0 0 0;
    transform: scaleY(0);
    box-shadow: 0 1px 2px 2px rgba(0, 0, 0, 0.2);
    z-index: 99;
    transition: all 0.3s ease-in-out;
}

/* Show dropdown on hover */
.header-right_area .dropdown-holder:hover .hm-dropdown {
    transform: scaleY(1);
}

.header-right_area .dropdown-holder .hm-dropdown li a {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
    border-bottom: none;
}

.header-right_area .dropdown-holder .hm-dropdown li a i {
    margin-right: 8px;
    font-size: 16px;
}

.header-right_area .dropdown-holder .hm-dropdown li a:hover {
    background-color: #f8f8f8;
    color: #cda557;
}

/* Remove border from last dropdown item */
.header-right_area .dropdown-holder .hm-dropdown li:last-child a {
    border-bottom: none;
    padding-bottom: 10px;
}

/* User icon with name - adjust width to accommodate name */
.header-right_area .user-account-btn {
    width: auto;
    min-width: 70px;
    height: 85px;
    line-height: 85px;
    padding: 0 15px;
}

@media only screen and (min-width: 992px) and (max-width: 1199px) {
    .header-right_area .user-account-btn {
        min-width: 50px;
        padding: 0 10px;
    }
    
    .header-right_area .user-account-btn .user-name-text {
        max-width: 80px;
        font-size: 12px;
        margin-left: 6px;
    }
}

@media (max-width: 479px) {
    .header-right_area .user-account-btn {
        min-width: 50px;
        padding: 0 8px;
    }
    
    .header-right_area .user-account-btn .user-name-text {
        max-width: 60px;
        font-size: 11px;
        margin-left: 5px;
    }
}

/* Responsive adjustments */
@media (max-width: 1199px) {
    .header-bottom_area.header-bottom_area-2 .header-right_area > ul > li > a {
        width: 50px;
    }
    
    .header-right_area .user-account-btn {
        width: auto;
        min-width: 50px;
    }
}

@media (max-width: 767px) {
    .header-right_area .user-account-btn .user-name-text {
        max-width: 50px;
        font-size: 11px;
    }
    
    .header-right_area .user-account-btn {
        min-width: 50px;
        padding: 0 5px;
    }
}

@media (max-width: 575px) {
    .header-right_area .user-account-btn .user-name-text {
        display: none;
    }
    
    .header-right_area .user-account-btn {
        width: 50px;
        padding: 0;
    }
}

