.main-header .custom-header-top {
    background-color: #30382f;
    height: 32px;
    color: #f8f4ed;
    font-weight: 400;
    font-size: 11px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-header .custom-header-top p {
    margin-bottom: 0;
}

.main-header .custom-header-top svg {
    margin-left: 12px;
    cursor: pointer;
}

:where(.custom-mega-menu) *,
:where(.custom-mega-menu) *::before,
:where(.custom-mega-menu) *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
:where(.custom-mega-menu) a {
    color: inherit;
    text-decoration: none;
}
:where(.custom-mega-menu) ul {
    list-style: none;
}

/* ---------- Header ---------- */
.custom-mega-menu {
    line-height: 1.5;
    position: sticky;
    top: 0;
    z-index: 50;
    height: 72px;
    background: #FAF8F4;
    border-bottom: 1px solid #e3e8ef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(16px, 4vw, 48px);
}
.custom-mega-menu__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}
.custom-mega-menu__brand i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #14213d;
    position: relative;
}
.custom-mega-menu__brand i::after {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: #0f9d8a;
}

.custom-mega-menu__menu > ul {
    display: flex;
    align-items: center;
    gap: 4px;
}
.custom-mega-menu__menu > ul > li {
    position: static;
    margin-bottom: 0 !important;
}
.custom-mega-menu__trigger,
.custom-mega-menu__plain {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 6px;
    height: 72px;
    padding: 0 16px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    color: #302E29;
    transition: color 0.25s;
    margin-bottom: 0 !important;
}
.custom-mega-menu__trigger svg {
    width: 14px;
    height: 14px;
    transition: transform 0.35s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.custom-mega-menu__trigger::after,
.custom-mega-menu__plain::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: -1px;
    height: 2px;
    background: #946449;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.custom-mega-menu__sub-toggle {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.custom-mega-menu__cta {
    margin-left: 12px;
    padding: 10px 20px;
    border-radius: 999px;
    background: #14213d;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.3s, transform 0.3s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.custom-mega-menu__cta:hover {
    background: #0f9d8a;
    transform: translateY(-1px);
}
.custom-mega-menu__burger {
    display: none;
}
.custom-mega-menu__nav-toggle {
    display: none !important;
}

/* ---------- Ô tìm kiếm ---------- */
.custom-mega-menu__search {
    margin-left: 8px;
}
.custom-mega-menu__search form {
    margin-bottom: 0 !important;
}
.custom-mega-menu__search label {
    position: relative;
    display: block;
}
.custom-mega-menu__search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    stroke: #5b6678;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    transition: stroke 0.3s;
}
.custom-mega-menu__search input {
    width: 190px;
    height: 42px;
    padding: 0 16px 0 42px;
    border: 1px solid #e3e8ef;
    border-radius: 999px;
    background: #EEE9E1;
    font: inherit;
    font-size: 0.9rem;
    color: #777167;
    outline: none;
    transition: width 0.45s cubic-bezier(0.22, 0.8, 0.3, 1), background 0.3s,
    border-color 0.3s, box-shadow 0.3s;
    margin-bottom: 0 !important;
}
.custom-mega-menu__search input::placeholder {
    color: #777167;
}
.custom-mega-menu__search input:hover {
    border-color: #EEE9E1;
}
.custom-mega-menu__search input:focus {
    width: 280px;
    background: #fff;
    border-color: #946449;
    box-shadow: 0 0 0 4px #EEE9E1;
}
.custom-mega-menu__search label:focus-within svg {
    stroke: #946449;
}
@media (min-width: 901px) and (max-width: 1100px) {
    .custom-mega-menu__search input {
        width: 150px;
    }
    .custom-mega-menu__search input:focus {
        width: 210px;
    }
}

