/* ── Design Tokens ── */
:root {
    --bg:           #F8F5EF;
    --fg:           #1C1A16;
    --muted:        #9A968E;
    /* Dành riêng cho CHỮ nhãn nhỏ. --muted trên nền --bg chỉ đạt ~2,2:1, dưới
       chuẩn WCAG AA 4,5:1 (PSI 14/08/2026 chấm rớt .kc-label và nhãn số liệu).
       Vẫn giữ --muted cho viền/trang trí — đổi token gốc sẽ đụng cả những chỗ
       không phải chữ.

       Giá trị chọn theo nền KHÓ NHẤT, không phải nền chính: .kc-label còn nằm
       trên lớp phủ rgba(28,26,22,.08) của section (nền hiệu dụng ~#E6E4DE).
       Đo thật: 4,85:1 trên nền đó và 5,56:1 trên --bg. Vẫn nhạt hơn
       --muted-text nên giữ nguyên thứ bậc thị giác giữa nhãn và chữ thường. */
    --muted-label:  #656158;
    --muted-text:   #58554E;
    --border:       rgba(28,26,22,.08);
    --border-md:    rgba(28,26,22,.12);
    --border-strong:rgba(28,26,22,.2);
    --gold:         #C9A84C;
    --kc-teal:      #1BA7A6;
    --bg-alt:       #F2EFE8;
    --pad-h:        56px;
    --nav-h:        56px;
    --font-head:    'Montserrat', sans-serif;
    --font-body:    'Barlow', sans-serif;
    --font-mono:    'Space Mono', monospace;
    --ease-photo:   cubic-bezier(.25,.46,.45,.94);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; }
ul, ol { list-style: none; }

/* ── Base ── */
/* !important chống Elementor inject dark background vào body */
body {
    background: var(--bg) !important;
    color: var(--fg) !important;
    font-family: 'Barlow', sans-serif !important;
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
/* Ghi đè Elementor global CSS variables nếu còn active */
:root {
    --e-global-color-190c5ca: var(--bg) !important;
}

/* ── Nav ── */
.kc-nav {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: var(--bg) !important;
    border-bottom: 1px solid var(--border);
    height: var(--nav-h);
}
.kc-nav__inner {
    width: 100%;
    height: var(--nav-h);
    padding: 0 var(--pad-h);
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    position: relative;
    box-sizing: border-box;
}
.kc-nav__logo { display: flex; align-items: center; flex-shrink: 0; }
.kc-nav__logo-img,
.kc-nav__logo img {
    height: 26px !important;
    width: auto !important;
    max-height: 26px;
    display: block;
}
.kc-nav__logo-text {
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--fg);
}

