/* === HEADER.CSS — clone giao diện header của Rito === */

#heading {
    --header-bg: #222222;
    --header-icon-bg: #000000;
    --header-accent: #f5c001;
    --header-accent-hover: #d16500;
    --header-menu-hover-bg: rgba(255, 255, 255, 0.08);
    --header-border: #f5c001;
    --header-text: #ffffff;
    font-family: "Neue Frutiger World", Tahoma, sans-serif;
}

body.has-mobile-bottom-nav {
    padding-bottom: 0;
}

#heading {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    transition: 0.2s;
    background-color: var(--header-bg);
}

header nav.heading {
    position: relative;
    background-color: var(--header-bg);
    box-shadow: 0 2px rgba(0, 0, 0, 0.05);
}

header nav.heading .header-container {
    height: 64px;
    display: flex;
    align-items: center;
    max-width: 1264px;
    margin: 0 auto;
    justify-content: space-between;
}

.box-logo img {
    width: 140px;
}

.header-action-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

#heading .header-contact-btn,
#heading .header-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 118px;
    height: 40px;
    padding: 0 16px;
    font-weight: 700;
    white-space: nowrap;
}

#heading .header-contact-btn {
    border: 1px solid rgba(245, 192, 1, 0.72);
    background: rgba(245, 192, 1, 0.08);
    color: #f5c001;
}

#heading .header-contact-btn:hover {
    border-color: #f5c001;
    background: rgba(245, 192, 1, 0.16);
    color: #fff0b0;
}

.desktop-contact-float {
    position: fixed;
    right: 12px;
    bottom: 24px;
    z-index: 999999;
    width: 60px;
}

