/* ===== Variables ===== */
:root {
    --mbws-primary: #d12650;
    --mbws-ocean: #06b6d4;
    --mbws-accent: #14b8a6;
    --mbws-sunset: #f97316;
    --mbws-coral: #fb7185;
    --mbws-sand: #fef3c7;
    --mbws-palm: #22c55e;
    --mbws-foreground: #0f172a;
    --mbws-muted: #64748b;
    --mbws-border: #e2e8f0;
    --mbws-card: #ffffff;
    --mbws-radius: 16px;
    --mbws-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* ===== Main Navigation ===== */
.mbws-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 16px;
}

.mbws-nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.5);
    border-radius: var(--mbws-radius);
    box-shadow: var(--mbws-shadow);
}

.mbws-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 64px;
}

/* ===== Logo ===== */
.mbws-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.mbws-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--mbws-primary), var(--mbws-ocean), var(--mbws-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px -10px rgba(8, 145, 178, 0.4);
    transition: all 0.5s ease;
    position: relative;
}

.mbws-logo:hover .mbws-logo-icon {
    transform: scale(1.1);
    box-shadow: 0 15px 40px -10px rgba(8, 145, 178, 0.5);
}

.mbws-logo-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.mbws-logo-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--mbws-sunset);
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mbws-logo-badge svg {
    width: 8px;
    height: 8px;
    color: white;
}

.mbws-logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--mbws-primary), var(--mbws-ocean), var(--mbws-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Menu Items ===== */
.mbws-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mbws-menu-item {
    position: relative;
}

.mbws-menu-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(15, 23, 42, 0.7);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.mbws-menu-link:hover,
.mbws-menu-item:hover>.mbws-menu-link {
    color: var(--mbws-primary);
    background: rgba(8, 145, 178, 0.1);
}

.mbws-menu-link svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.mbws-menu-item:hover>.mbws-menu-link svg {
    transform: rotate(180deg);
}

/* ===== Mega Menu ===== */
.mbws-mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding-top: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mbws-menu-item:hover .mbws-mega-menu {
    opacity: 1;
    visibility: visible;
}

.mbws-mega-inner {
    min-width: 700px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--mbws-radius);

    box-shadow: var(--mbws-shadow);
    overflow: hidden;
    animation: fadeIn 0.3s ease;
    padding: 0 !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mega Menu Header */
.mbws-mega-header {
    padding: 16px 24px !important;
    background: linear-gradient(135deg, rgba(8, 79, 178, 0.1), rgba(6, 64, 212, 0.1), rgba(20, 86, 184, 0.1));
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mbws-mega-title {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--mbws-foreground);
    margin: 0;
}

.mbws-mega-subtitle {
    font-size: 12px;
    color: var(--mbws-muted);
    margin: 4px 0 0;
}

.mbws-mega-viewall {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--mbws-primary) !important;
    text-decoration: none;
    transition: gap 0.3s ease;
    border: none !important;
    text-transform: unset !important;
    margin: 0 !important;
    height: auto !important;
    border-radius: 8px !important;
    line-height: 1 !important;
    margin: 0;
    min-height: none !important;
    padding: 10px 20px !important;
}

.mbws-mega-viewall:hover {
    color: #fff !important;
}

/* Mega Menu Content */
.mbws-mega-content {
    display: flex;
}

/* Left Categories */
.mbws-mega-categories {
    width: 300px;
    padding: 12px;
    border-right: 1px solid rgba(226, 232, 240, 0.5);
    background: rgba(248, 250, 252, 0.5);
}

.mbws-category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: rgba(15, 23, 42, 0.8);
}

.mbws-category-item:hover,
.mbws-category-item.active {
    background: linear-gradient(135deg, rgb(209 38 80 / 13%), rgb(209 38 80 / 6%));
    color: var(--mbws-primary);
}

.mbws-category-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(8, 145, 178, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--mbws-primary);

}

.mbws-category-item:hover .mbws-category-icon,
.mbws-category-item.active .mbws-category-icon {
    background: var(--mbws-primary);
}

.mbws-category-item:hover .mbws-category-icon i,
.mbws-category-item.active .mbws-category-icon i {
    color: white;
}

.mbws-category-icon svg {
    width: 16px;
    height: 16px;
    color: var(--mbws-primary);
}

.mbws-category-item:hover .mbws-category-icon svg,
.mbws-category-item.active .mbws-category-icon svg {
    color: white;
}

.mbws-category-name {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
}

.mbws-category-arrow {
    width: 16px;
    height: 16px;
    color: var(--mbws-muted);
    transform: rotate(-90deg);
}

/* Right Sub Items */
.mbws-mega-subitems {
    flex: 1;
    padding: 16px;
}

.mbws-subitems-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--mbws-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
}

.mbws-subitems-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.mbws-subitem-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: rgba(15, 23, 42, 0.8);
    transition: all 0.2s ease;
}

.mbws-subitem-link:hover {
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.05), rgba(20, 184, 166, 0.05));
    color: var(--mbws-primary);
}

.mbws-subitem-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(8, 145, 178, 0.5);
    transition: all 0.2s ease;
}

.mbws-subitem-link:hover .mbws-subitem-dot {
    background: var(--mbws-primary);
    transform: scale(1.5);
}

.mbws-subitem-text {
    font-size: 16px;
}

/* Mega Menu Footer */
.mbws-mega-footer {
    padding: 12px 16px !important;
    background: rgba(248, 250, 252, 0.5);
    border-top: 1px solid rgba(226, 232, 240, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mbws-hotline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--mbws-muted);
}

.mbws-hotline svg {
    width: 16px;
    height: 16px;
    color: var(--mbws-primary);
}

