/**
 * Layout CSS: Header, Navigation, Breadcrumb, Footer, Contact Buttons, Lightbox
 */

/* --- TOPBAR --- */
.bml-topbar {
    position: relative;
    z-index: 1000;
    background-color: var(--primary-dark);
    color: rgba(255, 255, 255, 0.92);
    font-size: 13.5px;
    padding: 7px 0;
}

.bml-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.bml-topbar-left,
.bml-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bml-top-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.92);
}

.bml-top-item:hover {
    color: #fff;
}

.bml-top-sep {
    opacity: 0.4;
}

.bml-top-hotline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    padding: 3px 12px;
    border-radius: 999px;
}

.bml-top-hotline:hover {
    background: var(--secondary-color);
    color: #fff;
}

/* GTranslate tích hợp gọn trên Header */
.bml-header-lang,
.bml-mobile-lang {
    position: relative;
    z-index: 1005;
    display: inline-flex;
    align-items: center;
}

.bml-header-lang .gt_float_switcher,
.bml-mobile-lang .gt_float_switcher {
    position: relative !important;
    display: inline-block !important;
    box-shadow: none !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    padding: 0 !important;
    overflow: visible !important;
}

.bml-header-lang .gt_float_switcher .gt-selected,
.bml-mobile-lang .gt_float_switcher .gt-selected {
    background: transparent !important;
}

.bml-header-lang .gt_float_switcher .gt-current-lang,
.bml-mobile-lang .gt_float_switcher .gt-current-lang {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
    padding: 3px 8px !important;
    line-height: 1 !important;
}

.gt_float_switcher img {
    width: 20px !important;
    height: 20px !important;
    aspect-ratio: 1 / 1;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.gt_float_switcher .gt_selected .gt-current-lang span.gt-lang-code {
    font-size: 12px !important;
    line-height: 1 !important;
}

.bml-header-lang .gt_float_switcher .gt_options,
.bml-mobile-lang .gt_float_switcher .gt_options {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    min-width: 175px !important;
    max-height: 280px !important;
    overflow-y: auto !important;
    background: #FFFFFF !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-lg) !important;
    z-index: 1020 !important;
}

.bml-header-lang .gt_float_switcher .gt_options a:hover,
.bml-mobile-lang .gt_float_switcher .gt_options a:hover {
    background: var(--primary-soft) !important;
    color: var(--primary-color) !important;
}

.bml-mobile-lang {
    display: none;
}

/* --- MAIN STICKY HEADER --- */
.bml-header {
    position: sticky;
    top: 0;
    z-index: 990;
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.bml-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 74px;
}

.bml-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.bml-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-subtle);
}

.bml-brand-text {
    display: flex;
    flex-direction: column;
}

.bml-brand-name {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--primary-color);
    line-height: 1.1;
}

.bml-brand-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Navigation */
.bml-nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 6px;
}

.bml-nav-list > li {
    position: relative;
}

.bml-nav-list > li > a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-main);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.bml-nav-list > li > a:hover,
.bml-nav-list > li.current-menu-item > a,
.bml-nav-list > li.current-menu-ancestor > a {
    color: var(--primary-color);
    background-color: var(--primary-soft);
}

/* Submenu */
.bml-nav-list .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
    z-index: 999;
}

.bml-nav-list > li:hover > .sub-menu,
.bml-nav-list > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.bml-nav-list .sub-menu a {
    display: block;
    padding: 9px 16px;
    font-size: 14px;
    color: var(--text-main);
}

.bml-nav-list .sub-menu a:hover {
    background: var(--primary-soft);
    color: var(--primary-color);
}

.bml-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bml-btn-menu-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background-color: var(--primary-color);
    color: #fff !important;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 10px 18px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(158, 34, 34, 0.22);
}

.bml-btn-menu-cta:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.bml-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 8px;
    background: var(--bg-cream);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.bml-mobile-toggle span {
    display: block;
    width: 100%;
    height: 2.5px;
    background: var(--text-main);
    border-radius: 2px;
}

