/* ============ Tecnisample Mega Menu ============ */

/* ---- Desktop ---- */
.ts-mega { display: block; position: relative; }

.ts-mega__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.ts-mega__item { position: static; }

nav.ts-mega a.ts-mega__link,
nav.ts-mega a.ts-mega__link:link,
nav.ts-mega a.ts-mega__link:visited,
nav.ts-mega .current-menu-item > a.ts-mega__link,
nav.ts-mega .current_page_item > a.ts-mega__link,
nav.ts-mega a.ts-mega__link[aria-current] {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    padding: 18px 20px;
    color: #fff !important;
    text-decoration: none !important;
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    font-size: 15px;
    line-height: 1;
    transition: color .2s ease;
}

nav.ts-mega a.ts-mega__link:hover,
nav.ts-mega a.ts-mega__link:focus-visible,
nav.ts-mega a.ts-mega__link:active,
nav.ts-mega .current-menu-item > a.ts-mega__link:hover,
nav.ts-mega .current_page_item > a.ts-mega__link:hover { color: #3dde95 !important; outline: none; }

.ts-mega__arrow {
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform .2s ease;
}

.ts-mega__item--has-panel:hover .ts-mega__arrow,
.ts-mega__item--has-panel:focus-within .ts-mega__arrow,
.ts-mega__item--open .ts-mega__arrow { transform: rotate(180deg); }

.ts-mega__panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    z-index: 100;
}

.ts-mega__item--has-panel:hover .ts-mega__panel,
.ts-mega__item--has-panel:focus-within .ts-mega__panel,
.ts-mega__item--open .ts-mega__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ---- Mobile ---- */
.ts-mmenu { position: relative; }

.ts-mmenu__toggle {
    background: transparent;
    border: 0;
    width: 44px;
    height: 44px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.ts-mmenu__toggle span {
    display: block;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}

.ts-mmenu__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.ts-mmenu__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ts-mmenu__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

.ts-mmenu__panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(90vw, 420px);
    background: #23326a;
    color: #fff;
    transform: translateX(100%);
    transition: transform .3s ease;
    overflow-y: auto;
    z-index: 9999;
    padding: 72px 0 24px;
}

.ts-mmenu__panel[aria-hidden="false"] { transform: translateX(0); }

.ts-mmenu__list,
.ts-mmenu__sub {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ts-mmenu__item {
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.ts-mmenu__panel a.ts-mmenu__link,
.ts-mmenu__panel a.ts-mmenu__link:link,
.ts-mmenu__panel a.ts-mmenu__link:visited,
.ts-mmenu__panel .current-menu-item > a.ts-mmenu__link,
.ts-mmenu__panel .current_page_item > a.ts-mmenu__link {
    display: block;
    padding: 14px 56px 14px 20px;
    color: #fff !important;
    text-decoration: none !important;
    font-family: "Poppins", sans-serif;
    font-size: 15px;
}

.ts-mmenu__panel a.ts-mmenu__link:hover,
.ts-mmenu__panel a.ts-mmenu__link:focus-visible,
.ts-mmenu__panel a.ts-mmenu__link:active {
    background: rgba(255, 255, 255, .05);
    color: #3dde95 !important;
    outline: none;
}

.ts-mmenu__expand {
    position: absolute;
    top: 0;
    right: 0;
    width: 56px;
    height: 48px;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.ts-mmenu__expand::before,
.ts-mmenu__expand::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: #fff;
    width: 12px;
    height: 2px;
    transform: translate(-50%, -50%);
    transition: transform .25s ease;
}

.ts-mmenu__expand::after { transform: translate(-50%, -50%) rotate(90deg); }
.ts-mmenu__expand[aria-expanded="true"]::after { transform: translate(-50%, -50%) rotate(0); }

.ts-mmenu__sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    background: rgba(0, 0, 0, .15);
}

.ts-mmenu__item--open > .ts-mmenu__sub { max-height: 3000px; }

.ts-mmenu__sub--depth-1 .ts-mmenu__link { padding-left: 36px; }
.ts-mmenu__sub--depth-2 .ts-mmenu__link { padding-left: 52px; }

body.ts-mmenu-open { overflow: hidden; }

/* ---- Breakpoint switch ---- */
@media (max-width: 1024px) { .ts-mega { display: none; } }
@media (min-width: 1025px) { .ts-mmenu { display: none; } }