.desktop-contact-float-btn {
    width: 60px;
    height: 60px;
    margin-top: 8px;
    border-radius: 60px;
    display: block;
    overflow: visible;
    text-decoration: none;
    box-shadow: rgba(0, 0, 0, 0.15) 0 4px 12px 0;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.desktop-contact-float-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.desktop-contact-float-btn:first-child {
    margin-top: 0;
}

.desktop-contact-float-image {
    display: block;
    width: 60px;
    height: 60px;
    border-radius: 60px;
}

.box-viewed {
    align-items: center;
    gap: 8px;
}

.box-icon {
    background-color: var(--header-icon-bg);
    width: 40px;
    height: 40px;
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.box-icon img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.header-icon-img {
    width: 25px;
    height: 25px;
    object-fit: contain;
}

.header-icon-light {
    filter: brightness(0) invert(1);
}

.icon-viewed {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.mobile-da-xem {
    width: 30px;
    height: 30px;
}

.box-icon-text,
.box-icon-text:hover {
    color: var(--header-text);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0;
}

.box-icon i {
    color: var(--header-text);
    font-size: 1rem;
}

.header-mobile-link {
    text-decoration: none;
}

.header-mobile-link i {
    color: #f5c001;
    font-size: 17px;
}

/* Search */
.box-search {
    width: 280px;
    max-width: 100%;
}

.form-search {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

.form-search input[type="search"] {
    font-weight: 400;
    font-size: 13px;
    line-height: 20px;
    padding: 10px 4px 10px 12px;
    background-color: var(--header-icon-bg);
    border-radius: 8px;
    border: none;
    width: 100%;
    color: var(--header-text);
}

.form-search input[type="search"]::placeholder {
    color: var(--text-blur);
}

.form-search input[type="search"]:focus {
    outline: none;
    border: 1px solid var(--header-border);
    padding: 9px 3px 9px 11px;
}

.form-search input[type="search"].has-submit {
    padding-right: 44px;
}

.form-search input[type="search"].has-submit:focus {
    padding-right: 43px;
}

.form-search .btn-search-rito {
    background-color: var(--header-accent);
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    border: none;
    outline: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.form-search .btn-search-rito:hover {
    background-color: var(--header-accent-hover);
}

.form-search .btn-search-icon {
    width: 16px;
    height: 16px;
    display: block;
    filter: brightness(0) invert(1);
}

#mobileSearchModal .modal-dialog {
    max-width: 420px;
}

.mobile-search-modal .modal-content {
    border-radius: 18px;
    border: 1px solid rgba(245, 192, 1, 0.14);
    background: #090909;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
}

.mobile-search-modal .modal-header,
.mobile-search-modal .modal-body {
    border-color: rgba(255, 255, 255, 0.08);
    background: #090909;
}

.mobile-search-modal .modal-title {
    color: #f5c001;
    font-size: 22px;
    font-weight: 800;
}

.mobile-search-modal-subtitle {
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
    line-height: 1.6;
}

.mobile-search-form {
    width: 100%;
}

.mobile-search-form input[type="search"] {
    min-height: 50px;
    padding: 14px 50px 14px 14px;
    border: 1px solid rgba(245, 192, 1, 0.18);
    background: #121212;
    color: #ffffff;
    font-size: 16px;
    line-height: 1.4;
    -webkit-text-fill-color: #ffffff;
    caret-color: #f5c001;
    opacity: 1;
}

.mobile-search-form input[type="search"]::placeholder {
    color: rgba(255, 255, 255, 0.56);
    -webkit-text-fill-color: rgba(255, 255, 255, 0.56);
}

.mobile-search-form input[type="search"]:focus {
    border-color: rgba(245, 192, 1, 0.42);
    background: #171717;
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    box-shadow: 0 0 0 0.18rem rgba(245, 192, 1, 0.12);
}

.mobile-search-form .btn-search-rito {
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.box-viewed.recent-viewed-trigger {
    padding: 0;
    border: 0;
    background: transparent;
}

.box-icon.recent-viewed-trigger {
    padding: 0;
    border: 0;
}

.recent-viewed-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #f5c001;
    color: #111111;
    font-size: 10px;
    line-height: 18px;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
}

.recent-viewed-modal .modal-content {
    border-radius: 18px;
    border: 1px solid rgba(245, 192, 1, 0.14);
    background: linear-gradient(180deg, rgba(11, 11, 11, 0.98), rgba(5, 5, 5, 0.98));
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.3);
}

.recent-viewed-modal .modal-header,
.recent-viewed-modal .modal-body {
    border-color: rgba(255, 255, 255, 0.08);
}

.recent-viewed-modal .modal-title {
    color: #f5c001;
    font-size: 22px;
    font-weight: 800;
}

.recent-viewed-modal-subtitle {
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
    line-height: 1.6;
}

.recent-viewed-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-viewed-empty {
    padding: 28px 18px;
    border-radius: 16px;
    border: 1px dashed rgba(245, 192, 1, 0.18);
    background: rgba(245, 192, 1, 0.05);
    color: rgba(255, 255, 255, 0.74);
    font-size: 14px;
    text-align: center;
}

.recent-viewed-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.recent-viewed-item {
    display: flex;
    gap: 14px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
    transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.recent-viewed-item:hover {
    transform: translateY(-2px);
    border-color: rgba(245, 192, 1, 0.22);
    background: rgba(245, 192, 1, 0.06);
}

.recent-viewed-thumb {
    position: relative;
    flex: 0 0 136px;
    width: 136px;
    overflow: hidden;
    border-radius: 12px;
    background: #111111;
}

.recent-viewed-thumb img {
    display: block;
    width: 100%;
    height: 82px;
    object-fit: cover;
}

.recent-viewed-item-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 87, 87, 0.92);
    color: #ffffff;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
}

.recent-viewed-body {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 6px;
}

.recent-viewed-title {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-viewed-price {
    color: #f5c001;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
}

.recent-viewed-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recent-viewed-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .recent-viewed-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .recent-viewed-modal-actions {
        gap: 8px;
    }

    .recent-viewed-item {
        gap: 12px;
        padding: 10px;
    }

    .recent-viewed-thumb {
        flex-basis: 110px;
        width: 110px;
    }

    .recent-viewed-thumb img {
        height: 72px;
    }

    .recent-viewed-price {
        font-size: 16px;
    }
}

/* Buttons */
.btn {
    border-radius: .5rem;
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 500;
    line-height: 20px;
    border: none;
    box-sizing: border-box;
    height: 40px;
    cursor: pointer;
}
#heading .btn.primary {
    background-color: var(--header-accent);
    color: #111111;
}
#heading .btn.primary:hover {
    background-color: var(--header-accent-hover);
    color: #111111;
}

