/**
 * TT Customer header v1.6.30 — compact account dropdown and header actions.
 * Scoped to desktop header so the mobile navigation remains unchanged.
 */
@media (min-width: 768px) {
    .header__extra {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 14px;
    }
    .header__extra > .header__extra__cell {
        float: none;
        flex: 0 1 auto;
        width: auto;
        min-width: 0;
        padding: 0;
    }
    .header__account__button > a,
    .header__cart .header__cart__button {
        display: inline-flex !important;
        align-items: center;
        gap: 8px;
        min-height: 34px;
        max-width: 100%;
        text-decoration: none;
    }
    .header__account__icon,
    .header__cart .header__cart__icon,
    .header__cart .header__cart__button .header__cart__icon {
        float: none;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
        line-height: 1;
        margin-right: 0;
        border-radius: 5px;
    }
    .header__account__icon .fa,
    .header__cart .header__cart__icon .fa {
        font-size: 16px !important;
        line-height: 1;
    }
    .header__account__content,
    .header__cart__content {
        min-width: 0;
        padding-top: 0;
    }
    .header__account__content h4,
    .header__cart__content h4 {
        margin: 0 0 2px;
        font-size: 14px;
        line-height: 16px;
        font-weight: 700;
        white-space: nowrap;
    }
    .header__account__content p,
    .header__cart__content p {
        margin: 0;
        font-size: 12px;
        line-height: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .header__account .ttcm-theme-customer-name { max-width: 145px; }
    .header__cart__content p { max-width: 158px; }
}

/* v1.6.34: Khóa kích thước giỏ hàng ở mọi trạng thái hover/focus.
 * CSS cũ trong style.css đặt icon 38px khi hover, còn header mới dùng 32px.
 * Chỉ giới hạn ở giỏ hàng desktop, giữ hiệu ứng đổi màu hiện tại. */
@media (min-width: 768px) {
    .header .header__cart .header__cart__button .header__cart__icon,
    .header .header__cart:hover .header__cart__button .header__cart__icon,
    .header .header__cart .header__cart__button:is(:hover, :focus, :focus-visible, :active) .header__cart__icon {
        box-sizing: border-box;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex: 0 0 32px !important;
        width: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1;
        border-radius: 5px;
        transform: none !important;
        transition: background-color .18s ease, color .18s ease;
    }
    .header .header__cart .header__cart__icon .fa,
    .header .header__cart:hover .header__cart__icon .fa,
    .header .header__cart .header__cart__button:is(:hover, :focus, :focus-visible, :active) .header__cart__icon .fa {
        display: block;
        font-size: 16px !important;
        line-height: 16px !important;
        transform: none !important;
    }
}

/* Dropdown của khách đã đăng nhập: thu nhỏ độc lập với form của khách vãng lai. */
.header__account.ttcm-theme-account .header__account__menu {
    left: auto;
    right: 0;
    top: calc(100% + 9px);
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
    padding: 7px !important;
    border: 1px solid #e9e9e9;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .11);
    overflow: visible;
}
.header__account.ttcm-theme-account--logged-in .header__account__menu {
    width: 260px;
    min-width: 260px !important;
}
.header__account.ttcm-theme-account--guest .header__account__menu {
    width: 335px;
    min-width: 335px !important;
}
.header__account.ttcm-theme-account .header__account__menu::before {
    left: auto;
    right: 18px;
}
.header__account.ttcm-theme-account .header__account__menu > li { list-style: none; }
.header__account.ttcm-theme-account .header__account__menu > li > a {
    display: flex !important;
    align-items: center;
    min-height: 34px;
    padding: 7px 10px !important;
    border-radius: 5px;
    font-size: 14px;
    line-height: 20px !important;
    font-weight: 400;
}
.header__account.ttcm-theme-account:focus-within .header__account__menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.header__account.ttcm-theme-account .ttcm-header-logout {
    margin: 4px 0 0;
    padding: 5px 0 0;
    border-top: 1px solid #eeeeee;
}
.header__account.ttcm-theme-account .ttcm-header-logout button {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #b42318;
    font-size: 14px;
    line-height: 20px;
    text-align: left;
    cursor: pointer;
}
.header__account.ttcm-theme-account .ttcm-header-logout button:hover,
.header__account.ttcm-theme-account .ttcm-header-logout button:focus-visible {
    color: #8f160d;
    background: #fff4f1;
    text-decoration: none;
}
/* Giữ dropdown chưa đăng nhập đủ chỗ cho form đăng ký/đăng nhập. */
.header__account.ttcm-theme-account .ttcm-theme-auth-panel {
    padding: 10px 0 0 !important;
    border-top: 1px solid #eee;
    max-height: 70vh;
    overflow-y: auto;
}
.header__account .ttcm-header-more {
    min-height: 0 !important;
    padding: 7px !important;
    white-space: normal !important;
    text-align: center !important;
}
/* Tên tài khoản trên thanh header mobile. */
.header-mb .ttcm-theme-mobile-customer {
    position: absolute;
    top: 46px;
    right: 51px;
    max-width: 125px;
    padding: 3px 8px;
    border: 1px solid #eee;
    border-radius: 0 0 7px 7px;
    background: #fff;
    box-shadow: 0 2px 5px #0001;
    color: #333;
    font-size: 12px;
    line-height: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 767px) {
    .header-mb .ttcm-theme-mobile-customer { display: block; }
}
@media (min-width: 768px) {
    .header-mb .ttcm-theme-mobile-customer { display: none; }
}
@media (min-width: 768px) and (max-width: 991px) {
    .header__account .ttcm-theme-customer-name { display: none; }
    .header__extra { gap: 10px; }
}

/* Header top: white text on inner pages */
#tl-home-shell .topbar, #tl-home-shell .topbar a, #tl-home-shell .topbar span, #tl-home-shell .topbar p, #tl-home-shell .topbar .ic {color:#fff;}

/* Shared topbar text and hotline on inner pages. */
#tl-home-shell .topbar,
#tl-home-shell .topbar a,
#tl-home-shell .topbar span,
#tl-home-shell .topbar p,
#tl-home-shell .topbar .ic,
#tl-home-shell .topbar-hotline,
#tl-home-shell .topbar-hotline > a,
#tl-home-shell .topbar-hotline > a:hover { color: #fff; }
#tl-home-shell .topbar,
#tl-home-shell .topbar a,
#tl-home-shell .topbar span,
#tl-home-shell .topbar p { font-size: 14px; }