/* Mobile Drawer */
.bml-mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.bml-mobile-drawer.is-open {
    visibility: visible;
    opacity: 1;
}

.bml-mobile-drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.bml-mobile-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(320px, 86vw);
    height: 100%;
    background: #fff;
    padding: 20px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bml-mobile-drawer.is-open .bml-mobile-drawer-panel {
    transform: translateX(0);
}

.bml-mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.bml-mobile-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--text-main);
    cursor: pointer;
}

.bml-mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bml-mobile-nav-list li {
    border-bottom: 1px dashed var(--border-subtle);
}

.bml-mobile-nav-list a {
    display: block;
    padding: 12px 4px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    color: var(--text-main);
}

.bml-mobile-nav-list .sub-menu {
    list-style: none;
    padding-left: 16px;
    margin-bottom: 8px;
}

.bml-mobile-nav-list .sub-menu a {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 14px;
    padding: 8px 4px;
    color: var(--text-muted);
}

.bml-mobile-drawer-info {
    background: var(--bg-cream);
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
}

.bml-mobile-drawer-info p {
    margin: 0 0 8px;
}

.bml-drawer-call {
    display: block;
    text-align: center;
    background: var(--primary-color);
    color: #fff !important;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-top: 10px;
}

/* --- BREADCRUMB --- */
.bml-breadcrumb {
    font-size: 14px;
    color: var(--text-muted);
    padding: 16px 0 6px;
}

.bml-breadcrumb .rank-math-breadcrumb p {
    margin: 0;
}

.bml-breadcrumb a {
    color: var(--primary-color);
    font-weight: 500;
}

/* --- FOOTER --- */
.bml-footer {
    background-color: #211C1A;
    color: #E5DFDA;
    padding-top: 56px;
    margin-top: 40px;
}

.bml-footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.9fr 1.1fr;
    gap: 36px;
    padding-bottom: 44px;
}

.bml-footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.bml-footer-brand img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
}

.bml-footer-title {
    color: #fff;
    font-size: 20px;
    margin: 0 0 4px;
}

.bml-footer-tagline {
    margin: 0;
    font-size: 13.5px;
    color: #C7BEB8;
}

.bml-footer-info {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    font-size: 14.5px;
}

.bml-footer-info li {
    margin-bottom: 8px;
}

.bml-footer-info a {
    color: var(--secondary-color);
    font-weight: 600;
}