#heading .header-primary-btn,
#heading .header-primary-btn:hover,
#heading .header-primary-btn:focus-visible {
    color: #111111;
}

/* Utilities */
.c-py-10 { padding-top: 10px; padding-bottom: 10px; }
.c-mr-8 { margin-right: 8px; }
.c-px-4 { padding-left: 1rem; padding-right: 1rem; }
.c-p-8 { padding: 8px; }
.brs-8 { border-radius: 8px; }
.lh-40 { line-height: 40px; }

.menu-list {
    display: block;
}

.menu-list .menu-category {
    min-height: 60px;
    display: flex;
    align-items: center;
    padding: 8px 0;
    background-color: var(--header-bg);
    box-shadow: 0 5px 5px -5px rgba(0, 0, 0, 0.2);
}

.menu-category-list {
    width: 100%;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 8px;
}

.menu-category-list li {
    list-style: none;
    min-width: 0;
    background-color: transparent;
}

.menu-category-list a {
    display: block;
    transition: 0.2s;
    height: 100%;
}

.menu-category-inner {
    min-height: 44px;
    gap: 6px;
    white-space: normal;
    text-align: center;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.menu-category-list a:hover .menu-category-inner,
.menu-category-list a:focus-visible .menu-category-inner {
    background: var(--header-menu-hover-bg);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.menu-category-icon-slot {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
}

.menu-category-icon {
    width: 24px;
    height: 24px;
    margin-right: 0;
    vertical-align: middle;
    object-fit: contain;
}

.menu-category-icon-fallback {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 192, 1, 0.12);
    color: #f5c001;
    font-size: 12px;
}

.menu-category-text {
    color: #ffffff;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.35;
    letter-spacing: 0;
}

.box-icon p#num_cart,
.box-icon p#num_cart_mobile {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--invalid-color);
    color: #fff;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

#heading .mobile-bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 1040;
    display: none !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    align-items: center !important;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 22px;
    border: 1px solid rgba(245, 192, 1, 0.14);
    background: rgba(24, 24, 24, 0.98);
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
}

#heading .mobile-bottom-nav-item {
    -webkit-appearance: none;
    appearance: none;
    width: 100% !important;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.76);
    text-decoration: none;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    min-height: 60px;
    font: inherit;
    text-align: center;
}

#heading .mobile-bottom-nav-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 22px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#heading .mobile-bottom-nav-label {
    display: block;
    width: 100%;
    font-size: 11px;
    line-height: 1.25;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

#heading .mobile-bottom-nav-item.is-active .mobile-bottom-nav-icon-wrap {
    background: #0f0f0f;
    color: #ff5f68;
    transform: translateY(-1px);
}

#heading .mobile-bottom-nav-item.is-active .mobile-bottom-nav-label {
    color: #f5c001;
}

.mobile-nav-modal .modal-content {
    border-radius: 22px;
    border: 1px solid rgba(245, 192, 1, 0.14);
    background: #090909;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
}

.mobile-nav-modal .modal-header,
.mobile-nav-modal .modal-body {
    border-color: rgba(255, 255, 255, 0.08);
    background: #090909;
}

.mobile-nav-modal .modal-title {
    color: #f5c001;
    font-size: 22px;
    font-weight: 800;
}

.mobile-nav-modal .mobile-search-modal-subtitle {
    color: rgba(255, 255, 255, 0.72);
}

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

.mobile-nav-grid--account {
    grid-template-columns: 1fr;
}

