/* ===================================================
   CSS cho những gì Tailwind không làm được:
   wp_nav_menu output, nội dung editor (.wx-prose), ::after pseudo-elements, output plugin.
   Màu lấy từ biến @theme (tailwind.src.css) — luôn kèm fallback hex.
   =================================================== */

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

/* Font + cỡ chữ gốc (Vu chọn 29/10/2026). Class Tailwind (text-sm…) dùng rem nên không bị 1.3em ảnh hưởng —
   chỉ chữ KHÔNG có class cỡ chữ mới lớn theo. */
body {
    font-family: "Roboto", Helvetica Neue, Helvetica, Arial, sans-serif;
    font-size: 1.3em;
}

/* Tailwind v4 preflight KHÔNG còn tự set cursor:pointer cho button — đặt một lần ở đây. */
button:not(:disabled),
[type="button"]:not(:disabled),
[type="submit"]:not(:disabled),
[role="button"],
summary,
label[for] { cursor: pointer; }
button:disabled,
[type="submit"]:disabled { cursor: not-allowed; }

/* --- Alpine: ẩn phần tử x-show trước khi Alpine khởi tạo --- */
[x-cloak] { display: none !important; }

/* --- Header ---
   KHÔNG đặt backdrop-filter/transform lên .wx-header — nó là cha của drawer
   mobile (position:fixed). Nền + blur đặt ở .wx-header__bar. */
.wx-header__bar {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(214, 228, 245, 0.8);
}
@supports (backdrop-filter: blur(8px)) {
    .wx-header__bar {
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(10px) saturate(140%);
        -webkit-backdrop-filter: blur(10px) saturate(140%);
    }
}

/* WP custom logo */
.custom-logo-link { display: inline-flex; align-items: center; }
.custom-logo-link img { height: 60px; width: auto; margin-block: -8px; }
/* Logo PNG có khoảng trống trên/dưới (~25%) → phóng to + margin âm để chữ to mà header không cao thêm. */
@media (min-width: 1024px) { .custom-logo-link img { height: 84px; margin-block: -14px; } }

