/* ============================================================
   HBTN main.css — bổ sung cho TRANG CON + mobile nav
   (home.css của mockup lo phần base/header/footer/homepage)
   ============================================================ */

/* ---- Mobile menu (header .main-nav mở bằng hamburger) ---- */
.nav-close { display: none; }/* chỉ hiện trong mobile panel */
@media (max-width: 1024px) {
    .site-header .main-nav {
        position: fixed; top: 0; right: -100%;
        width: 300px; max-width: 84vw; height: 100dvh;
        background: #0f172a; flex-direction: column; align-items: flex-start;
        gap: 0; padding: 84px 24px 24px; overflow-y: auto;
        transition: right .38s cubic-bezier(.4,0,.2,1);
        box-shadow: -14px 0 44px rgba(0,0,0,.4); z-index: 1200;
    }
    .site-header .main-nav.open { right: 0; }
    .site-header .main-nav a {
        width: 100%; padding: 15px 4px; font-size: 16px;
        color: #e2e8f0; border-bottom: 1px solid rgba(255,255,255,.08);
    }
    .nav-overlay {
        position: fixed; inset: 0; background: rgba(15,23,42,.55);
        opacity: 0; visibility: hidden; transition: .3s; z-index: 1100;
    }
    .nav-overlay.show { opacity: 1; visibility: visible; }
    .nav-close {
        position: absolute; top: 18px; right: 18px; width: 40px; height: 40px;
        display: flex; align-items: center; justify-content: center;
        background: none; border: none; color: #fff; cursor: pointer; font-size: 28px;
    }
}