/* ---------- Mega panel (desktop) ---------- */
@media (min-width: 901px) {
    .custom-mega-menu__mega {
        z-index: 2;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: #ffffff;
        border-bottom: 1px solid #e3e8ef;
        box-shadow: 0 24px 48px -24px rgba(20, 33, 61, 0.25);
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: opacity 0.3s ease,
        transform 0.45s cubic-bezier(0.22, 0.8, 0.3, 1), visibility 0s 0.45s;
    }
    .custom-mega-menu__mega-inner {
        max-width: 1200px;
        margin: 0 auto;
        padding: 36px clamp(16px, 4vw, 48px) 40px;
        display: grid;
        grid-template-columns: repeat(3, 1fr) 1.3fr;
        gap: 40px;
    }

    .custom-mega-menu__has-mega:hover > .custom-mega-menu__mega,
    .custom-mega-menu__has-mega:focus-within > .custom-mega-menu__mega,
    .custom-mega-menu__has-mega:has(.custom-mega-menu__sub-toggle:checked)
    > .custom-mega-menu__mega {
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: opacity 0.3s ease,
        transform 0.45s cubic-bezier(0.22, 0.8, 0.3, 1), visibility 0s;
    }

    .custom-mega-menu__has-mega:hover > .custom-mega-menu__trigger,
    .custom-mega-menu__has-mega:focus-within > .custom-mega-menu__trigger,
    .custom-mega-menu__has-mega:has(.custom-mega-menu__sub-toggle:checked)
    > .custom-mega-menu__trigger {
        color: #946449;
    }
    .custom-mega-menu__has-mega:hover > .custom-mega-menu__trigger::after,
    .custom-mega-menu__has-mega:focus-within > .custom-mega-menu__trigger::after,
    .custom-mega-menu__has-mega:has(.custom-mega-menu__sub-toggle:checked)
    > .custom-mega-menu__trigger::after,
    .custom-mega-menu__plain:hover::after {
        transform: scaleX(1);
    }
    .custom-mega-menu__has-mega:hover > .custom-mega-menu__trigger svg,
    .custom-mega-menu__has-mega:focus-within > .custom-mega-menu__trigger svg {
        transform: rotate(180deg);
    }

    /* Các cột trượt vào lần lượt */
    .custom-mega-menu__mega .custom-mega-menu__col,
    .custom-mega-menu__mega .custom-mega-menu__feature {
        opacity: 0;
        transform: translateY(14px);
        transition: opacity 0.3s ease,
        transform 0.45s cubic-bezier(0.22, 0.8, 0.3, 1);
    }
    .custom-mega-menu__has-mega:hover .custom-mega-menu__col,
    .custom-mega-menu__has-mega:hover .custom-mega-menu__feature,
    .custom-mega-menu__has-mega:focus-within .custom-mega-menu__col,
    .custom-mega-menu__has-mega:focus-within .custom-mega-menu__feature,
    .custom-mega-menu__has-mega:has(.custom-mega-menu__sub-toggle:checked)
    .custom-mega-menu__col,
    .custom-mega-menu__has-mega:has(.custom-mega-menu__sub-toggle:checked)
    .custom-mega-menu__feature {
        opacity: 1;
        transform: none;
    }
    .custom-mega-menu__mega .custom-mega-menu__col:nth-child(1) {
        transition-delay: 0.04s;
    }
    .custom-mega-menu__mega .custom-mega-menu__col:nth-child(2) {
        transition-delay: 0.09s;
    }
    .custom-mega-menu__mega .custom-mega-menu__col:nth-child(3) {
        transition-delay: 0.14s;
    }
    .custom-mega-menu__mega .custom-mega-menu__feature {
        transition-delay: 0.19s;
    }

    /* Panel nhỏ gọn cho mục thứ hai */
    .custom-mega-menu__mega.custom-mega-menu__compact
    .custom-mega-menu__mega-inner {
        grid-template-columns: repeat(2, 1fr) 1.3fr;
    }
}

/* ---------- Nội dung panel ---------- */
.custom-mega-menu__col a {
    display: flex;
    gap: 14px;
    padding: 10px 12px;
    margin: 0 -12px;
    border-radius: 12px;
    transition: background 0.25s, transform 0.35s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.custom-mega-menu__col a:hover,
.custom-mega-menu__col a:focus-visible {
    background: #FAF8F4;
    transform: translateX(4px);
    outline: none;
}
.custom-mega-menu__ico {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f5f7fa;
    display: grid;
    place-items: center;
    transition: background 0.25s, color 0.25s;
}
.custom-mega-menu__ico svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.custom-mega-menu__col a:hover .custom-mega-menu__ico {
    background: #946449;
    color: #fff;
}
.custom-mega-menu__col strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
}
.custom-mega-menu__col span {
    display: block;
    font-size: 0.82rem;
    color: #5b6678;
}

