/**
 * Port Sidebar & Menu
 * Liman sayfası sidebar ve menü stilleri (port-sidebar, port-menu).
 * Ekipman accordion ve mobil ekipman çubuğu stilleri bu dosyada.
 * Bu dosya sadece Port sayfasında yüklendiği için Investor sidebar etkilenmez.
 */

/* #sticky-sidebar genişliğini sütuna kilitle – sticky plugin inline width atıyorsa override eder. Sadece Port (bu dosya sadece Port'ta yüklenir). Margin’e dokunmuyoruz; row hizası bozulmasın. */
@media (min-width: 992px) {
    .sticky-parent #sticky-sidebar {
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* Sticky container içinde port sidebar (992px+) – Investor ile aynı genişlik (320px) */
@media (min-width: 992px) {
    .sticky-parent #sticky-sidebar .port-sidebar {
        margin-left: auto;
        margin-right: auto;
        width: 280px;
        max-width: 280px;
        min-width: 280px;
        max-height: calc(100vh - 150px);
        display: flex;
        flex-direction: column;
        transform: scale(0.85);
        transform-origin: top center;
    }

    .sticky-parent #sticky-sidebar .port-sidebar__title {
        flex-shrink: 0;
    }

    .sticky-parent #sticky-sidebar .port-sidebar .port-menu {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: inset 0 -8px 12px -6px rgba(0,0,0,0.06);
    }
}

/* Port sidebar base */
.port-sidebar {
    background-color: #E6EBF2;
    padding: 20px 0;
    border-radius: 4px;
    box-sizing: border-box;
}

.port-sidebar__title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    padding: 0 20px 15px 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #d0d5dc;
}

.port-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.port-menu__category {
    margin: 0;
    padding: 0;
}

.port-menu__category-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    padding: 12px 20px;
    margin: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    user-select: none;
}

    .port-menu__category-title:hover {
        background-color: #d8dde4;
    }

    .port-menu__category-title a {
        color: inherit;
        text-decoration: none;
        display: block;
        width: 100%;
    }

        .port-menu__category-title a:hover {
            color: inherit;
            text-decoration: none;
        }

    .port-menu__category-title::after {
        content: "";
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 5px solid #666;
        transition: transform 0.3s ease;
    }

    .port-menu__category-title.active::after {
        transform: translateY(-50%) rotate(180deg);
    }

.port-menu__category-separator {
    height: 1px;
    background: linear-gradient(to right, #d0d5dc 0%, transparent 100%);
    margin: 0 20px;
    border-radius: 0 1px 1px 0;
}

.port-menu__submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #f5f7fa;
    overflow: hidden;
    transition: max-height 0.8s ease, opacity 0.8s ease;
}

    .port-menu__submenu.collapsed {
        max-height: 0 !important;
        opacity: 0 !important;
        overflow: hidden;
        visibility: hidden;
        display: none;
    }

    .port-menu__submenu.expanded {
        max-height: 1000px;
        opacity: 1;
        display: block;
        visibility: visible;
    }

.port-menu__subitem {
    margin: 0;
    padding: 0;
}

.port-menu__sublink {
    display: block;
    padding: 10px 20px 10px 40px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.2s ease;
    position: relative;
}

    .port-menu__sublink:hover {
        color: #007bff;
        background-color: #e8ecf1;
        text-decoration: none;
    }

    .port-menu__sublink.active,
    .port-menu__sublink.item--active,
    .port-menu__subitem.item--active .port-menu__sublink {
        color: #007bff;
        font-weight: 500;
        background-color: #d8dde4;
    }

        .port-menu__sublink.active::before,
        .port-menu__sublink.item--active::before,
        .port-menu__subitem.item--active .port-menu__sublink::before {
            content: "";
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background-color: #007bff;
        }

.port-menu__category-title.active,
.port-menu__category-title.item--active {
    color: #007bff;
    background-color: #d8dde4;
    position: relative;
}

    .port-menu__category-title.active::before,
    .port-menu__category-title.item--active::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background-color: #007bff;
    }

    .port-menu__category-title.active a,
    .port-menu__category-title.item--active a {
        color: #007bff;
    }

/* Responsive: mobil */
@media (max-width: 991px) {
    .port-sidebar {
        margin-bottom: 20px;
    }

    .port-menu__category-title {
        border-bottom: 1px solid #d0d5dc;
    }

    .port-menu__submenu {
        max-height: 0 !important;
        opacity: 0 !important;
        overflow: hidden;
        display: block;
    }

        .port-menu__submenu.expanded:not(.equipment-submenu) {
            max-height: 1000px !important;
            opacity: 1 !important;
        }

    .equipment-submenu,
    .equipment-submenu.expanded {
        max-height: 0 !important;
        opacity: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
    }

    .port-menu__submenu.collapsed {
        max-height: 0 !important;
        opacity: 0 !important;
    }

    .port-menu__category-title::after {
        display: block;
    }
}

/* Ekipmanlar başlığı: seçili ekipman etiketi */
.equipment-dropdown-toggle__label {
    display: block;
}

.equipment-dropdown-toggle__current {
    display: none;
    font-size: 12px;
    font-weight: 500;
    color: #007bff;
    margin-top: 2px;
}

    .equipment-dropdown-toggle__current.has-current {
        display: block;
    }

/* Desktop: ekipman accordion ok ve aç/kapa */
@media (min-width: 992px) {
    .equipment-dropdown-toggle::after {
        display: block !important;
    }

    .equipment-submenu {
        max-height: 0 !important;
        opacity: 0 !important;
        overflow: hidden;
    }

        .equipment-submenu.expanded {
            max-height: 1000px !important;
            opacity: 1 !important;
        }

        .equipment-submenu.collapsed {
            max-height: 0 !important;
            opacity: 0 !important;
        }

    .port-menu__submenu:not(.equipment-submenu).collapsed {
        max-height: 0 !important;
        opacity: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
        display: none !important;
    }

    .port-menu__submenu:not(.equipment-submenu).expanded {
        max-height: 1000px !important;
        opacity: 1 !important;
        display: block !important;
        visibility: visible !important;
    }

    .port-menu__category-title:not(.equipment-dropdown-toggle)::after {
        display: none;
    }

    .port-menu__category-title:hover {
        background-color: #d8dde4;
    }
}

/* Port: mobil ekipman alt çubuğu (991px altında, ekipman rotasındayken) */
.port-equipment-mobile-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1020;
    background: #fff;
    border-top: 1px solid #d0d5dc;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    padding: 10px 0;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
}

@media (max-width: 991px) {
    .port-equipment-mobile-bar.is-visible {
        display: block;
    }

    body.port-equipment-bar-visible .section-page {
        padding-bottom: 72px;
    }
}

.port-equipment-mobile-bar__scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 0 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

    .port-equipment-mobile-bar__scroll::-webkit-scrollbar {
        display: none;
    }

.port-equipment-mobile-bar__item {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: 20px;
    background: #E6EBF2;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

    .port-equipment-mobile-bar__item:hover,
    .port-equipment-mobile-bar__item:active {
        background: #d8dde4;
        color: #333;
        text-decoration: none;
    }

    .port-equipment-mobile-bar__item.is-active {
        background: #007bff;
        color: #fff;
    }
