/* HÀO DRINK — SỬA BỐ CỤC TRANG CHỦ TRÊN ĐIỆN THOẠI */
@media (max-width: 650px) {
    /* HEADER MOBILE — bố cục gọn, không chồng lấn */
    .header .header-container {
        width: calc(100% - 28px) !important;
        min-height: 0 !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto 42px !important;
        grid-template-areas:
            "logo user cart"
            "search search search"
            "nav nav nav" !important;
        align-items: center !important;
        column-gap: 12px !important;
        row-gap: 8px !important;
        padding: 10px 0 8px !important;
    }

    .header .header-container > .logo {
        grid-area: logo !important;
        display: inline-flex !important;
        align-items: center !important;
        min-width: 0 !important;
        font-size: clamp(18px, 5vw, 21px) !important;
        letter-spacing: 0 !important;
        white-space: nowrap !important;
        gap: 5px !important;
    }

    .header .header-container > .logo .logo-leaf {
        width: 27px !important;
        height: 27px !important;
        flex: 0 0 27px !important;
    }

    .header .header-container > .cart {
        grid-area: cart !important;
        justify-self: end !important;
        width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
        border-radius: 50% !important;
        position: relative !important;
    }

    .header .header-container > .cart span {
        display: none !important;
    }

    .header .header-container > .cart b {
        position: absolute !important;
        top: -4px !important;
        right: -4px !important;
        min-width: 18px !important;
        width: 18px !important;
        height: 18px !important;
        font-size: 10px !important;
    }

    .header .header-container > .header-search {
        grid-area: search !important;
        display: flex !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .header .header-search input {
        width: 100% !important;
        min-width: 0 !important;
        height: 42px !important;
        font-size: 14px !important;
    }

    .header .header-container > .navbar {
        grid-area: nav !important;
        order: initial !important;
        display: flex !important;
        width: 100% !important;
        min-width: 0 !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        gap: 18px !important;
        margin: 0 !important;
        padding: 0 0 3px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch;
    }

    .header .header-container > .navbar::-webkit-scrollbar {
        display: none !important;
    }

    .header .header-container > .navbar a {
        flex: 0 0 auto !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
        padding: 7px 0 !important;
        white-space: nowrap !important;
    }

    .header .header-container > .navbar a.active::after {
        bottom: 0 !important;
    }

    .header .header-container > #user-header {
        grid-area: user !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 88px !important;
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        margin: 0 !important;
        justify-self: end !important;
    }

    .header .user-header-guest,
    .header .user-header-admin {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        min-width: 0 !important;
    }

    .header .user-header-link,
    .header .user-header-admin-link,
    .header .user-header-logout,
    .header .user-header-admin-label {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 30px !important;
        padding: 0 6px !important;
        font-size: 10px !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
    }

    /* Banner: giảm chiều cao, không để nội dung đè nhau */
    
    /* FIX BANNER TRANG CHỦ TRÊN ĐIỆN THOẠI */
    .hero {
        min-height: 0 !important;
        background-position: center center !important;
        background-size: cover !important;
        background-repeat: no-repeat !important;
    }

    .hero .hero-container {
        width: calc(100% - 36px) !important;
        min-height: 0 !important;
        padding: 32px 0 150px !important;
        gap: 0 !important;
        text-align: center;
    }

    .hero .hero-content {
        width: 100% !important;
        min-width: 0 !important;
    }

    .hero h1 {
        font-size: clamp(28px, 7.5vw, 34px) !important;
        line-height: 1.25 !important;
    }

    .hero .hero-description {
        font-size: 14px !important;
        line-height: 1.65 !important;
    }

    .hero .hero-buttons {
        width: 100% !important;
        gap: 10px !important;
    }


    .hero .hero-buttons .btn {
        width: 100%;
        min-height: 45px;
        padding: 0 16px;
        font-size: 14px;
    }

    .hero .hero-image,
    .hero .hero-circle {
        display: none !important;
    }

    /* Các phần bên dưới không tràn ngang */
    .categories,
    .featured-products,
    .intro,
    .features {
        overflow: hidden;
    }

    .section-title {
        margin-bottom: 28px;
    }

    .section-title h2 {
        font-size: 26px;
        line-height: 1.25;
    }

    .featured-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .featured-card {
        min-width: 0;
    }

    .featured-image {
        height: 150px;
    }

    .featured-info {
        padding: 12px;
    }

    .featured-info h3 {
        font-size: 14px;
        line-height: 1.4;
    }

    .featured-info p {
        font-size: 12px;
        line-height: 1.5;
    }

    .featured-bottom {
        flex-wrap: wrap;
        gap: 8px;
    }

    .featured-bottom strong {
        font-size: 14px;
    }

    /* Tài khoản mobile: chỉ hiển thị biểu tượng, ẩn chữ để tránh tràn */
    /* Chỉ ẩn chữ đăng nhập, giữ biểu tượng tài khoản hiển thị */
    .header .user-header-link {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 32px !important;
        min-width: 32px !important;
        height: 32px !important;
        min-height: 32px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        overflow: visible !important;
        font-size: 16px !important;
        line-height: 1 !important;
    }

    .header .user-header-link .user-header-text {
        display: none !important;
    }

    .header .user-header-link .user-header-icon {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 18px !important;
        height: 18px !important;
        font-size: 16px !important;
        line-height: 1 !important;
        flex: 0 0 18px !important;
    }

    /* Giữ chữ các nút quản trị để chúng vẫn dễ nhận biết */
    .header .user-header-admin-link,
    .header .user-header-logout,
    .header .user-header-admin-label {
        font-size: 11px !important;
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 30px !important;
        padding: 0 6px !important;
        overflow: visible !important;
    }

}

@media (max-width: 380px) {
    .header .header-container {
        width: calc(100% - 22px) !important;
        column-gap: 6px !important;
    }

    .header .header-container > .logo {
        font-size: 17px !important;
    }

    .header .header-container > .logo .logo-leaf {
        width: 24px !important;
        height: 24px !important;
        flex-basis: 24px !important;
    }

    .header .header-container > .navbar {
        gap: 12px !important;
    }

    .header .header-container > .navbar a {
        font-size: 11px !important;
    }

    .header .user-header-link,
    .header .user-header-admin-link,
    .header .user-header-logout,
    .header .user-header-admin-label {
        font-size: 11px !important;
    }
}
