/* =========================================================
   06-category-menu.css
   Mašin Elektro - Left Category Mega Menu
========================================================= */

.me-home-categories {
    width: 320px;
    background: #ffffff;
    border: 1px solid #dfe7f0;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 36, 64, 0.15);
    overflow: visible;
    position: relative;
    z-index: 999;
}

.me-category-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 0 18px;
    background: linear-gradient(135deg, #0b63b6, #084f94);
    color: #ffffff;
    border-radius: 14px 14px 0 0;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
}

.me-category-head i {
    color: #ffffff;
}

.me-category-menu,
.me-category-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.me-category-menu {
    position: relative;
    background: #ffffff;
    border-radius: 0 0 14px 14px;
}

.me-category-menu > li {
    position: static;
    border-bottom: 1px solid #e4ebf3;
}

.me-category-menu > li:last-child {
    border-bottom: none;
}

.me-category-menu a {
    text-decoration: none !important;
}

.me-category-menu > li > a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 42px 0 18px;
    background: #ffffff;
    color: #1c2a3a !important;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.25;
    text-transform: uppercase;
    transition: 0.2s ease;
}

.me-category-menu > li.menu-item-has-children > a::after {
    content: "›";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #7d91a8;
    font-size: 24px;
    font-weight: 800;
}

.me-category-menu > li:hover > a,
.me-category-menu > li.current-menu-item > a,
.me-category-menu > li.current-menu-ancestor > a {
    background: #f2f7fc;
    color: #0b63b6 !important;
}

/* Mega submenu */

.me-category-menu > li > .sub-menu {
    position: absolute;
    top: 0;
    left: 100%;

    width: min(960px, calc(100vw - 380px));
    min-height: 100%;
    padding: 28px;

    background: #ffffff;
    border: 1px solid #dfe7f0;
    border-left: 4px solid #0b63b6;
    border-radius: 0 18px 18px 0;
    box-shadow: 24px 28px 60px rgba(15, 36, 64, 0.18);

    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-content: start;
    gap: 20px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(8px);
    transition: 0.18s ease;
    z-index: 9999;
}

.me-category-menu > li:hover > .sub-menu,
.me-category-menu > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

/* Bigger submenu cards */

.me-category-menu .sub-menu > li {
    min-width: 0;
}

.me-category-menu .sub-menu > li > a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 170px;
    padding: 26px 18px;

    background: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
    border: 1px solid #dfe7f0;
    border-radius: 18px;

    color: #1c2a3a !important;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.35;
    text-align: center;
    text-transform: none;

    box-shadow: 0 8px 22px rgba(15, 36, 64, 0.05);
    transition: 0.25s ease;
}

.me-category-menu .sub-menu > li > a::before {
    content: "";
    width: 10px;
    height: 10px;
    margin-bottom: 18px;
    background: #d12427;
    border-radius: 50%;
}

.me-category-menu .sub-menu > li > a:hover {
    transform: translateY(-6px);
    background: #eef6ff;
    border-color: #cfe2f7;
    color: #0b63b6 !important;
    box-shadow: 0 18px 38px rgba(11, 99, 182, 0.16);
}

/* Mobile */

@media (max-width: 768px) {
    .me-home-categories {
        width: 100%;
        border-radius: 12px;
    }

    .me-category-menu > li {
        position: relative;
    }

    .me-category-menu > li > .sub-menu {
        position: static;
        width: auto;
        min-height: 0;
        padding: 12px;
        border: 0;
        border-top: 1px solid #e4ebf3;
        border-radius: 0;
        box-shadow: none;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }

    .me-category-menu .sub-menu > li > a {
        min-height: 70px;
        padding: 16px;
        align-items: flex-start;
        text-align: left;
    }

    .me-category-menu .sub-menu > li > a::before {
        margin-bottom: 10px;
    }
}