.custom-mega-menu__feature {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 220px;
    padding: 24px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(150deg, #14213d 0%, #1d3a5f 55%, #0f9d8a 130%);
    position: relative;
    overflow: hidden;
}
.custom-mega-menu__feature::before {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -60px;
    top: -70px;
    border-radius: 50%;
    border: 36px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.8s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.custom-mega-menu__feature:hover::before {
    transform: scale(1.25) rotate(20deg);
}
.custom-mega-menu__feature h4 {
    font-size: 1.2rem;
    line-height: 1.3;
    margin-bottom: 6px;
}
.custom-mega-menu__feature p {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 16px;
}
.custom-mega-menu__feature a {
    align-self: flex-start;
    padding: 8px 16px;
    border-radius: 999px;
    background: #fff;
    color: #14213d;
    font-weight: 600;
    font-size: 0.85rem;
    transition: transform 0.3s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.custom-mega-menu__feature a:hover {
    transform: translateY(-2px);
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
    .custom-mega-menu__burger {
        display: grid !important;
        place-items: center;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        cursor: pointer;
        position: relative;
    }
    .custom-mega-menu__burger span,
    .custom-mega-menu__burger span::before,
    .custom-mega-menu__burger span::after {
        content: "";
        display: block;
        width: 20px;
        height: 2px;
        background: #14213d;
        border-radius: 2px;
        transition: transform 0.35s cubic-bezier(0.22, 0.8, 0.3, 1), background 0.2s;
    }
    .custom-mega-menu__burger span {
        position: relative;
    }
    .custom-mega-menu__burger span::before {
        position: absolute;
        top: -6px;
    }
    .custom-mega-menu__burger span::after {
        position: absolute;
        top: 6px;
    }
    .custom-mega-menu__nav-toggle {
        display: block !important;
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }
    .custom-mega-menu__nav-toggle:checked ~ .custom-mega-menu__burger span {
        background: transparent;
    }
    .custom-mega-menu__nav-toggle:checked
    ~ .custom-mega-menu__burger
    span::before {
        transform: translateY(6px) rotate(45deg);
    }
    .custom-mega-menu__nav-toggle:checked
    ~ .custom-mega-menu__burger
    span::after {
        transform: translateY(-6px) rotate(-45deg);
    }
    .custom-mega-menu__nav-toggle:focus-visible ~ .custom-mega-menu__burger {
        outline: 2px solid #0f9d8a;
    }

    .custom-mega-menu__menu {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: #ffffff;
        display: grid;
        grid-template-rows: 0fr;
        transition: grid-template-rows 0.45s cubic-bezier(0.22, 0.8, 0.3, 1);
        border-bottom: 1px solid transparent;
    }
    .custom-mega-menu__nav-toggle:checked ~ .custom-mega-menu__menu {
        grid-template-rows: 1fr;
        border-bottom-color: #e3e8ef;
    }
    .custom-mega-menu__menu > ul {
        display: block;
        min-height: 0;
        overflow: hidden auto;
        max-height: calc(100vh - 72px);
        padding: 0 16px;
    }
    .custom-mega-menu__menu > ul > .custom-mega-menu__has-mega {
        position:relative
    }
    .custom-mega-menu__nav-toggle:checked ~ .custom-mega-menu__menu > ul {
        padding: 8px 16px 20px;
    }
    .custom-mega-menu__trigger,
    .custom-mega-menu__plain {
        height: 54px;
        padding: 0 4px;
        justify-content: space-between;
        border-bottom: 1px solid #e3e8ef;
        display: flex !important;
    }
    .custom-mega-menu__trigger::after,
    .custom-mega-menu__plain::after {
        display: none;
    }
    .custom-mega-menu__sub-toggle {
        width: 100%;
        height: 54px;
        top: 0;
        left: 0;
    }
    .custom-mega-menu__sub-toggle:checked + .custom-mega-menu__trigger svg {
        transform: rotate(180deg);
    }
    .custom-mega-menu__sub-toggle:focus-visible + .custom-mega-menu__trigger {
        outline: 2px solid #0f9d8a;
        outline-offset: -2px;
    }
    .custom-mega-menu__has-mega {
        position: relative;
    }

    .custom-mega-menu__mega {
        display: grid;
        grid-template-rows: 0fr;
        transition: grid-template-rows 0.45s cubic-bezier(0.22, 0.8, 0.3, 1);
    }
    .custom-mega-menu__sub-toggle:checked ~ .custom-mega-menu__mega {
        grid-template-rows: 1fr;
    }
    .custom-mega-menu__mega-inner {
        min-height: 0;
        overflow: hidden;
        display: grid;
        gap: 8px;
        padding: 0 4px;
    }
    .custom-mega-menu__sub-toggle:checked
    ~ .custom-mega-menu__mega
    .custom-mega-menu__mega-inner {
        padding: 16px 4px 8px;
    }
    .custom-mega-menu__col {
        margin-bottom: 8px;
    }
    .custom-mega-menu__feature {
        min-height: 160px;
    }
    .custom-mega-menu__cta {
        display: block;
        margin: 16px 0 0;
        text-align: center;
    }
    .custom-mega-menu__search {
        margin: 12px 0 4px;
    }
    .custom-mega-menu__search input,
    .custom-mega-menu__search input:focus {
        width: 100%;
    }
}

/* ---------- Truy cập ---------- */
.custom-mega-menu a:focus-visible {
    outline: 2px solid #0f9d8a;
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    .custom-mega-menu *,
    .custom-mega-menu *::before,
    .custom-mega-menu *::after {
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }
}