.mobile-nav-link {
    min-width: 0;
    min-height: 88px;
    padding: 14px 12px;
    border-radius: 18px;
    border: 1px solid rgba(245, 192, 1, 0.18);
    background: #121212;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
    text-align: center;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 10px 20px rgba(0, 0, 0, 0.22);
}

.mobile-nav-link--button {
    width: 100%;
}

.mobile-nav-link-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(245, 192, 1, 0.2);
    background: #0d0d0d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.mobile-nav-link-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(1.08);
}

.mobile-nav-link-fallback {
    color: #f5c001;
    font-size: 16px;
    line-height: 1;
}

.mobile-nav-link-text {
    color: #ffffff;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus-visible {
    border-color: rgba(245, 192, 1, 0.32);
    background: #171717;
    color: #ffffff;
}

/* Responsive */
@media (max-width: 992px) {
    body.has-mobile-bottom-nav {
        padding-bottom: calc(98px + env(safe-area-inset-bottom, 0px));
    }

    #heading .mobile-bottom-nav {
        display: grid !important;
    }

    .header-container {
        padding: 0 16px;
    }

    header nav.heading .header-container {
        height: 58px;
        gap: 12px;
    }

    .header-mobile-actions {
        align-items: center;
        gap: 10px;
        margin-right: 0;
    }

    .header-mobile-icon,
    .header-mobile-actions .box-icon {
        width: 34px;
        height: 34px;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background-color: transparent;
    }

    .header-mobile-icon.c-ml-16 {
        margin-left: 0;
    }

    .cart-view-header.header-mobile-icon {
        margin-left: 0;
    }

    .box-logo img {
        width: 112px;
    }

    .box-search {
        width: 100%;
    }

    .header-action-group {
        gap: 8px;
    }

    .desktop-contact-float {
        display: none !important;
    }

    .header-mobile-icon .header-icon-img,
    .header-mobile-actions .header-icon-img {
        width: 22px;
        height: 22px;
    }

    .header-mobile-actions {
        gap: 6px;
    }

    .header-mobile-actions .mobile-da-xem {
        width: 26px;
        height: 26px;
    }

    .header-mobile-icon #num_cart,
    .header-mobile-icon #num_cart_mobile {
        top: -3px;
        right: -3px;
        min-width: 16px;
        height: 16px;
        font-size: 9px;
        line-height: 16px;
    }

    .header-mobile-actions .recent-viewed-count {
        top: -3px;
        right: -3px;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        font-size: 9px;
        line-height: 16px;
    }

    #heading .mobile-bottom-nav {
        left: 10px;
        right: 10px;
        gap: 2px;
    }

    .mobile-nav-modal .modal-dialog {
        margin: 16px;
    }
}

@media (max-width: 576px) {
    header nav.heading .header-container {
        height: 54px;
        padding: 0 12px;
        gap: 10px;
    }

    .box-logo img {
        width: 102px;
    }

    .header-mobile-actions {
        gap: 5px;
        margin-right: 0;
    }

    .header-mobile-icon,
    .header-mobile-actions .box-icon {
        width: 34px;
        height: 34px;
    }

    .mobile-search-modal .modal-dialog {
        margin: 12px;
    }

    .mobile-search-modal .modal-body {
        padding: 14px;
    }

    .mobile-search-modal .modal-title {
        font-size: 20px;
    }

    #heading .mobile-bottom-nav {
        left: 8px;
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        padding: 8px 4px;
        border-radius: 18px;
    }

    #heading .mobile-bottom-nav-icon-wrap {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    #heading .mobile-bottom-nav-label {
        font-size: 10px;
    }

    #heading .mobile-bottom-nav-item {
        gap: 5px;
        min-height: 56px;
    }

    .mobile-nav-grid {
        gap: 10px;
    }

    .mobile-nav-link {
        min-height: 82px;
        padding: 12px 10px;
    }

    .mobile-nav-link-icon {
        width: 40px;
        height: 40px;
    }
}