/*
 * ALO Giá Rẻ - đồng bộ màu chữ/icon hover toàn frontend.
 * Nguồn duy nhất: --alo-ui-hover-text-color (ui_link_hover_color trong admin).
 * File này được nạp sau toàn bộ CSS frontend để chặn màu hover hard-code cũ.
 */

:root {
    --alo-ui-link-hover-color: var(--alo-ui-hover-text-color, #7f1d1d);
    --alo-ui-category-hover-color: var(--alo-ui-hover-text-color, #7f1d1d);
    --w11-topbar-hover: var(--alo-ui-hover-text-color, #7f1d1d);
    --header-wow-top-hover: var(--alo-ui-hover-text-color, #7f1d1d);
    --header-wow-sticky-hover: var(--alo-ui-hover-text-color, #7f1d1d);
    --alogiare-mobile-header-hover: var(--alo-ui-hover-text-color, #7f1d1d);
    --w11-nav-hover: var(--alo-ui-hover-text-color, #7f1d1d);
    --w11-footer-hover: var(--alo-ui-hover-text-color, #7f1d1d);
    --ui-text-hover: var(--alo-ui-hover-text-color, #7f1d1d);
    --hover-primary-color: var(--alo-ui-hover-text-color, #7f1d1d);

    /* Bootstrap/link helpers còn xuất hiện trong các template cũ. */
    --bs-link-hover-color: var(--alo-ui-hover-text-color, #7f1d1d);
    --bs-nav-link-hover-color: var(--alo-ui-hover-text-color, #7f1d1d);
    --bs-navbar-brand-hover-color: var(--alo-ui-hover-text-color, #7f1d1d);
    --bs-navbar-hover-color: var(--alo-ui-hover-text-color, #7f1d1d);
    --bs-dropdown-link-hover-color: var(--alo-ui-hover-text-color, #7f1d1d);
    --bs-list-group-action-hover-color: var(--alo-ui-hover-text-color, #7f1d1d);
    --bs-pagination-hover-color: var(--alo-ui-hover-text-color, #7f1d1d);
    --bs-pagination-focus-color: var(--alo-ui-hover-text-color, #7f1d1d);

    /* Màu nền hover của nút phải tách khỏi màu chữ/icon hover. */
    --alo-v21-red-dark: var(--alo-ui-primary-button-hover-bg, #7f1d1d);
}

/*
 * Prefix cố ý có specificity cao để thắng các rule legacy dùng !important.
 * :where() giữ specificity của phần selector sau ở mức thấp để nhóm ngoại lệ
 * (nút/CTA cần tương phản) có thể ghi đè an toàn ở cuối file.
 */

/* Link chữ thông thường trên toàn site. */
html:root:root:root:root body.w11-pro-site.w11-pro-site.w11-pro-site
    :where(
        a:not(.btn):not([class*="btn"]):not([class*="button"]):not([role="button"]):not(.badge):not([class*="badge"]):not([class*="call"]):not([class*="hotline"]):not([class*="zalo"]):not([class*="messenger"]):not([class*="facebook"])
    ):is(:hover, :focus-visible) {
    color: var(--alo-ui-hover-text-color, #7f1d1d) !important;
    text-decoration-color: currentColor !important;
}

/* Chữ/icon nằm bên trong link cũng phải đi cùng một màu. */
html:root:root:root:root body.w11-pro-site.w11-pro-site.w11-pro-site
    :where(
        a:not(.btn):not([class*="btn"]):not([class*="button"]):not([role="button"]):not(.badge):not([class*="badge"]):not([class*="call"]):not([class*="hotline"]):not([class*="zalo"]):not([class*="messenger"]):not([class*="facebook"])
    ):is(:hover, :focus-visible)
    :where(span, strong, b, small, em, p, h1, h2, h3, h4, h5, h6, i, .bi, .fa, .fas, .far, .fab, .icon, svg) {
    color: var(--alo-ui-hover-text-color, #7f1d1d) !important;
    text-decoration-color: currentColor !important;
}

/* Control có hành vi như link/menu nhưng markup là button, summary hoặc tab. */
html:root:root:root:root body.w11-pro-site.w11-pro-site.w11-pro-site
    :where(
        button:not([type="submit"]):not(.btn):not([class*="btn"]):not([class*="button"]):not([class*="call"]):not([class*="hotline"]):not([class*="zalo"]):not([class*="messenger"]):not([class*="facebook"]),
        .btn-link,
        .nav-link,
        .dropdown-item,
        .page-link,
        .list-group-item-action,
        .header-menu-dropdown-toggle,
        .header-more-link,
        .alogiare-account-toggle,
        .account-wow-btn,
        .alogiare-account-menu a,
        .alogiare-account-logout-btn,
        .alogiare-location-item,
        .alogiare-location-modal-item,
        .alogiare-location-modal-close,
        .alogiare-location-modal-back,
        .search-suggest-item,
        .w11-mobile-panel__link,
        .w11-nav-category,
        .w11-auth-btn:not(.w11-auth-btn--solid),
        .wt-detail-btn-outline,
        .p3-btn-outline,
        .p3-category-tile,
        .p3-side-link,
        .ctcat-filter-chip,
        .ctcat-side-link,
        .ctcat-save,
        .ctcat-cat,
        .ctcat-item__heart,
        .ctcat-filter-pill,
        .ctcat-sort-option,
        .ctcat-grid-mode,
        .ctcat-clear,
        .dtx-gallery-drop,
        .footer-merge-item-title,
        .dtf-pro-badge-item,
        [role="tab"],
        [role="menuitem"],
        details > summary
    ):is(:hover, :focus-visible) {
    color: var(--alo-ui-hover-text-color, #7f1d1d) !important;
    text-decoration-color: currentColor !important;
}

html:root:root:root:root body.w11-pro-site.w11-pro-site.w11-pro-site
    :where(
        button:not([type="submit"]):not(.btn):not([class*="btn"]):not([class*="button"]):not([class*="call"]):not([class*="hotline"]):not([class*="zalo"]):not([class*="messenger"]):not([class*="facebook"]),
        .btn-link,
        .nav-link,
        .dropdown-item,
        .page-link,
        .list-group-item-action,
        .header-menu-dropdown-toggle,
        .header-more-link,
        .alogiare-account-toggle,
        .account-wow-btn,
        .alogiare-account-menu a,
        .alogiare-account-logout-btn,
        .alogiare-location-item,
        .alogiare-location-modal-item,
        .alogiare-location-modal-close,
        .alogiare-location-modal-back,
        .search-suggest-item,
        .w11-mobile-panel__link,
        .w11-nav-category,
        .w11-auth-btn:not(.w11-auth-btn--solid),
        .wt-detail-btn-outline,
        .p3-btn-outline,
        .p3-category-tile,
        .p3-side-link,
        .ctcat-filter-chip,
        .ctcat-side-link,
        .ctcat-save,
        .ctcat-cat,
        .ctcat-item__heart,
        .ctcat-filter-pill,
        .ctcat-sort-option,
        .ctcat-grid-mode,
        .ctcat-clear,
        .dtx-gallery-drop,
        .footer-merge-item-title,
        .dtf-pro-badge-item,
        [role="tab"],
        [role="menuitem"],
        details > summary
    ):is(:hover, :focus-visible)
    :where(span, strong, b, small, em, p, i, .bi, .fa, .fas, .far, .fab, .icon, svg) {
    color: var(--alo-ui-hover-text-color, #7f1d1d) !important;
    text-decoration-color: currentColor !important;
}

/*
 * Các card/menu cũ đổi màu ở phần tử con khi hover phần tử cha.
 * Đây là nhóm không thể bắt chỉ bằng a:hover nên được gom riêng.
 */
html:root:root:root:root body.w11-pro-site.w11-pro-site.w11-pro-site
    :where(
        .header-menu-dropdown:hover .header-menu-dropdown-toggle,
        .header-menu-dropdown:focus-within .header-menu-dropdown-toggle,
        .alogiare-account-dropdown:hover .alogiare-account-toggle,
        .alogiare-account-dropdown:focus-within .alogiare-account-toggle,
        .w11-brand:hover .w11-brand__text strong,
        .dtx-subcat:hover .dtx-subcat__name,
        .alogiare-service-card:hover span,
        .alogiare-province-card:hover span,
        .alogiare-vip-item:hover .alogiare-vip-text,
        .alogiare-cat-link:hover .alogiare-cat-text,
        .ctcat-side-link:hover small,
        .wpfm-menu-nav ul li:hover span.wpfm-icon-block i,
        .wpfm-menu-nav ul li:hover span.wpfm-menu-name,
        .wpfm-template-6 ul li:hover .wpfm-icon-block,
        .wpfm-template-11 .wpfm-menu-nav ul li:hover a span,
        .kc-infobox-default:hover h5,
        .kc-infobox-default:hover i,
        #TB_closeWindowButton:hover .tb-close-icon,
        #TB_closeWindowButton:focus-visible .tb-close-icon,
        .alogiare-mobile-bottom-nav a:hover span,
        .alogiare-mobile-bottom-nav a:hover i,
        .alogiare-mobile-bottom-nav button:hover span,
        .alogiare-mobile-bottom-nav button:hover i
    ) {
    color: var(--alo-ui-hover-text-color, #7f1d1d) !important;
}

/*
 * Ngoại lệ tương phản: đây là nút/CTA có nền, không phải link chữ thông thường.
 * Chúng giữ màu chữ nút đã cấu hình; chỉ nền hover dùng trường nền hover riêng.
 */
html:root:root:root:root body.w11-pro-site.w11-pro-site.w11-pro-site
    :where(
        .alogiare-search-btn,
        .alogiare-location-current,
        .header-wow-sticky-search-action,
        .header-wow-sticky-add,
        .dtx-card__shop-corner,
        .ctcat-item__shop-cta,
        .dtx-card a[href*="/shop"],
        .agr-home-search button,
        .agr-lead-submit,
        .booking-form button[type="submit"],
        .alogiare-booking-form button[type="submit"],
        .alo-lead-form button[type="submit"],
        .btn-post-free,
        .post-free-btn,
        a[href*="dang-tin"].btn,
        .gx-hotline,
        .wt-shop-call,
        .alogiare-shop-authority-home .shop-authority-links__topmore,
        .ctcat-hyperlocal-foundation__actions a,
        .ctcat-owner > a
    ):is(:hover, :focus-visible),
html:root:root:root:root body.w11-pro-site.w11-pro-site.w11-pro-site
    :where(
        .alogiare-search-btn,
        .alogiare-location-current,
        .header-wow-sticky-search-action,
        .header-wow-sticky-add,
        .dtx-card__shop-corner,
        .ctcat-item__shop-cta,
        .dtx-card a[href*="/shop"],
        .agr-home-search button,
        .agr-lead-submit,
        .booking-form button[type="submit"],
        .alogiare-booking-form button[type="submit"],
        .alo-lead-form button[type="submit"],
        .btn-post-free,
        .post-free-btn,
        a[href*="dang-tin"].btn,
        .gx-hotline,
        .wt-shop-call,
        .alogiare-shop-authority-home .shop-authority-links__topmore,
        .ctcat-hyperlocal-foundation__actions a,
        .ctcat-owner > a
    ):is(:hover, :focus-visible) :where(*) {
    color: var(--alo-ui-cta-button-text-color, #ffffff) !important;
}

html:root:root:root:root body.w11-pro-site.w11-pro-site.w11-pro-site
    :where(
        .wt-listing-card__call,
        .wt-detail-btn-call,
        .wt-detail-btn-primary,
        .p3-card__more,
        .p3-btn:not(.p3-btn-outline),
        .w2-commerce-btn--primary,
        .w2-commerce-listing-foot a:first-child,
        .ctcat-list .ctcat-item__conversion--step5 a[data-track="listing_list_primary_cta"],
        .dtx-card__conversion--step5 a[data-track="listing_grid_primary_cta"],
        .ctcat-list .ctcat-item__conversion--step5 a:first-child,
        .dtx-card__conversion--step5 a:first-child
    ):is(:hover, :focus-visible),
html:root:root:root:root body.w11-pro-site.w11-pro-site.w11-pro-site
    :where(
        .wt-listing-card__call,
        .wt-detail-btn-call,
        .wt-detail-btn-primary,
        .p3-card__more,
        .p3-btn:not(.p3-btn-outline),
        .w2-commerce-btn--primary,
        .w2-commerce-listing-foot a:first-child,
        .ctcat-list .ctcat-item__conversion--step5 a[data-track="listing_list_primary_cta"],
        .dtx-card__conversion--step5 a[data-track="listing_grid_primary_cta"],
        .ctcat-list .ctcat-item__conversion--step5 a:first-child,
        .dtx-card__conversion--step5 a:first-child
    ):is(:hover, :focus-visible) :where(*) {
    color: var(--alo-ui-primary-button-text-color, #ffffff) !important;
}

html:root:root:root:root body.w11-pro-site.w11-pro-site.w11-pro-site
    :where(
        .wt-listing-card__more,
        .wt-shop-more,
        .w2-commerce-btn--light,
        .w2-commerce-listing-foot a:last-child,
        .ctcat-owner-box a,
        .hb-cta a
    ):is(:hover, :focus-visible),
html:root:root:root:root body.w11-pro-site.w11-pro-site.w11-pro-site
    :where(
        .wt-listing-card__more,
        .wt-shop-more,
        .w2-commerce-btn--light,
        .w2-commerce-listing-foot a:last-child,
        .ctcat-owner-box a,
        .hb-cta a
    ):is(:hover, :focus-visible) :where(*) {
    color: var(--alo-ui-secondary-button-text-color, #0f172a) !important;
}

/* Nút liên hệ, social và carousel có nền/ảnh đậm luôn giữ chữ hoặc icon trắng. */
html:root:root:root:root body.w11-pro-site.w11-pro-site.w11-pro-site
    :where(
        .dtf-pro-social-list a,
        .v11-call,
        .v11-zalo,
        .v11-more,
        .call-floating-menu,
        .zalo-floating-menu,
        .mail-floating-menu,
        .messenger-floating-menu,
        .w11-call-btn,
        .w11-mobile-auth a:not(:first-child),
        .carousel-control-prev,
        .carousel-control-next,
        .ct5-lg-toolbar a,
        .ct5-lg-toolbar button,
        .ct5-top-call,
        .ct5-top-zalo,
        .ct5-top-facebook,
        .ct5-btn-call,
        .ct5-btn-zalo,
        .ct5-btn-facebook,
        .ct5-btn-call-green
    ):is(:hover, :focus-visible),
html:root:root:root:root body.w11-pro-site.w11-pro-site.w11-pro-site
    :where(
        .dtf-pro-social-list a,
        .v11-call,
        .v11-zalo,
        .v11-more,
        .call-floating-menu,
        .zalo-floating-menu,
        .mail-floating-menu,
        .messenger-floating-menu,
        .w11-call-btn,
        .w11-mobile-auth a:not(:first-child),
        .carousel-control-prev,
        .carousel-control-next,
        .ct5-lg-toolbar a,
        .ct5-lg-toolbar button,
        .ct5-top-call,
        .ct5-top-zalo,
        .ct5-top-facebook,
        .ct5-btn-call,
        .ct5-btn-zalo,
        .ct5-btn-facebook,
        .ct5-btn-call-green
    ):is(:hover, :focus-visible) :where(*) {
    color: #ffffff !important;
}