/* --- Desktop nav (wp_nav_menu output) --- */
.wx-nav-list {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
@media (min-width: 1280px) { .wx-nav-list { gap: 2.25rem; } }
.wx-nav-list > li { position: relative; }
.wx-nav-list > li > a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 1.5rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-ink, #041d33);
    white-space: nowrap;
    transition: color 0.2s;
}
.wx-nav-caret { width: 14px; height: 14px; flex-shrink: 0; transition: transform 0.2s ease; }
.wx-nav-list > li.menu-item-has-children:hover > a > .wx-nav-caret,
.wx-nav-list > li.menu-item-has-children:focus-within > a > .wx-nav-caret { transform: rotate(180deg); }
.wx-nav-list > li > a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1rem;
    height: 2px;
    border-radius: 2px;
    background: var(--color-brand, #196bde);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}
.wx-nav-list > li > a:hover,
.wx-nav-list > li.current-menu-item > a,
.wx-nav-list > li.current-menu-ancestor > a { color: var(--color-brand, #196bde); }
/* Gạch chân chỉ khi hover; mục active chỉ đổi màu chữ. */
.wx-nav-list > li > a:hover::after { transform: scaleX(1); }

/* Dropdown */
.wx-nav-list .sub-menu {
    position: absolute;
    top: 100%;
    left: -1rem;
    z-index: 50;
    min-width: 220px;
    margin: 0;
    padding: 0.5rem;
    list-style: none;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 18px 40px -18px rgba(1, 41, 87, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.wx-nav-list > li:hover > .sub-menu,
.wx-nav-list > li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.wx-nav-list .sub-menu a {
    display: block;
    padding: 0.55rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-ink, #041d33);
}
.wx-nav-list .sub-menu a:hover { color: var(--color-brand, #196bde); background: var(--color-brand-soft, #e8f2ff); }
.wx-nav-list .sub-menu .current-menu-item > a { color: var(--color-brand, #196bde); font-weight: 600; }

/* --- Mobile nav: accordion drawer --- */
.wx-mobile-nav-list,
.wx-mobile-nav-list .sub-menu { margin: 0; padding: 0; list-style: none; }
.wx-mobile-nav-list > li + li { margin-top: 2px; }

.wx-m-row {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 0.75rem;
    transition: background-color 0.15s;
}
.wx-m-row:hover,
.wx-m-row:active { background: var(--color-paper, #f5f9ff); }
.wx-m-link {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-ink, #041d33);
    transition: color 0.15s;
}
.wx-m-link:hover { color: var(--color-brand, #196bde); }

.wx-mobile-nav-list li.current-menu-item > .wx-m-row,
.wx-mobile-nav-list li.current-menu-ancestor > .wx-m-row,
.wx-mobile-nav-list li.current-menu-parent > .wx-m-row { background: var(--color-brand-soft, #e8f2ff); }
.wx-mobile-nav-list li.current-menu-item > .wx-m-row > .wx-m-link,
.wx-mobile-nav-list li.current-menu-ancestor > .wx-m-row > .wx-m-link,
.wx-mobile-nav-list li.current-menu-parent > .wx-m-row > .wx-m-link,
.wx-mobile-nav-list li.is-open > .wx-m-row > .wx-m-link { color: var(--color-brand, #196bde); }

/* Nút chevron: đủ 44px vùng bấm */
.wx-m-toggle {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    margin-right: 0.25rem;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0.5rem;
    color: var(--color-ink-soft, #495c77);
    transition: color 0.15s, background-color 0.15s;
}
.wx-m-toggle:hover { color: var(--color-brand, #196bde); }
.wx-m-toggle:focus-visible,
.wx-m-link:focus-visible { outline: 2px solid var(--color-brand, #196bde); outline-offset: -2px; border-radius: 0.75rem; }
.wx-mobile-nav-list li.is-open > .wx-m-row > .wx-m-toggle { background: var(--color-brand-soft, #e8f2ff); color: var(--color-brand, #196bde); }
.wx-m-chevron { width: 1.1rem; height: 1.1rem; transition: transform 0.2s; }
.wx-m-chevron.is-open { transform: rotate(180deg); }

.wx-mobile-nav-list .sub-menu {
    margin: 0.25rem 0 0.5rem 0.75rem;
    padding: 0.375rem;
    border-radius: 0.75rem;
    background: var(--color-paper, #f5f9ff);
}
.wx-mobile-nav-list .sub-menu .wx-m-link { min-height: 44px; font-size: 0.9rem; font-weight: 400; }

/* --- Nội dung editor (bài viết, trang) --- */
.wx-prose { color: var(--color-ink, #041d33); font-size: 1.0625rem; line-height: 1.75; }
.wx-prose > * + * { margin-top: 1.1em; }
.wx-prose h2 { margin-top: 2em; font-size: 1.6rem; font-weight: 600; line-height: 1.35; }
.wx-prose h3 { margin-top: 1.6em; font-size: 1.3rem; font-weight: 600; line-height: 1.35; }
.wx-prose h4 { margin-top: 1.4em; font-size: 1.1rem; font-weight: 600; }
.wx-prose a { color: var(--color-brand, #196bde); text-decoration: underline; text-underline-offset: 3px; }
.wx-prose a:hover { color: var(--color-brand-dark, #0c4a9c); }
.wx-prose ul { list-style: disc; padding-left: 1.4em; }
.wx-prose ol { list-style: decimal; padding-left: 1.4em; }
.wx-prose li + li { margin-top: 0.4em; }
.wx-prose li::marker { color: var(--color-brand, #196bde); }
.wx-prose img { height: auto; border-radius: 0.75rem; }
.wx-prose figure figcaption,
.wx-prose .wp-caption-text { margin-top: 0.5rem; font-size: 0.875rem; text-align: center; color: var(--color-ink-soft, #495c77); }
.wx-prose blockquote {
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--color-brand, #196bde);
    border-radius: 0 0.75rem 0.75rem 0;
    background: var(--color-brand-soft, #e8f2ff);
    font-style: italic;
}
.wx-prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.wx-prose th,
.wx-prose td { padding: 0.6rem 0.8rem; border: 1px solid var(--color-line, #d6e4f5); text-align: left; }
.wx-prose th { background: var(--color-paper-warm, #eaf3fe); font-weight: 600; }
.wx-prose .wp-block-table { overflow-x: auto; }
.wx-prose code { padding: 0.15em 0.4em; border-radius: 0.3rem; background: var(--color-paper-warm, #eaf3fe); font-size: 0.9em; }
.wx-prose pre { overflow-x: auto; padding: 1rem; border-radius: 0.75rem; background: var(--color-night, #012957); color: #fff; }
.wx-prose pre code { padding: 0; background: none; }
.wx-prose .alignleft { float: left; margin: 0.3em 1.5em 1em 0; }
.wx-prose .alignright { float: right; margin: 0.3em 0 1em 1.5em; }
.wx-prose .aligncenter { margin-inline: auto; }

/* --- Phân trang (paginate_links) --- */
.wx-pagination .page-numbers {
    display: inline-grid;
    place-items: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-ink, #041d33);
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--color-line, #d6e4f5);
    transition: color 0.15s, background-color 0.15s;
}
.wx-pagination a.page-numbers:hover { color: var(--color-brand, #196bde); }
.wx-pagination .page-numbers.current { color: #fff; background: var(--color-brand, #196bde); box-shadow: none; }
.wx-pagination .page-numbers.dots { background: transparent; box-shadow: none; }

/* --- Widget sidebar --- */
.widget + .widget { margin-top: 1.5rem; }
.widget { padding: 1.25rem; border-radius: 1rem; background: #fff; box-shadow: inset 0 0 0 1px var(--color-line, #d6e4f5); }
.widget-title,
.widget .wp-block-heading,
.widget .wp-block-search__label { display: block; margin-bottom: 0.75rem; font-size: 1rem; font-weight: 600; }
/* Widget block mặc định (Search) */
.widget .wp-block-search__inside-wrapper { display: flex; gap: 0.5rem; }
.widget .wp-block-search__input { flex: 1; min-width: 0; height: 2.5rem; padding: 0 1rem; border: 1px solid var(--color-line, #d6e4f5); border-radius: 0.5rem; font-size: 0.875rem; outline: none; }
.widget .wp-block-search__input:focus { border-color: var(--color-brand, #196bde); }
.widget .wp-block-search__button { height: 2.5rem; margin: 0; padding: 0 1.1rem; border: 0; border-radius: 0.5rem; background: var(--color-brand, #196bde); color: #fff; font-size: 0.875rem; font-weight: 600; }
.widget .wp-block-search__button:hover { background: var(--color-brand-dark, #0c4a9c); }
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li + li { margin-top: 0.5rem; }
.widget a:hover { color: var(--color-brand, #196bde); }

/* --- Chip lọc ngành nghề (trang chủ, kho giao diện) --- */
.wx-chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    height: 2.5rem;
    padding: 0 1rem;
    border: 1px solid var(--color-line, #d6e4f5);
    border-radius: 9999px;
    background: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-ink-soft, #495c77);
    white-space: nowrap;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.wx-chip:hover { color: var(--color-brand, #196bde); border-color: var(--color-brand, #196bde); }
.wx-chip.is-active,
.wx-chip[aria-current="page"] { color: #fff; background: var(--color-brand, #196bde); border-color: var(--color-brand, #196bde); }

/* --- Ảnh chụp giao diện: ảnh cả trang, hover thì cuộn từ đầu xuống cuối --- */
/* Ảnh chụp cả trang trong khung 4:3: hover thì cuộn xuống đáy bằng transform (GPU) — KHÔNG animate
   object-position (vẽ lại mỗi khung hình → giật). 100cqh = chiều cao khung (.wx-shot là container). */
.wx-shot { container-type: size; }
.wx-shot__img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    transform: translate3d(0, 0, 0);
    transition: transform 0.9s cubic-bezier(0.33, 1, 0.68, 1); /* rời chuột: trả về nhanh */
    will-change: transform;
}
.group:hover .wx-shot__img,
.wx-shot:focus-visible .wx-shot__img {
    transform: translate3d(0, calc(-100% + 100cqh), 0);
    transition: transform 4.5s cubic-bezier(0.45, 0, 0.55, 1); /* rê chuột: cuộn chậm, đều */
}
/* Máy bật "Giảm chuyển động": KHÔNG cuộn ảnh (thay vì nhảy tức thì xuống đáy — chính là cảm giác "giật"). */
@media (prefers-reduced-motion: reduce) {
    .wx-shot__img, .group:hover .wx-shot__img, .wx-shot:focus-visible .wx-shot__img { transform: none; transition: none; }
}

/* --- Nút liên hệ nổi: vòng sóng quanh nút gọi --- */
.wx-float--ring { position: relative; }
.wx-float--ring::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: inherit;
    opacity: 0.5;
    animation: wx-ring 1.8s ease-out infinite;
    z-index: -1;
}
@keyframes wx-ring { to { transform: scale(1.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wx-float--ring::before { animation: none; } }

/* --- Thẻ (tag) cuối bài viết --- */
.wx-tags a {
    display: inline-flex;
    align-items: center;
    height: 2rem;
    padding: 0 0.75rem;
    border-radius: 0.375rem;
    background: var(--color-brand-soft, #e8f2ff);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-brand, #196bde);
    transition: color 0.15s, background-color 0.15s;
}
.wx-tags a::before { content: "#"; opacity: 0.6; margin-right: 1px; }
.wx-tags a:hover { background: var(--color-brand, #196bde); color: #fff; }

/* --- Giá tiền: chữ "đ" nhỏ, nâng lên (kiểu Sapo) --- */
.wx-price sup { top: -0.55em; margin-left: 1px; font-size: 0.6em; }

/* --- Hàng trượt ngang (carousel bằng scroll-snap, nút điều khiển bằng Alpine) --- */
.wx-rail { scroll-snap-type: x mandatory; scrollbar-width: none; }
.wx-rail::-webkit-scrollbar { display: none; }
.wx-rail > * { scroll-snap-align: start; }

/* --- FAQ của Rank Math (#rank-math-faq) dạng accordion, cùng kiểu template-parts/faq.php.
       JS (main.js) gắn .wx-faq-js + bọc câu hỏi trong <button>; không có JS thì mọi câu trả lời vẫn hiện. --- */
.wx-prose .rank-math-block { margin-top: 1.6em; }
.rank-math-block .rank-math-list {
    border: 1px solid var(--color-line, #d6e4f5);
    border-radius: 1rem;
    background: #fff;
}
.rank-math-block .rank-math-list-item { padding: 0 1.25rem; }
.rank-math-block .rank-math-list-item + .rank-math-list-item { border-top: 1px solid var(--color-line, #d6e4f5); }
.wx-prose .rank-math-block .rank-math-question { margin: 0; padding: 1rem 0; font-size: 1rem; font-weight: 600; line-height: 1.5; color: var(--color-ink, #041d33); }
.rank-math-block .rank-math-answer { padding-bottom: 1.25rem; font-size: 0.9375rem; line-height: 1.7; color: var(--color-ink-soft, #495c77); }
.rank-math-block .rank-math-answer > * + * { margin-top: 0.75em; }

.wx-faq-js .rank-math-question { padding: 0 !important; }
.wx-faq-js .rank-math-question button {
    display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1rem 0; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.wx-faq-js .rank-math-question button:hover { color: var(--color-brand, #196bde); }
.wx-faq-js .rank-math-question button:focus-visible { outline: 2px solid var(--color-brand, #196bde); outline-offset: 2px; border-radius: 0.25rem; }
/* dấu + (xoay thành × khi mở) */
.wx-faq-js .rank-math-question button::after {
    content: ""; flex-shrink: 0; width: 1.25rem; height: 1.25rem;
    background:
        linear-gradient(var(--color-brand, #196bde), var(--color-brand, #196bde)) center / 0.875rem 2px no-repeat,
        linear-gradient(var(--color-brand, #196bde), var(--color-brand, #196bde)) center / 2px 0.875rem no-repeat;
    transition: transform 0.2s ease;
}
.wx-faq-js .is-open .rank-math-question button::after { transform: rotate(45deg); }
/* mở/đóng mượt bằng grid-rows */
.wx-faq-js .rank-math-answer-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.25s ease; }
.wx-faq-js .is-open .rank-math-answer-wrap { grid-template-rows: 1fr; }
.wx-faq-js .rank-math-answer-wrap > .rank-math-answer { overflow: hidden; min-height: 0; }
.wx-faq-js .rank-math-list-item:not(.is-open) .rank-math-answer { padding-bottom: 0; visibility: hidden; transition: visibility 0s 0.25s, padding 0.25s; }
.wx-faq-js .is-open .rank-math-answer { transition: padding 0.25s; }
@media (prefers-reduced-motion: reduce) {
    .wx-faq-js .rank-math-answer-wrap, .wx-faq-js .rank-math-question button::after { transition: none; }
}

/* --- Breadcrumb Rank Math (template-parts/breadcrumb.php → .wx-breadcrumb) ---
   Markup: nav.rank-math-breadcrumb > p > a, span.separator, span.last. Màu chữ theo class của wrapper. */
.wx-breadcrumb .rank-math-breadcrumb p {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.5rem;
    row-gap: 0.25rem;
    line-height: 1.6;
}
.wx-breadcrumb .rank-math-breadcrumb a { color: inherit; transition: color 0.15s ease; }
.wx-breadcrumb .rank-math-breadcrumb a:hover { color: var(--color-brand, #196bde); }
.wx-breadcrumb .rank-math-breadcrumb .separator { opacity: 0.5; }
/* Mục cuối (tiêu đề bài/trang) dài thì cắt "…", tránh trail chiếm nhiều dòng. */
.wx-breadcrumb .rank-math-breadcrumb .last {
    max-width: min(36ch, 100%);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Mô tả trong khối "Tổng quan mẫu" (single-giao_dien.php): tiêu đề nhỏ hơn H2 của section để đúng thứ bậc. */
.wx-prose--compact { font-size: 1rem; }
.wx-prose--compact > :first-child { margin-top: 0; }
.wx-prose--compact h2 { margin-top: 1.9em; font-size: 1.25rem; line-height: 1.4; }
.wx-prose--compact h3 { margin-top: 1.6em; font-size: 1.1rem; line-height: 1.4; }