/* Nav menu desktop */
.kc-nav__menu { display: block; }
.kc-nav__list {
    display: flex;
    gap: 36px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.kc-nav__list li a,
.kc-nav__list > li > a {
    font-family: 'Space Mono', monospace !important;
    font-size: 10px !important;
    letter-spacing: .12em !important;
    font-weight: 400 !important;
    text-transform: uppercase;
    color: var(--muted-text) !important;
    transition: color .2s;
    padding-bottom: 2px;
    text-decoration: none;
}
.kc-nav .kc-nav__list li.current-menu-item > a,
.kc-nav .kc-nav__list li.current-page-ancestor > a {
    color: var(--fg) !important;
    border-bottom: 1px solid var(--fg);
}
.kc-nav .kc-nav__list li a:hover { color: var(--fg) !important; }

/* Nav CTA button */
.kc-nav__cta {
    font-family: var(--font-mono) !important;
    font-size: 10px !important;
    letter-spacing: .12em !important;
    text-transform: uppercase;
    border: 1px solid var(--fg) !important;
    padding: 9px 22px !important;
    color: var(--fg) !important;
    background: transparent;
    transition: background 200ms ease, color 200ms ease;
    text-decoration: none;
    display: inline-block;
}
.kc-nav__cta:hover {
    background: var(--fg);
    color: var(--bg) !important;
}

/* Hamburger */
.kc-nav__ham {
    display: none;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 8px 4px;
    width: 36px;
    height: 36px;
}
.kc-nav__ham span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--fg);
    transition: transform .25s, opacity .25s;
}
.kc-nav__ham[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.kc-nav__ham[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.kc-nav__ham[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile dropdown */
.kc-nav__dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: rgba(248,245,239,.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-top: none;
    box-shadow: 0 16px 40px rgba(0,0,0,.12);
    z-index: 200;
}
.kc-nav__dropdown.is-open { display: block; }
.kc-nav__dropdown-list li a {
    display: block;
    padding: 14px 20px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: .12em;
    color: var(--muted) !important;
    border-bottom: 1px solid var(--border);
    transition: color .15s;
}
.kc-nav__dropdown-list li:last-child a { border-bottom: none; }
.kc-nav__dropdown-list li.current-menu-item a,
.kc-nav__dropdown-list li a:hover { color: var(--fg) !important; }

/* ── Footer ── */
.kc-footer {
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.kc-footer__top {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 60px;
    padding: 64px var(--pad-h);
    border-bottom: 1px solid var(--border);
}
.kc-footer__logo { height: 28px; width: auto; opacity: .6; }
.kc-footer__logo-link { display: inline-block; margin-bottom: 16px; }
.kc-footer__logo-text {
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .06em;
    color: var(--fg);
}
.kc-footer__tagline {
    font-size: 13px;
    color: var(--muted-text);
    line-height: 1.6;
    max-width: 280px;
}
.kc-footer__nav-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.kc-footer__nav-list li a {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .12em;
    color: var(--muted-text);
    transition: color .15s;
}
.kc-footer__nav-list li a:hover { color: var(--fg); }
.kc-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px var(--pad-h);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .1em;
    color: var(--muted);
    flex-wrap: wrap;
    gap: 8px;
}

/* ── Utility ── */
.kc-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .2em;
    color: var(--muted-label);
    text-transform: uppercase;
}
.kc-btn {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    padding: 14px 40px;
    border-radius: 0;
    box-shadow: none;
    transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
/* Secondary (default): transparent bg, fg border */
.kc-btn--secondary,
.kc-btn {
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--fg);
}
.kc-btn--secondary:hover,
.kc-btn:hover {
    background: var(--fg);
    color: var(--bg) !important;
}
/* Primary: solid fg bg */
.kc-btn--primary,
.kc-btn--solid {
    background: var(--fg);
    color: var(--bg) !important;
    border: 1px solid var(--fg);
}
.kc-btn--primary:hover,
.kc-btn--solid:hover {
    background: transparent;
    color: var(--fg) !important;
}
/* Ghost: dùng trên nền tối */
.kc-btn--ghost {
    background: transparent;
    color: var(--bg);
    border: 1px solid rgba(248,245,239,.3);
}
.kc-btn--ghost:hover {
    border-color: rgba(248,245,239,.7);
    color: var(--bg);
}
/* CTA: alias của ghost, giữ backward compat */
.kc-btn--cta {
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--bg);
    padding: 14px 32px;
}
.kc-btn--cta:hover {
    background: transparent;
    color: var(--bg);
    border-color: rgba(248,245,239,.55);
}

/* Admin bar offset — tránh nav bị che bởi WP admin bar khi logged in */
.admin-bar .kc-nav { top: 32px; }
@media screen and (max-width: 782px) {
    .admin-bar .kc-nav { top: 46px; }
}
/* Ẩn WP admin bar trên mobile để tránh đẩy nav xuống và tạo chiều cao kép */
@media screen and (max-width: 767px) {
    #wpadminbar { display: none !important; }
    .admin-bar .kc-nav { top: 0; }
    .admin-bar body,
    .admin-bar html { margin-top: 0 !important; padding-top: 0 !important; }
}

/* ── Fixed Bottom CTA Bar ── */
.kc-bottom-bar {
    display: none; /* ẩn trên desktop */
}
@media (max-width: 767px) {
    .kc-bottom-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9998;
        background: var(--bg);
        border-top: 1px solid var(--border-md);
        padding: 10px 16px 14px;
        gap: 10px;
    }
    .kc-bottom-bar__btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 44px;
        font-family: var(--font-mono);
        font-size: 10px;
        letter-spacing: .14em;
        text-align: center;
        border: 1px solid var(--fg);
        white-space: nowrap;
        border-radius: 2px;
        animation: kc-bottombar-pulse 4.4s ease-out infinite;
    }
    .kc-bottom-bar__btn:nth-child(2) {
        animation-delay: 1.2s;
    }
    .kc-bottom-bar__btn--outline {
        background: transparent;
        color: var(--fg) !important;
    }
    .kc-bottom-bar__btn--solid {
        background: var(--fg);
        color: var(--bg) !important;
    }
    @keyframes kc-bottombar-pulse {
        0%   { box-shadow: 0 0 0 0 rgba(27, 167, 166, .45); }
        70%  { box-shadow: 0 0 0 8px rgba(27, 167, 166, 0); }
        100% { box-shadow: 0 0 0 0 rgba(27, 167, 166, 0); }
    }
    /* Padding footer để content không bị bar che khuất */
    .kc-footer { padding-bottom: 74px; }
}

