* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    background: #f8f9fa;
}


.main-header {
    width: 100%;
    min-height: 60px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    transition: 0.3s ease;
}

/* ===== CONTAINER ===== */
.container-custom {
    max-width: 1200px;
    margin: auto;
    padding: 0 20px;
}

/* ===== FLEX ===== */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    gap: 10px;
}

/* ===== LOGO ===== */
.logo {
    flex: 1;
    max-width: 70%;
    overflow: hidden;
}

.logo a {
    text-decoration: none;
    display: block;
}

.text-logo,
.text-logo-default {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== NAV ===== */
.nav-links {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    position: relative;
}

.nav-links a:hover {
    color: #ff5722;
}

.nav-links a::after {
    content: "";
    position: absolute;
    width: 0%;
    height: 2px;
    background: #ff5722;
    bottom: -3px;
    left: 0;
    transition: 0.3s;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* ===== CART ===== */
.cart-link {
    position: relative;
}

#cartCount {
    position: absolute;
    top: -6px;
    right: -10px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ff5722;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
}

/* ===== LOGIN ===== */
.btn-login {
    background: #ff5722;
    color: #fff !important;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
}

/* ===== DROPDOWN ===== */
.user-dropdown {
    position: relative;
}

/* Trigger */
.user-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Dropdown Box */
.dropdown-menu-user {
    position: absolute;
    top: 45px;
    right: 0;
    background: #fff;
    width: 200px;

    display: flex;
    flex-direction: column;

    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);

    overflow: hidden; /* 🔥 FIX spacing issue */

    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;

    transition: all 0.25s ease;
    z-index: 2100;
}

/* Show dropdown */
.user-dropdown.active .dropdown-menu-user {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Links + Buttons */
.dropdown-menu-user a,
.dropdown-menu-user button {
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

/* Hover effect */
.dropdown-menu-user a:hover,
.dropdown-menu-user button:hover {
    background: #f5f5f5;
}

/* Logout button */
.logout-btn {
    border-top: 1px solid #eee;
}


/* ===== HAMBURGER ===== */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 2100;
}

.menu-toggle span {
    height: 3px;
    width: 25px;
    background: #333;
    margin: 3px 0;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {

    .main-header {
        min-height: 55px;
    }

    .menu-toggle {
        display: flex;
    }

    .logo {
        max-width: 65%;
    }

    .text-logo {
        font-size: 15px !important;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 20px 20px;
        gap: 15px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 2001;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links a {
        width: 100%;
        font-size: 15px;
        padding: 10px 0;
        text-align: center;
        border-bottom: 1px solid #eee;
    }

    /* Mobile dropdown */
    .dropdown-menu-user {
        position: static;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        display: none;
    }

    .user-dropdown.active .dropdown-menu-user {
        display: flex;
    }
}