.bml-footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bml-footer-socials a {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.bml-footer-socials a:hover {
    background: var(--primary-color);
}

.bml-footer-heading {
    color: #fff;
    font-size: 18px;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.bml-footer-menu {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.bml-footer-menu li {
    margin-bottom: 8px;
}

.bml-footer-menu a {
    color: #E5DFDA;
    font-size: 14.5px;
}

.bml-footer-menu a:hover {
    color: var(--secondary-color);
}

.bml-footer-note {
    font-size: 13.5px;
    color: #B4ABA5;
    line-height: 1.6;
}

.bml-footer-map iframe {
    border-radius: var(--radius-md);
    display: block;
    background: #2E2825;
}

.bml-map-btn {
    display: inline-block;
    margin-top: 12px;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 14px;
}

.bml-footer-bottom {
    background-color: #161211;
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.bml-footer-bottom-inner {
    text-align: center;
    font-size: 13.5px;
    color: #A39A94;
}

.bml-footer-bottom-inner p {
    margin: 0;
}

/* Đảm bảo trang no-sidebar căn giữa tuyệt đối */
.no-sidebar #primary,
.no-sidebar .content-area,
.bml-page-container {
    width: 100% !important;
    float: none !important;
    margin-left: auto;
    margin-right: auto;
}

/* Ẩn widget GTranslate thả nổi dư thừa ở góc dưới trên mọi thiết bị */
#gt_float_wrapper,
.gt_float_switcher {
    display: none !important;
}

.bml-header-lang .gt_float_switcher,
.bml-mobile-lang .gt_float_switcher,
.bml-header-lang #gt_float_wrapper,
.bml-mobile-lang #gt_float_wrapper {
    display: inline-block !important;
    position: static !important;
}

@media (min-width: 961px) and (max-width: 1280px) {
    .hvd-contact-desktop {
        right: 6px;
    }
    .hvd-contact-desktop .contact-btn {
        width: 36px;
        height: 36px;
    }
}

/* --- FLOATING CONTACT BUTTONS --- */
.hvd-contact-desktop {
    position: fixed;
    right: 12px;
    bottom: 24px;
    z-index: 950;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hvd-contact-desktop .contact-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease;
}

.hvd-contact-desktop .contact-btn:hover {
    transform: scale(1.08);
}

.btn-zalo { background: #0068FF; }
.btn-phone-main { background: var(--primary-color); }
.btn-phone-sub { background: #16A34A; }
.btn-maps { background: #EA4335; }
.btn-contact, .btn-email { background: var(--secondary-color); }

.hvd-contact-mobile {
    display: none;
}

/* Popup Contact */
.hvd-contact-popup {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.hvd-contact-popup.active {
    display: flex;
}

.hvd-popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.hvd-popup-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.hvd-popup-header {
    background: var(--primary-color);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hvd-popup-header h4 {
    margin: 0;
    color: #fff;
    font-size: 18px;
}

.hvd-popup-close {
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.hvd-popup-body {
    padding: 20px;
}

.hvd-popup-body p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
}

/* --- FANCYBOX & ADMIN BAR FIX --- */
.fancybox__container {
    z-index: 100001 !important;
}

body.admin-bar .fancybox__container {
    padding-top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .fancybox__container {
        padding-top: 46px;
    }
}

/* Con trỏ zoom cho ảnh trong bài viết */
.entry-content a[data-fancybox] img {
    cursor: zoom-in;
    transition: transform 0.25s ease;
}

.entry-content a[data-fancybox]:hover img {
    transform: scale(1.015);
}

/* --- RESPONSIVE --- */
@media (max-width: 960px) {
    .bml-topbar,
    .bml-nav,
    .bml-btn-menu-cta {
        display: none;
    }

    .bml-mobile-lang {
        display: inline-flex;
    }

    .bml-mobile-toggle {
        display: flex;
    }

    .bml-footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 68px;
    }

    .bml-header-inner {
        min-height: 58px;
        gap: 8px;
    }

    .bml-brand {
        gap: 8px;
        min-width: 0;
    }

    .bml-logo {
        width: 40px;
        height: 40px;
    }

    .bml-brand-name {
        font-size: 16px;
    }

    .bml-brand-sub {
        font-size: 10.5px;
    }

    .bml-header-actions {
        gap: 6px;
        flex-shrink: 0;
    }

    .bml-mobile-lang .gt_float_switcher .gt-current-lang {
        padding: 2px 6px !important;
        gap: 3px !important;
    }

    .bml-mobile-lang .gt_float_switcher img {
        width: 16px !important;
        height: 16px !important;
    }

    .bml-mobile-lang .gt_float_switcher .gt-lang-code {
        font-size: 11px !important;
    }

    .bml-mobile-toggle {
        width: 36px;
        height: 36px;
        padding: 7px;
    }

    .hvd-contact-desktop {
        display: none;
    }

    .hvd-contact-mobile {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 960;
        background: #fff;
        border-top: 1px solid var(--border-subtle);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        padding: 6px 8px;
    }

    .hvd-mobile-col {
        display: flex;
        align-items: center;
        justify-content: space-around;
    }

    .hvd-contact-mobile .m-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        font-size: 11px;
        font-weight: 500;
        color: var(--text-main);
        padding: 4px;
    }

    .hvd-mobile-center .m-btn {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: var(--primary-color);
        color: #fff;
        justify-content: center;
        margin-top: -22px;
        box-shadow: 0 4px 12px rgba(158, 34, 34, 0.35);
        border: 3px solid #fff;
    }

    .hvd-mobile-center .m-btn span {
        display: none;
    }

    /* Ẩn widget GTranslate thả nổi mặc định nếu vẫn xuất hiện ở góc dưới */
    #gt_float_wrapper {
        display: none !important;
    }
}
