body {
    font-family: "Segoe UI", sans-serif;
    margin: 0;
    color: #333;
}

/* Header chung */
header {
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: white;
    padding: 12px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.4em;
    font-weight: bold;
    display: flex;
    gap: 10px;
    align-items: center;
}

.logo a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

nav {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

nav a:hover {
    text-decoration: underline;
}

/* Thanh tìm kiếm */
.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 25px;
    padding: 6px 12px;
    width: 400px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border-radius: 25px;
}

.search-box i {
    color: #667eea;
    font-size: 16px;
    margin-right: 8px;
}

/* Nút hành động (Tài khoản, giỏ hàng) */
.header-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.cart-badge {
    position: relative;
    display: inline-block;
}

.cart-badge a i {
    color: white;
}

.cart-badge sup {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff4757;
    color: white;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

/* Dropdown tài khoản */
.account-menu {
    position: relative;
    cursor: pointer;
}

.account-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 150%;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    z-index: 1001;
    overflow: hidden;
}

.dropdown-content.show {
    display: block;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.dropdown-content a:hover {
    background-color: #f5f3ff;
    color: #7158e2;
}

.dropdown-content a i {
    width: 16px;
    text-align: center;
}

/* Tablet và Mobile */
@media (max-width: 768px) {

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 20px;
    }

    /* 1) Logo giữ nguyên, nằm trên cùng */
    .logo {
        width: 100%;
        justify-content: center;
    }

    /* 2) Menu đưa xuống dưới logo và căn giữa */
    nav {
        width: 100%;
        justify-content: center;
        order: 2;
        gap: 14px;
    }

    /* 3) Search + Action đưa xuống cuối và xếp theo hàng */
    .search-box {
        width: 100%;
        order: 3;
        margin: 0 auto;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
        order: 4;
    }
}

/* Màn hình rất nhỏ */
@media (max-width: 480px) {
    nav a {
        font-size: 14px;
    }

    .search-box input {
        font-size: 13px;
    }
}