/*
 * PTUN Kupang — Cascading Navbar v6
 * Integrasi ke source pra-hardened A+B+D+E+K.
 * Top menu: warna identitas #0E29CD / #176CEA.
 * Submenu hover/active: aksen oranye #F79400.
 * Parent dengan child adalah button, bukan link.
 */

.ptun-cascade-shell {
    position: sticky;
    top: 0;
    z-index: 5000;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #0E29CD;
    box-shadow: 0 7px 22px rgba(14, 41, 205, .18);
}

.ptun-cascade-nav-row {
    min-height: 58px;
    display: flex;
    align-items: stretch;
}

.ptun-desktop-nav-wrap {
    width: 100%;
    min-width: 0;
}

.ptun-cascade-nav {
    min-height: 58px;
    display: flex;
    align-items: stretch;
    gap: 0;
}

.ptun-root-item {
    position: static;
    display: flex;
    align-items: stretch;
}

.ptun-root-link,
.ptun-root-button {
    min-height: 58px;
    margin: 0;
    padding: 0 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #FFFFFF !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: .01em;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    position: relative;
    transition: background-color .16s ease, box-shadow .16s ease;
}

.ptun-root-link::after,
.ptun-root-button::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 3px;
    background: #FFFFFF;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .16s ease;
}

.ptun-root-link:hover,
.ptun-root-link:focus,
.ptun-root-button:hover,
.ptun-root-button:focus,
.ptun-root-button[aria-expanded="true"] {
    background: #176CEA;
    color: #FFFFFF !important;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
}

.ptun-root-link:hover::after,
.ptun-root-link:focus::after,
.ptun-root-button:hover::after,
.ptun-root-button:focus::after,
.ptun-root-button[aria-expanded="true"]::after {
    transform: scaleX(1);
}

.ptun-root-caret {
    font-size: 11px;
    opacity: .9;
    transition: transform .16s ease;
}

.ptun-root-button[aria-expanded="true"] .ptun-root-caret {
    transform: rotate(180deg);
}

/* ===== Mega submenu ===== */

.ptun-mega-backdrop {
    position: fixed;
    inset: 0;
    z-index: 4800;
    background: rgba(9, 18, 40, .22);
}

.ptun-mega-backdrop[hidden] {
    display: none !important;
}

.ptun-mega-panel {
    position: fixed;
    left: 50%;
    top: 0;
    z-index: 5200;
    width: min(1180px, calc(100vw - 48px));
    transform: translate(-50%, -10px);
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    border: 1px solid #E3E8F1;
    border-top: 0;
    border-radius: 0 0 16px 16px;
    background: #FFFFFF;
    box-shadow: 0 24px 58px rgba(21, 33, 58, .18);
    transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}

.ptun-mega-panel.is-open {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}

.ptun-mega-head {
    min-height: 58px;
    padding: 12px 18px;
    border-bottom: 1px solid #E3E8F1;
    background: #EEF3FF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.ptun-mega-heading small {
    display: block;
    color: #176CEA;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.ptun-mega-heading strong {
    display: block;
    margin-top: 3px;
    color: #0E29CD;
    font-size: 17px;
    line-height: 1.2;
}

.ptun-mega-path {
    max-width: 58%;
    overflow: hidden;
    color: #667085;
    font-size: 10px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ptun-mega-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #B9C4DA transparent;
}

.ptun-mega-columns {
    min-width: max-content;
    min-height: 320px;
    max-height: min(64vh, 620px);
    display: flex;
    align-items: stretch;
}

.ptun-menu-column {
    width: 285px;
    flex: 0 0 285px;
    padding: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    border-right: 1px solid #E3E8F1;
    background: #FFFFFF;
    contain: layout paint;
}

.ptun-menu-column:last-child {
    border-right: 0;
}