/* ---- Trang con (page / single / archive / 404) ---- */
.page-head {
    padding: 64px 0 44px; background: #0f172a;
    background-image: radial-gradient(120% 80% at 100% 0%, rgba(204,0,0,.35), transparent 55%);
    color: #fff;
}
.page-head .page-title { color: #fff; font-size: clamp(30px,4vw,46px); font-weight: 900; letter-spacing: -.5px; }
.page-head .post-meta { color: #94a3b8; margin-top: 10px; }
.page-body { padding: 60px 0; }
.entry-content { font-size: 17px; line-height: 1.8; color: #334155; }
.entry-content h2, .entry-content h3 { color: #0f172a; margin: 1.4em 0 .5em; font-weight: 800; }
.entry-content p { margin-bottom: 1em; }
.entry-content img { max-width: 100%; height: auto; display: block; border-radius: 14px; margin: 1.6em auto; box-shadow: 0 10px 30px rgba(15,23,42,.10); }
.entry-content a { color: #CC0000; }
.single-thumb { margin-bottom: 32px; border-radius: 20px; overflow: hidden; }

.post-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 26px; }
.car-grid-page  { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.post-card, .car-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
    overflow: hidden; transition: .3s cubic-bezier(.4,0,.2,1);
}
.post-card:hover, .car-card:hover { transform: translateY(-5px); box-shadow: 0 18px 44px rgba(15,23,42,.12); }
.post-card-thumb { display: block; aspect-ratio: 16/10; background: #f1f5f9; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
/* Tuyển dụng: thumbnail A4 dọc, hiện trọn poster (không crop) */
.category-tuyen-dung .post-card-thumb { aspect-ratio: 210 / 297; background: #fff; }
.category-tuyen-dung .post-card-thumb img { object-fit: contain; }
.car-card-media { display: flex; align-items: center; justify-content: center; aspect-ratio: 4/3; background: linear-gradient(135deg,#f1f5f9,#e2e8f0); padding: 14px; }
.car-card-media img { width: 100%; height: 100%; object-fit: contain; }
.post-card-body, .car-card-body { padding: 20px 22px; }
.post-card-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; color: #0f172a; }
.post-card-title a:hover { color: #CC0000; }
.car-card-name { font-size: 19px; font-weight: 800; color: #0f172a; }
.car-card-price { margin-top: 8px; color: #CC0000; font-weight: 800; }
.post-card-excerpt { font-size: 14px; color: #475569; }

.pagination { margin-top: 44px; text-align: center; }
.pagination .page-numbers { display: inline-block; padding: 9px 15px; margin: 0 3px; border-radius: 8px; background: #f1f5f9; font-weight: 700; color: #334155; }
.pagination .current { background: #CC0000; color: #fff; }

.btn-cta { display: inline-flex; align-items: center; gap: 8px; background: #CC0000; color: #fff; font-weight: 700; padding: 14px 30px; border-radius: 40px; transition: .25s; }
.btn-cta:hover { background: #A30000; transform: translateY(-2px); }

@media (max-width: 1024px) { .post-grid { grid-template-columns: repeat(2,1fr); } .car-grid-page { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px)  { .post-grid, .car-grid-page { grid-template-columns: 1fr; } }

/* ============================================================
   HEADER 2 TẦNG (task #66)
   ============================================================ */
.site-hdr { position: relative; z-index: 200; }
/* Tầng 1 */
.hdr-top { background: #fff; border-bottom: 1px solid #eef2f7; }
.hdr-top-inner { display: flex; align-items: center; gap: 24px; padding: 14px 0; }
.hdr-logo { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.hdr-logo img { height: 46px; width: auto; }
.hdr-logo-text strong { display: block; font-weight: 800; font-size: 16px; color: #0f172a; line-height: 1.2; }
.hdr-logo-text small { font-size: 12px; color: #64748b; }
.hdr-contact { display: flex; gap: 22px; }
.hdr-contact-item { display: flex; align-items: center; gap: 10px; color: #334155; }
.hdr-contact-item .material-symbols-outlined { color: #CC0000; background: rgba(204,0,0,.09); width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.hdr-contact-txt { display: flex; flex-direction: column; line-height: 1.25; }
.hdr-contact-txt em { font-style: normal; font-size: 12px; color: #94a3b8; }
.hdr-contact-txt strong { font-size: 15px; color: #0f172a; font-weight: 800; }
.hdr-cta { display: inline-flex; align-items: center; gap: 8px; background: #CC0000; color: #fff; font-weight: 700; font-size: 15px; padding: 12px 24px; border-radius: 40px; white-space: nowrap; transition: .2s; }
.hdr-cta:hover { background: #A30000; }
.hdr-mobile-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; background: none; border: none; cursor: pointer; color: #0f172a; padding: 4px; }
/* Tầng 2 (sticky) */
.hdr-nav { position: sticky; top: 0; z-index: 150; background: #CC0000; transition: box-shadow .3s, background .3s; }
body.admin-bar .hdr-nav { top: 32px; }
.hdr-nav.scrolled { box-shadow: 0 6px 22px rgba(204,0,0,.28); background: rgba(204,0,0,.97); backdrop-filter: blur(10px); }
.hdr-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.hdr-menu { display: flex; align-items: center; gap: 2px; }
.hdr-menu a { display: block; padding: 9px 16px; font-weight: 600; font-size: 15px; color: #fff; border-radius: 8px; transition: .2s; }
.hdr-menu a:hover, .hdr-menu a.current-menu-item { color: #ffd23c; background: rgba(255,255,255,.14); }
.hdr-search-btn { background: none; border: none; cursor: pointer; color: #fff; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: .2s; }
.hdr-search-btn:hover { background: rgba(255,255,255,.18); color: #fff; }

/* Dropdown "Dịch vụ" (desktop hover) — hỗ trợ cả markup fallback (.hdr-has-sub/.hdr-sub) lẫn wp_nav_menu (.menu-item-has-children/.sub-menu) */
.hdr-item.hdr-has-sub, .hdr-menu .menu-item-has-children { position: relative; }
.hdr-has-sub > a { display: flex; align-items: center; gap: 2px; padding: 9px 14px; font-weight: 600; font-size: 15px; color: #fff; border-radius: 8px; transition: .2s; cursor: pointer; }
.hdr-has-sub > a:hover { color: #ffd23c; background: rgba(255,255,255,.14); }
.hdr-caret { font-size: 18px !important; transition: transform .2s; }
.hdr-sub, .hdr-menu .sub-menu {
    position: absolute; top: 100%; left: 0; min-width: 236px;
    background: #fff; border-radius: 10px; box-shadow: 0 16px 44px rgba(15,23,42,.20);
    padding: 8px; list-style: none; margin: 8px 0 0; z-index: 300;
    opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s;
}
.hdr-has-sub:hover .hdr-sub, .hdr-menu .menu-item-has-children:hover .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.hdr-has-sub:hover .hdr-caret { transform: rotate(180deg); }
.hdr-sub li, .hdr-menu .sub-menu li { margin: 0; }
.hdr-sub a, .hdr-menu .sub-menu a { display: block; padding: 10px 14px; border-radius: 7px; font-size: 14px; font-weight: 600; color: #1e293b; white-space: nowrap; }
.hdr-sub a:hover, .hdr-menu .sub-menu a:hover { background: rgba(204,0,0,.08); color: #CC0000; }

/* Search overlay */
.hdr-search { position: fixed; inset: 0; background: rgba(15,23,42,.92); backdrop-filter: blur(8px); z-index: 3000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: .3s; }
.hdr-search.open { opacity: 1; visibility: visible; }
.hdr-search-close { position: absolute; top: 26px; right: 30px; background: none; border: none; color: #fff; cursor: pointer; }
.hdr-search-close .material-symbols-outlined { font-size: 34px; }
.hdr-search-form { display: flex; align-items: center; width: 90%; max-width: 660px; border-bottom: 2px solid rgba(255,255,255,.6); }
.hdr-search-form input { flex: 1; background: none; border: none; color: #fff; font-size: clamp(20px,3vw,28px); padding: 14px 4px; outline: none; }
.hdr-search-form input::placeholder { color: rgba(255,255,255,.5); }
.hdr-search-form button { background: none; border: none; color: #fff; cursor: pointer; }
.hdr-search-form button .material-symbols-outlined { font-size: 30px; }

/* Footer social — SVG brand icons */
.footer-social-link { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
.footer-social-link svg { width: 18px; height: 18px; }

/* Video showroom section */
.section-video { padding: 80px 0; background: #fff; }
.video-frame { position: relative; max-width: 960px; margin: 0 auto; aspect-ratio: 16/9; border-radius: var(--radius-lg, 24px); overflow: hidden; background: #0f172a center/cover no-repeat; box-shadow: 0 26px 70px rgba(15,23,42,.2); }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: linear-gradient(160deg,#0f172a,#1a2540); color: #fff; }
.video-placeholder .material-symbols-outlined { font-size: 40px; color: #fff; background: #CC0000; width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(204,0,0,.5); }
.video-placeholder em { font-style: normal; color: #94a3b8; font-size: 15px; }

/* Mobile menu + overlay (site-wide) */
.nav-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); opacity: 0; visibility: hidden; transition: .3s; z-index: 1100; }
.nav-overlay.show { opacity: 1; visibility: visible; }
.nav-close { display: none; position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; align-items: center; justify-content: center; background: none; border: none; color: #fff; cursor: pointer; }
@media (max-width: 1024px) {
  .hdr-top-inner { padding: 12px 0; gap: 14px; }
  .hdr-logo img { height: 40px; }
  .hdr-contact, .hdr-cta { display: none; }
  .hdr-mobile-toggle { display: flex; margin-left: auto; }
  .hdr-nav { position: static; background: transparent; border: none; box-shadow: none; }
  .hdr-nav-inner { display: block; height: 0; overflow: visible; }
  .hdr-search-btn { display: none; }
  .hdr-menu { position: fixed; top: 0; right: -100%; width: 300px; max-width: 84vw; height: 100dvh; background: #0f172a; flex-direction: column; align-items: flex-start; gap: 0; padding: 78px 20px 24px; overflow-y: auto; transition: right .38s cubic-bezier(.4,0,.2,1); box-shadow: -14px 0 44px rgba(0,0,0,.4); z-index: 1200; }
  .hdr-menu.open { right: 0; }
  .hdr-menu a { width: 100%; padding: 15px 4px; color: #e2e8f0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 16px; }
  .hdr-menu a:hover { color: #fff; }
  .nav-close { display: flex; }
  /* Submenu Dịch vụ = accordion trên mobile */
  .hdr-item.hdr-has-sub { width: 100%; }
  .hdr-has-sub > a { width: 100%; padding: 15px 4px; color: #e2e8f0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 16px; justify-content: space-between; }
  .hdr-sub { position: static; opacity: 1; visibility: visible; transform: none; background: transparent; box-shadow: none; padding: 0 0 0 12px; margin: 0; min-width: 0; max-height: 0; overflow: hidden; transition: max-height .3s ease; }
  .hdr-has-sub.open .hdr-sub { max-height: 460px; }
  .hdr-has-sub.open .hdr-caret { transform: rotate(180deg); }
  .hdr-sub a { color: #cbd5e1; padding: 13px 4px; font-size: 15px; white-space: normal; }
  .hdr-sub a:hover { background: transparent; color: #fff; }
}

/* ═══════════ NÚT LÊN ĐẦU TRANG ═══════════ */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  /* trên thanh mobile-bar (z-index 90), dưới menu & overlay (999+) */
  z-index: 95;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--honda-red);
  color: #fff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .22);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;           /* ẩn khỏi cả thứ tự tab khi chưa hiện */
  transform: translateY(10px);
  transition: opacity .25s, transform .25s, visibility .25s, background .2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: #a30000; }
.to-top:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px var(--honda-red); }
.to-top .material-symbols-outlined { font-size: 24px; line-height: 1; }

/* Trên mobile phải nằm trên thanh điều hướng dưới cùng (72px) */
@media (max-width: 768px) {
  .to-top {
    right: 14px;
    bottom: calc(72px + 14px + env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .to-top { transform: none; transition: opacity .01s, visibility .01s; }
}

/* ═══════════ POPUP ĐĂNG KÝ LÁI THỬ ═══════════ */
.lead-popup { position: fixed; inset: 0; z-index: 3500; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lead-popup[hidden] { display: none; }
.lead-popup-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .28s; }
.lead-popup.is-open .lead-popup-backdrop { opacity: 1; }
.lead-popup-card { position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 40px); overflow-y: auto;
  background: #fff; border-radius: 20px; padding: 32px 28px 26px; box-shadow: 0 24px 70px rgba(15,23,42,.35);
  transform: translateY(16px) scale(.98); opacity: 0; transition: transform .3s cubic-bezier(.34,1.3,.5,1), opacity .28s; }
.lead-popup.is-open .lead-popup-card { transform: none; opacity: 1; }
.lead-popup-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: var(--dark-50); color: var(--dark-600); border-radius: 50%; cursor: pointer; transition: all .2s; }
.lead-popup-close:hover { background: var(--honda-red); color: #fff; }
.lead-popup-head { margin-bottom: 18px; padding-right: 34px; }
.lead-popup-head h2 { font-size: 1.4rem; font-weight: 800; color: var(--dark); margin: 8px 0 8px; line-height: 1.25; }
.lead-popup-head p { font-size: .9rem; color: var(--dark-600); line-height: 1.55; }
@media (prefers-reduced-motion: reduce) {
  .lead-popup-backdrop, .lead-popup-card { transition: opacity .01s; transform: none; }
}
