/* ==========================================================================
   MEGA MENU — UX Block Dropdown Styling
   Theme: Flatsome Child Theme
   ========================================================================== */

/* ── Container chung ── */
.mega-menu-row {
    padding: 25px 30px !important;
    background: #fff;
    box-shadow: rgb(0 0 0 / 41%) 1px 1px 10px;
}

.mega-menu-row .col {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ── Phần hình ảnh bên trái (2x2 grid) ── */
.mega-menu-images .mega-menu-images-grid {
    gap: 0;
}

.mega-menu-img-item {
    padding: 8px !important;
    text-align: center;
}

.mega-menu-img-item img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    object-fit: cover;
}

.mega-menu-img-item:hover img {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Caption dưới hình */
.mega-menu-img-caption p {
    font-size: 13px !important;
    color: #333 !important;
    margin: 0 !important;
    font-weight: 400;
    line-height: 1.4;
}

/* ── Phần danh mục link bên phải ── */
.mega-menu-links {
    padding-left: 20px !important;
    border-left: 1px solid #eee;
}

/* Tiêu đề cột */
.mega-menu-heading p {
    font-weight: 700 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: #333 !important;
    margin-bottom: 12px !important;
    padding-bottom: 0 !important;
}

/* Danh sách link */
.mega-menu-link-list p {
    margin: 0 0 8px 0 !important;
    line-height: 1.5 !important;
}

.mega-menu-link-list p a {
    color: #555 !important;
    font-size: 14px !important;
    text-decoration: none !important;
    transition: color 0.2s ease, padding-left 0.2s ease;
    display: inline-block;
}

.mega-menu-link-list p a:hover {
    color: #000 !important;
    padding-left: 3px;
}

/* ── Nút VIEW ALL COLLECTIONS ── */
.mega-menu-view-all-btn,
.mega-menu-view-all-btn a.button {
    border: 1px solid #333 !important;
    background: transparent !important;
    color: #333 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    padding: 12px 20px !important;
    text-align: center !important;
    border-radius: 0 !important;
    transition: all 0.3s ease !important;
    width: 100%;
    display: block;
}

.mega-menu-view-all-btn:hover,
.mega-menu-view-all-btn a.button:hover {
    background: #333 !important;
    color: #fff !important;
}

/* ── Flatsome Dropdown Override ── */
/* Đảm bảo dropdown hiển thị đúng */
.nav-dropdown .ux-block {
    padding: 0 !important;
}

/* Bỏ padding mặc định của Flatsome dropdown */
.nav-dropdown-default .nav-dropdown-inner {
    padding: 0 !important;
}

/* Override row margin trong dropdown */
.nav-dropdown .mega-menu-row>.col {
    margin-bottom: 0 !important;
}

/* Inner row không có gap thừa */
.mega-menu-row .row-inner {
    margin-left: -8px !important;
    margin-right: -8px !important;
}

/* ── Responsive: Co mega menu theo màn hình khi < 1040px ── */
@media (max-width: 1040px) and (min-width: 850px) {

    /* Override inline style="width: 1000px" từ Flatsome */
    #wide-nav .nav-dropdown,
    #wide-nav .has-dropdown>.nav-dropdown,
    #wide-nav .nav-dropdown.nav-dropdown-default,
    .header-bottom .nav-dropdown,
    .header-bottom .has-dropdown>.nav-dropdown[style] {
        width: calc(100vw - 30px) !important;
        max-width: calc(100vw - 30px) !important;
        min-width: 0 !important;
        left: 0 !important;
        right: auto !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .mega-menu-row {
        padding: 18px 12px !important;
        overflow: hidden !important;
    }

    .mega-menu-row .col {
        padding-left: 15px !important;
        padding-right: 6px !important;
    }

    .mega-menu-row .row-inner {
        margin-left: -4px !important;
        margin-right: -4px !important;
    }

    .mega-menu-images .mega-menu-images-grid {
        gap: 0;
    }

    .mega-menu-img-item {
        padding: 3px !important;
    }

    .mega-menu-img-item img {
        border-radius: 3px;
    }

    .mega-menu-links {
        padding-left: 10px !important;
    }

    .mega-menu-link-list p a {
        font-size: 13px !important;
    }

    .mega-menu-heading p {
        font-size: 11px !important;
        letter-spacing: 0.5px !important;
    }

    .mega-menu-view-all-btn,
    .mega-menu-view-all-btn a.button {
        padding: 10px 14px !important;
        font-size: 12px !important;
    }
}

/* ── Responsive cho tablet ── */
@media (max-width: 849px) {
    .mega-menu-images {
        display: none !important;
    }

    .mega-menu-links {
        padding-left: 0 !important;
        border-left: none !important;
    }
}

/* ── MOBILE SIDEBAR — Mega Menu Accordion ── */

/* Make parent li relative */
.mobile-sidebar .nav-sidebar>li.has-mega-submenu {
    position: relative;
}

/* COLLECTION link — arrow matching Flatsome native style */
.mobile-sidebar .nav-sidebar>li.has-mega-submenu>a {
    position: relative;
    padding-right: 40px !important;
    cursor: pointer;
}

.mobile-sidebar .nav-sidebar>li.has-mega-submenu>a::after {
    content: '';
    display: block;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    padding: 4px;
    transform: rotate(45deg);
    position: absolute;
    right: 20px;
    top: 50%;
    margin-top: -5px;
    transition: transform 0.3s ease;
    opacity: 0.4;
}

/* Arrow rotates up when open */
.mobile-sidebar .nav-sidebar>li.has-mega-submenu.is-open>a::after {
    transform: rotate(-135deg);
    margin-top: -2px;
}

/* Accordion panel */
.mobile-mega-submenu {
    display: none;
    background: #fafafa;
    border-top: 1px solid #eee;
    overflow: hidden;
    width: 100%;
}

.mobile-mega-submenu.is-open {
    display: block;
    animation: mobileMenuSlideDown 0.3s ease-out;
}

@keyframes mobileMenuSlideDown {
    from {
        opacity: 0;
        max-height: 0;
    }

    to {
        opacity: 1;
        max-height: 800px;
    }
}

/* Category heading */
.mobile-mega-submenu .mobile-mega-heading {
    display: block;
    padding: 12px 20px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #373636;
}

/* Sub-menu links */
.mobile-mega-submenu .mobile-mega-link {
    display: block;
    padding: 10px 20px 10px 28px;
    color: #444 !important;
    font-size: 14px;
    text-decoration: none !important;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.mobile-mega-submenu .mobile-mega-link:hover,
.mobile-mega-submenu .mobile-mega-link:active {
    color: #E32B2B !important;
    background: #fff;
    padding-left: 32px;
}

.mobile-mega-submenu .mobile-mega-link:last-child {
    border-bottom: none;
}

/* View All button in mobile */
.mobile-mega-submenu .mobile-mega-view-all {
    display: block;
    margin: 10px 16px 14px;
    padding: 12px 16px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #333 !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.mobile-mega-submenu .mobile-mega-view-all:hover {
    background: #333 !important;
    color: #fff !important;
    border-color: #333 !important;
}

/* ── Animation cho dropdown ── */
.nav-dropdown {
    animation: megaMenuFadeIn 0.25s ease-out;
}

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

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