.mbws-hotline strong {
    color: var(--fs-color-primary);
}

/* ===== CTA Buttons ===== */
.mbws-cta-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mbws-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.mbws-btn-ghost {
    background: transparent;
    color: var(--mbws-muted);
}

.mbws-btn-ghost:hover {
    color: var(--mbws-foreground);
}

.mbws-btn-primary {
    background: linear-gradient(135deg, var(--mbws-primary), var(--mbws-ocean), var(--mbws-accent));
    color: white;
    box-shadow: 0 10px 30px -10px rgba(8, 145, 178, 0.4);
}

.mbws-btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 15px 40px -10px rgba(8, 145, 178, 0.5);
}

.mbws-btn-ocean {
    background: #F7971E;
    /* fallback for old browsers */
    background: -webkit-linear-gradient(to right, var(--fs-color-primary), #F7971E);
    /* Chrome 10-25, Safari 5.1-6 */
    background: linear-gradient(to right, var(--fs-color-primary), #F7971E);
    /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */

    color: white !important;
    padding: 6px 12px !important;
    font-size: 12px;
    height: auto !important;
    margin: 0 !important;
    text-transform: unset !important;
    border-radius: 12px !important;
}

/* ===== Mobile Toggle ===== */
.mbws-mobile-toggle {
    display: none;
    padding: 8px;
    border-radius: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.mbws-mobile-toggle:hover {
    background: rgba(248, 250, 252, 0.5);
}

.mbws-mobile-toggle svg {
    width: 24px;
    height: 24px;
}

/* ===== Spacer ===== */
.mbws-nav-spacer {
    height: 96px;
}

.mbws-panel {
    display: none
}

.mbws-panel.is-active {
    display: block
}

/* =========================================
   Flatsome Normal Dropdown (inherit NT vars)
   Target: .sub-menu.nav-dropdown.nav-dropdown-default
   ========================================= */

/* Container dropdown */
.sub-menu.nav-dropdown.nav-dropdown-default {
    min-width: 270px !important;
    padding: 10px !important;

    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;

    border: 1px solid rgba(226, 232, 240, 0.65) !important;
    /* gần --mbws-border */
    border-radius: calc(var(--mbws-radius) - 4px) !important;

    box-shadow: var(--mbws-shadow) !important;
    overflow: hidden !important;
}

/* Fix spacing của Flatsome (đôi khi có style inline/top) */
.sub-menu.nav-dropdown.nav-dropdown-default>li {
    margin: 0 !important;
    padding: 0 !important;
}

/* Link item */
.sub-menu.nav-dropdown.nav-dropdown-default>li>a {
    display: flex !important;
    align-items: center !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    margin: 0;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;

    color: rgba(15, 23, 42, 0.78) !important;
    /* theo nt-foreground */
    text-decoration: none !important;
    border: none;
    background: transparent !important;
    transition: background .18s ease, color .18s ease, transform .18s ease !important;
}

/* Divider tinh tế giữa items */
.sub-menu.nav-dropdown.nav-dropdown-default>li+li>a {
    position: relative !important;
}

.sub-menu.nav-dropdown.nav-dropdown-default>li+li>a::before {
    content: "" !important;
    position: absolute !important;
    left: 12px !important;
    right: 12px !important;
    top: -6px !important;
    height: 1px !important;
    background: rgba(226, 232, 240, 0.6) !important;
    /* gần --mbws-border */
}

/* Hover: dùng gradient nhẹ theo hệ NT */
.sub-menu.nav-dropdown.nav-dropdown-default>li>a:hover {
    color: var(--mbws-primary) !important;
    background: linear-gradient(135deg,
            rgba(8, 145, 178, 0.10),
            rgba(6, 182, 212, 0.10),
            rgba(20, 184, 166, 0.10)) !important;
    transform: translateX(2px) !important;
}

/* Current item */
.sub-menu.nav-dropdown.nav-dropdown-default>li.currembws-menu-item>a,
.sub-menu.nav-dropdown.nav-dropdown-default>li.currembws-menu-ancestor>a {
    background: rgba(8, 145, 178, 0.10) !important;
    color: var(--mbws-primary) !important;
}

/* Nếu dropdown có submenu cấp 2: canh lại cho gọn */
.sub-menu.nav-dropdown.nav-dropdown-default .sub-menu {
    padding: 8px !important;
    margin-top: 6px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(226, 232, 240, 0.6) !important;
    background: rgba(255, 255, 255, .94) !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .10) !important;
}

/* Animation mượt khi Flatsome show dropdown (không phụ thuộc JS) */
.has-dropdown:hover>.nav-dropdown,
.has-dropdown:focus-within>.nav-dropdown {
    animation: mbwsDropdownIn .22s ease both !important;
}

@keyframes mbwsDropdownIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile: dropdown full width hơn, tăng tap area */
@media (max-width: 849px) {
    .sub-menu.nav-dropdown.nav-dropdown-default {
        min-width: 100% !important;
        border-radius: 14px !important;
        padding: 10px !important;
    }

    .sub-menu.nav-dropdown.nav-dropdown-default>li>a {
        padding: 12px 12px !important;
        font-size: 15px !important;
    }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .mbws-menu {
        display: none;
    }

    .mbws-mobile-toggle {
        display: block;
    }

    .mbws-cta-group {
        display: none;
    }
}

@media (max-width: 640px) {
    .mbws-logo-text {
        display: none;
    }
}

.mbws-subitems-title {
    display: none !important;
}

.mbws-ux-menu {
    display: grid;
    grid-template-columns: repeat(2, 50%);
}