/* ── Floating Contact Buttons ── */
.kc-float {
    position: fixed;
    bottom: 32px;
    right: 28px;
    z-index: 999;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 10px;
}
.kc-float__toggle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--fg);
    color: var(--bg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(28,26,22,.22);
    transition: background .2s, transform .2s;
    flex-shrink: 0;
}
.kc-float__toggle:hover { background: #333; transform: scale(1.05); }
.kc-float__icon-close { display: none; }
.kc-float.is-open .kc-float__icon-chat  { display: none; }
.kc-float.is-open .kc-float__icon-close { display: block; }

.kc-float__menu {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease;
}
.kc-float.is-open .kc-float__menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.kc-float__btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(28,26,22,.18);
    transition: transform .2s, box-shadow .2s;
    flex-shrink: 0;
}
.kc-float__btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(28,26,22,.28);
}
.kc-float__btn--phone    { background: #1C1A16; }
.kc-float__btn--zalo     { background: #0068FF; }
.kc-float__btn--wa       { background: #25D366; }
.kc-float__btn--messenger { background: linear-gradient(135deg, #0099FF 0%, #A033FF 100%); }
.kc-float__btn--tuvan    { background: #C0392B; }

/* Tooltip label bên trái nút */
.kc-float__label {
    position: absolute;
    right: calc(100% + 10px);
    background: var(--fg);
    color: var(--bg);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .06em;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 3px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
}
.kc-float__label::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: var(--fg);
}
.kc-float__btn:hover .kc-float__label { opacity: 1; }

/* Mobile: ẩn floating vì đã có bottom bar */
@media (max-width: 767px) {
    .kc-float { bottom: 84px; right: 14px; }
    .kc-float__toggle { width: 46px; height: 46px; }
    .kc-float__btn { width: 40px; height: 40px; }
    .kc-float__label { display: none; }
}

/* ── Mobile ── */
@media (max-width: 767px) {
    :root {
        --pad-h: 20px;
        --nav-h: 54px;
    }
    /* Fixed nav trên mobile — tránh jump do browser address bar show/hide */
    .kc-nav {
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
    }
    .kc-main { padding-top: var(--nav-h); }
    .kc-nav__menu { display: none; }
    .kc-nav__ham  { display: flex; }

    .kc-footer__top {
        grid-template-columns: 1fr;
        gap: 36px;
        padding: 40px var(--pad-h);
    }
    .kc-footer__bottom { flex-direction: column; align-items: flex-start; gap: 4px; }
}
