
/* ===== HEADER BASE ===== */
.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: 999;
    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: 15px; /* better spacing */
}

/* ===== LOGO (DYNAMIC SAFE) ===== */
.logo {
    flex: 0 1 300px;        /* controlled width */
    max-width: 300px;
    min-width: 120px;
}

.logo a {
    display: block;
    text-decoration: none;
}

/* TEXT LOGO */
.text-logo,
.text-logo-default {
    font-weight: 700;
    font-size: 17px;
    color: #2563eb;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 🔥 safe for dynamic text */
}

/* ===== NAV ===== */
.nav-links {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;

    flex-wrap: nowrap; /* 🔥 prevents breaking */
}

/* LINKS */
.nav-links a {
    text-decoration: none;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    position: relative;

    white-space: nowrap; /* 🔥 prevents "Contact Us" breaking */
}

/* HOVER */
.nav-links a:hover {
    color: #ff5722;
}

/* UNDERLINE */
.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;
}

.dropdown-menu-user {
    position: absolute;
    top: 45px;
    right: 0;
    background: #fff;
    width: 180px;
    display: none;
    flex-direction: column;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.user-dropdown.active .dropdown-menu-user {
    display: flex;
}

/* ===== HAMBURGER ===== */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle span {
    height: 3px;
    width: 25px;
    background: #333;
    margin: 3px 0;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {

    body {
        padding-top: 55px;
    }

    .main-header {
        min-height: 55px;
    }

    .menu-toggle {
        display: flex;
    }

    /* MOBILE MENU */
    .nav-links {
        position: fixed;
        top: 55px;
        right: -100%;
        width: 260px;
        height: calc(100vh - 55px);
        overflow-y: auto;

        background: #fff;
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        transition: 0.3s ease;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        width: 100%;
        font-size: 15px;
    }

    /* LOGO CONTROL */
    .logo {
        max-width: 60%;
    }

    .text-logo {
        font-size: 14px;
    }
}