/* Header styles — extracted from layouts/partials/header.blade.php
   Static CSS, browser-cacheable. Linked in layouts/app.blade.php with ?v=filemtime. */
.nav-link-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--site-primary, #3B4FE8);
    border-radius: 2px 2px 0 0;
    transition: width 0.25s ease;
}

.nav-link-underline:hover::after,
.nav-link-underline.active::after {
    width: 70%;
}

#mainHeader .main-navbar,
#mainHeader .top-bar {
    transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

#mainHeader .top-bar {
    display: none;
}

#mainHeader.scrolled .top-bar {
    margin-top: 0;
}

.mega-link {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: 10px;
    padding: 10px 12px;
    color: #475569;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.mega-link:hover {
    background: #f8fafc;
    color: var(--site-primary, #3B4FE8);
    transform: translateX(2px);
}

.mega-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--site-primary-soft, #eef2ff);
    color: var(--site-primary, #3B4FE8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mega-icon svg {
    width: 18px;
    height: 18px;
}

.mega-panel {
    position: fixed !important;
    top: 84px !important;
    left: 50% !important;
    width: min(1220px, calc(100vw - 4rem));
    /* Liquid glass đồng bộ với header (đặt backdrop-filter trên CHÍNH panel
       là an toàn — chỉ ảnh hưởng nội dung bên trong, không phá vị trí fixed). */
    background: rgba(255, 255, 255, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
    border-radius: 20px !important;
    box-shadow: 0 18px 44px rgba(15, 23, 43, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
}

#mainHeader.scrolled .mega-panel {
    top: 64px !important;
}

.mega-grid {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 28px;
}

#mainHeader .text-\[\#3B4FE8\],
#mainHeader .hover\:text-\[\#3B4FE8\]:hover,
#mainHeader .group:hover .group-hover\:text-\[\#3B4FE8\] {
    color: var(--site-primary, #3B4FE8) !important;
}

#mainHeader .bg-\[\#3B4FE8\],
#mainHeader .hover\:bg-\[\#3B4FE8\]:hover {
    background-color: var(--site-primary, #3B4FE8) !important;
}

#mainHeader .bg-\[\#eef2ff\],
#mainHeader .hover\:bg-\[\#eef2ff\]:hover {
    background-color: var(--site-primary-soft, #eef2ff) !important;
}

#mainHeader .border-\[\#3B4FE8\],
#mainHeader .focus-within\:border-\[\#3B4FE8\]:focus-within {
    border-color: var(--site-primary, #3B4FE8) !important;
}

#mainHeader .from-\[\#5B6BF0\],
#mainHeader .from-\[\#3B4FE8\] {
    --tw-gradient-from: var(--site-primary-light, #5B6BF0) var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

#mainHeader .to-\[\#3B4FE8\],
#mainHeader .to-\[\#2B3FD9\] {
    --tw-gradient-to: var(--site-primary-dark, #2B3FD9) var(--tw-gradient-to-position) !important;
}

/* ============================================================
   Liquid glass header — 3 hộp pill nổi (logo · menu · button)
   ============================================================ */
#mainHeader .main-navbar {
    background: transparent !important;
    box-shadow: none !important;
}
/* Khoảng đệm để pill trôi cách mép trên (không sát top), giữ nhất quán
   cả khi đứng yên lẫn khi cuộn (padding nằm trong phần tử sticky). */
#mainHeader {
    padding: 24px 0 16px;
}
/* Header đè lên section đầu tiên (mọi trang) để pill trôi trên nền hero,
   bỏ dải nền trắng phía sau. Trị số = chiều cao header (24 + ~56 + 16 ≈ 96px). */
#mainHeader.header-overlay {
    margin-bottom: -96px;
}
/* Đẩy nội dung section đầu của TỪNG TRANG xuống dưới header nổi để không bị
   che (trang chủ dùng .hero-inner riêng nên không liệt kê ở đây). */
.about-hero,
.news-hero,
.pd-hero,
.contact-hero,
.service-hero,
.pricing-hero,
.domain-hero,
.hosting-landing-hero,
.theme-listing-hero,
.theme-detail-hero,
/* Trang chủ dùng .hero-section (không có .section) — đưa vào đây để top-spacing
   hero đồng nhất từ header.css thay vì padding-top nội bộ .hero-inner. */
main > section.hero-section:first-child,
main > section.section:first-child,
main > article.section:first-child,
/* Trang có breadcrumb đứng đầu (pages/show, posts/show, products/show):
   <nav.breadcrumb> là con đầu của <main> nên cần clearance để không bị header đè. */
main > .breadcrumb:first-child {
    padding-top: 120px !important;
}
#mainHeader.scrolled .main-navbar {
    background: transparent !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.nav-pill {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 6px 18px rgba(15, 23, 43, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}
.nav-pill--logo { padding: 5px 20px 5px 14px; }
.nav-pill--btn { padding: 6px 8px; gap: 8px; }

/* Hộp menu: sơn glass bằng ::before để KHÔNG trở thành containing block
   cho mega-panel (position: fixed) — giữ dropdown bám đúng viewport. */
.nav-pill--menu {
    position: relative;
    height: 52px;
    border-radius: 999px;
}
.nav-pill--menu::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 6px 18px rgba(15, 23, 43, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
}
.nav-pill--menu > li { z-index: 1; }
.nav-pill--menu::before {
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

/* Khi cuộn: bóng đậm hơn + nền đục hơn để pill nổi rõ trên các section,
   không bị chìm vào nội dung phía sau. */
#mainHeader.scrolled .nav-pill,
#mainHeader.scrolled .nav-pill--menu::before {
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 16px 38px rgba(15, 23, 43, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Neo mega-panel ngay dưới header glass */
.mega-panel { top: 84px !important; }
#mainHeader.scrolled .mega-panel { top: 84px !important; }

@media (max-width: 1023px) {
    .nav-pill--logo { padding: 4px 14px 4px 10px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .nav-pill, .nav-pill--menu::before { background: rgba(255, 255, 255, 0.93); }
}