.ptun-column-title {
    padding: 7px 8px 10px;
    color: #667085;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.ptun-column-item {
    width: 100%;
    min-height: 47px;
    margin: 0 0 2px;
    padding: 8px 9px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #172033 !important;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
    position: relative;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.ptun-column-item:hover,
.ptun-column-item:focus,
.ptun-column-item.is-active {
    background: linear-gradient(90deg, #FFF1DB, #FFF8EE);
    color: #3F2A00 !important;
    outline: none;
}

.ptun-column-item.is-active {
    box-shadow: inset 3px 0 0 #F79400;
}

.ptun-column-index {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #F0F3F8;
    color: #667085;
    font-size: 9px;
    font-weight: 900;
    transition: background .15s ease, color .15s ease;
}

.ptun-column-item:hover .ptun-column-index,
.ptun-column-item:focus .ptun-column-index,
.ptun-column-item.is-active .ptun-column-index {
    background: #F79400;
    color: #2B1A00;
}

.ptun-column-copy {
    min-width: 0;
}

.ptun-column-copy b {
    display: block;
    font-size: 11.5px;
    line-height: 1.32;
}

.ptun-column-arrow {
    color: #176CEA;
    font-size: 16px;
}

.ptun-column-item:hover .ptun-column-arrow,
.ptun-column-item:focus .ptun-column-arrow,
.ptun-column-item.is-active .ptun-column-arrow {
    color: #F79400;
}

.ptun-mega-foot {
    min-height: 42px;
    padding: 9px 16px;
    border-top: 1px solid #E3E8F1;
    background: #FAFBFD;
    color: #667085;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 10px;
}

.ptun-mega-foot strong {
    color: #0E29CD;
}

/* ===== Mobile ===== */

.ptun-mobile-nav-toggle {
    display: none;
    min-width: 108px;
    min-height: 44px;
    margin: 7px 0;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 10px;
    background: #176CEA;
    color: #FFFFFF;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
}

.ptun-mobile-toggle-lines {
    width: 22px;
    height: 16px;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
}

.ptun-mobile-toggle-lines > span {
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: #FFFFFF;
    transition: transform .18s ease, opacity .15s ease;
}

.ptun-mobile-nav-toggle[aria-expanded="true"] .ptun-mobile-toggle-lines > span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.ptun-mobile-nav-toggle[aria-expanded="true"] .ptun-mobile-toggle-lines > span:nth-child(2) {
    opacity: 0;
}
.ptun-mobile-nav-toggle[aria-expanded="true"] .ptun-mobile-toggle-lines > span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.ptun-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 8000;
    background: rgba(9, 18, 40, .56);
}

.ptun-mobile-overlay.is-open {
    display: block;
}

.ptun-mobile-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(430px, 92vw);
    overflow: hidden;
    background: #FFFFFF;
    box-shadow: -20px 0 55px rgba(0, 0, 0, .22);
    display: flex;
    flex-direction: column;
}

.ptun-mobile-drawer-head {
    min-height: 64px;
    padding: 12px 15px;
    background: #0E29CD;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.ptun-mobile-drawer-head strong {
    font-size: 14px;
}

.ptun-mobile-close {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 9px;
    background: rgba(255,255,255,.08);
    color: #FFFFFF;
}

.ptun-mobile-menu {
    padding: 8px 10px 26px;
    overflow-y: auto;
}

.ptun-mobile-row {
    border-bottom: 1px solid #E3E8F1;
}

.ptun-mobile-link,
.ptun-mobile-branch {
    width: 100%;
    min-height: 47px;
    padding: 11px 10px;
    border: 0;
    background: #FFFFFF;
    color: #172033 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
}

.ptun-mobile-row.is-open > .ptun-mobile-branch {
    background: linear-gradient(90deg, #FFF1DB, #FFF8EE);
    color: #3F2A00 !important;
    box-shadow: inset 3px 0 0 #F79400;
}

.ptun-mobile-children {
    display: none;
    margin-left: 12px;
    padding-left: 9px;
    border-left: 3px solid #176CEA;
}

.ptun-mobile-row.is-open > .ptun-mobile-children {
    display: block;
}

.ptun-mobile-level {
    margin-right: 6px;
    padding: 3px 5px;
    border-radius: 99px;
    background: #EEF3FF;
    color: #176CEA;
    font-size: 8px;
    font-weight: 900;
}

.ptun-mobile-plus {
    color: #F79400;
    font-size: 16px;
}

@media (max-width: 1120px) {
    .ptun-root-link,
    .ptun-root-button {
        padding-left: 10px;
        padding-right: 10px;
        font-size: 11px;
    }
}

@media (max-width: 991px) {
    .ptun-desktop-nav-wrap {
        display: none;
    }

    .ptun-mobile-nav-toggle {
        display: inline-flex;
    }

    .ptun-cascade-nav-row {
        min-height: 58px;
        align-items: center;
        justify-content: flex-end;
    }

    .ptun-mega-panel,
    .ptun-mega-backdrop {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .ptun-cascade-nav-row {
        width: min(100% - 24px, 1240px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ptun-root-link,
    .ptun-root-button,
    .ptun-root-caret,
    .ptun-mega-panel,
    .ptun-column-item,
    .ptun-column-index,
    .ptun-mobile-toggle-lines > span {
        transition: none !important;
    }
}
