* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* === HEADER === */
header {
    background-color: #2c3e50; /* Đậm hơn #00695c, phối với login */
    color: #ffffff;
    padding: 25px 0;
}

.header-container {
    max-width: 1400px;
    margin: auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: bold;
}

.logo a {
    color: #ffffff;
    text-decoration: none;
}

/* === NAVIGATION === */
.main-nav ul {
    margin-top: 20px;
    list-style: none;
    display: flex;
    gap: 30px;
    font-size: 1.5rem;
}

.main-nav a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #4a90e2; /* Hover xanh dương */
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: 1.3rem;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.3s;
}

.link-button:hover {
    color: #4a90e2;
}

/* === SEARCH BAR === */
.search-bar input {
    padding: 6px 10px;
    border: none;
    border-radius: 4px 0 0 4px;
    outline: none;
    background-color: #ffffff;
}

.search-bar button {
    padding: 6px 12px;
    border: none;
    background-color: #5c7d7a;
    color: #fff;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-bar button:hover {
    background-color: #4a6b68;
}

/* === AUTH BUTTONS === */
.auth-buttons a {
    margin-left: 10px;
    color: #ffffff;
    text-decoration: none;
    padding: 6px 12px;
    background-color: #5c7d7a;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.auth-buttons a:hover {
    background-color: #4a6b68;
}

/* === USER === */
.avatar-circle {
    width: 40px;
    height: 40px;
    background-color: #ffffff;
    color: #2c3e50;
    font-weight: bold;
    font-size: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    display: inline-block;
    margin-right: 30px;
}

.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.user-info {
    margin-right: -20px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.cart-icon {
    background: none !important;
    font-size: 24px;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important; /* ❗ bỏ padding tạo hình vuông */
    margin-left: 10px;
    display: inline-flex; /* gọn hơn flex full */
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    box-shadow: none !important;
    width: auto;
    height: auto;
    position: relative;
}

.cart-badge {
    position: absolute;
    bottom: 20px;   /* 👇 thay vì top */
    right: -8px;    /* góc phải */
    background-color: red;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    line-height: 1;
    z-index: 10;
}


.cart-icon:hover {
    color: #e0f2f1;
    background: none;
}

.greeting {
    color: #ffffff;
    margin-right: 10px;
    font-size: 1rem;
}

/* === DROPDOWN === */
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 50px;
    background-color: #e0f2f1; /* pastel xanh mint */
    min-width: 280px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    z-index: 1000;
    padding: 12px 12px;
    font-size: 1rem;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    color: #1c3d5a !important;
    text-decoration: none;
    padding: 8px 8px;
    transition: background-color 0.2s;
    margin: 0;
    gap: 15px;
    background-color: transparent;
}

.dropdown-menu a:hover {
    background-color: #b2dfdb;
}

.dropdown-menu a::before {
    display: inline-block;
    width: 17px;
    text-align: center;
    margin-right: 5px;
}
a.cart::before {
    content: "🛒";
}

.dropdown-menu a.edit::before {
    content: "✏️";
}
.dropdown-menu a.cart::before {
    content: "🛒";
}
.dropdown-menu a.payment::before {
    content: "💳";
}
.dropdown-menu a.logout::before {
    content: "🚪";
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .header-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 20px;
        text-align: center;
    }

    .main-nav ul {
        flex-wrap: wrap;
        gap: 20px;
        font-size: 1.2rem;
        justify-content: center;
    }

    .search-bar {
        width: 100%;
        margin-top: 10px;
    }

    .search-bar form {
        display: flex;
        width: 100%;
    }

    .search-bar input {
        flex-grow: 1;
    }

    .auth-buttons {
        width: 100%;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 10px;
    }

    .user-dropdown {
        width: 100%;
        justify-content: center;
    }

    .dropdown-menu {
        top: 45px;
        right: 0;
        min-width: 240px;
    }
}

@media (max-width: 600px) {
    .logo h1 {
        font-size: 1.5rem;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
        font-size: 1.1rem;
    }

    .main-nav ul li {
        width: 100%;
    }

    .search-bar input {
        font-size: 1rem;
    }

    .search-bar button {
        font-size: 1rem;
    }

    .greeting {
        font-size: 0.95rem;
    }

    .avatar-circle {
        width: 36px;
        height: 36px;
        font-size: 18px;
        line-height: 36px;
    }

    .dropdown-menu {
        min-width: 100%;
        top: 50px;
        font-size: 0.95rem;
    }

    .dropdown-menu a {
        padding: 10px 12px;
    }
}
