/* ===== Header / Navigation ===== */

.section-header-menu {
    width: 100%;
    height: 81px;
}

.header-navbar {
    z-index: 99999;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 0 2.5%;
}

.header-navbar .navbar-brand {
    max-width: 170px !important;
    max-height: 80px !important;
    margin: 0;
    padding: 9px !important;
}

.header-logo {
    max-width: 170px !important;
    max-height: 80px !important;
    padding: 9px !important;
}

/* Nav items */
.nav-hover-frame {
    display: inline-block;
    position: static;
}

/* Hide Bootstrap's default dropdown caret */
.no-arrow::after {
    display: none !important;
}

.nav-hover-btn {
    font-size: 16px !important;
    height: 39px;
    display: flex;
    align-items: center;
}

.nav-item-text {
    color: #353535;
    font-size: 16px;
    white-space: nowrap;
    cursor: pointer;
}

.nav-item-text:hover {
    color: var(--ct-red) !important;
}

.nav-item-text:focus {
    outline: 0 !important;
}

/* Hover dropdown - desktop only */
@media (min-width: 992px) {
    .nav-hover-frame:hover .nav-hover-content {
        display: block !important;
    }

    .nav-hover-frame:hover a.nav-link.dropdown-toggle {
        color: var(--ct-red) !important;
    }
}

.nav-hover-content {
    min-width: 160px;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
    z-index: 1;
    top: 79px;
    margin-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 10px;
    padding: 35px 5% 35px 10%;
    background: #fff;
    border: none;
}

/* Contact dropdown now uses mega-menu-panel pattern — no separate styles needed */

/* ===== Mega Menu (all dropdowns) ===== */

.mega-menu-panel {
    position: fixed !important;
    top: 80px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    padding: 40px 8% !important;
    border-radius: 0 0 10px 10px !important;
}

.mega-menu-container {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    gap: 40px;
}

.mega-menu-columns {
    display: flex;
    flex: 1;
    gap: 40px;
}

.mega-menu-col {
    flex: 1;
}

.mega-menu-heading {
    font-size: 15px;
    font-weight: 700;
    color: #353535;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ct-red);
}

.mega-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-list li {
    margin-bottom: 10px;
}

.mega-menu-list li a {
    font-size: 14px;
    color: #6D7278;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    padding: 2px 0;
}

.mega-menu-list li a:hover {
    color: var(--ct-red);
}

.mega-menu-image {
    flex: 0 0 280px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.mega-menu-image img {
    max-width: 100%;
    max-height: 240px;
    width: 100%;
    object-fit: contain;
    border-radius: 10px;
}

/* Desktop: fade transition + always show panel/lists, hide chevron */
@media (min-width: 992px) {
    .mega-menu-panel {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        pointer-events: none;
        display: block !important;
    }

    .nav-hover-frame:hover .mega-menu-panel {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .mega-menu-list {
        display: block !important;
    }

    .mega-chevron {
        display: none !important;
    }

    .mega-menu-arrow {
        display: none !important;
    }

    /* Contact dropdown uses same mega-menu-panel fade transition */
}

/* Header buttons (Log in / Create account) */
.header-btn {
    text-decoration: inherit;
    color: #fff;
    display: inline-block;
    background-color: var(--ct-red);
    line-height: 1.4em;
    padding: 10px;
    border: 0 none;
    cursor: pointer;
    text-align: center;
    border-radius: 40px;
    transition: all 0.2s linear;
    font-weight: 700 !important;
    font-size: 14px;
}

.header-btn:focus {
    outline: 0;
}

.header-btn:hover {
    text-decoration: none;
    background-color: var(--ct-red);
}

.header-btn.nav-hover-btn {
    font-size: 16px !important;
    height: 39px;
}

.web--header--buttons {
    display: flex !important;
    align-items: center !important;
    gap: 10px;
}

.login-button-head {
    text-transform: none !important;
    width: max-content !important;
}

.signup-button-head {
    text-transform: none !important;
    width: max-content !important;
}

/* Layout - Desktop only */
@media (min-width: 992px) {
    .header-navbar .collapse.navbar-collapse ul:nth-child(2) {
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    .header-navbar .collapse.navbar-collapse ul.navbar-nav-guest:nth-child(1) {
        margin-left: 15px !important;
    }

    .navbar-nav-guest:nth-child(1) {
        margin-left: 15px !important;
    }

    /* Bold nav items (Ship & Track, Logistics Solutions, Contact) */
    .navbar-nav-guest {
        display: flex;
        align-items: center;
        height: 80px;
    }

    .navbar-nav-guest .nav-item-text {
        font-weight: 700 !important;
    }

    /* Non-bold nav items (Careers, Corporate, etc.) */
    .ct-main-ul-head .nav-item-text {
        font-weight: 400 !important;
    }

    .dropdown-menu-web ul.navbar-nav li.nav-item {
        height: 80px !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .dropdown-menu-web ul.navbar-nav li.nav-item.web--header--buttons {
        position: relative;
        top: 0;
        gap: 10px;
    }
}

/* Country/Language selectors */
.ddlCountry-web,
.ddlLanguage-web {
    padding: 0 10px;
}

.country-select-wrapper,
.language-select-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #353535;
    font-size: 14px;
}

.country-select-wrapper:hover,
.language-select-wrapper:hover {
    color: var(--ct-red);
}

.country-location-icon {
    width: 13px;
    height: 19px;
    fill: currentColor;
}

/* Mobile menu trigger */
.menu-trigger {
    display: none;
}

/* Responsive */
@media (max-width: 1199px) {
    .section-header-menu {
        height: 70px;
    }

    .header-navbar {
        padding: 0 20px;
    }

    .mega-menu-panel {
        top: 70px !important;
    }

    .header-logo {
        max-width: 150px !important;
        max-height: 90px !important;
        padding: 9px 0 !important;
    }
}

@media (max-width: 991px) {
    .section-header-menu {
        height: 60px;
    }

    .header-navbar {
        padding: 0 15px;
        background: var(--ct-red);
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .header-navbar .navbar-brand {
        flex: 0 0 auto;
    }

    .header-logo {
        max-width: 100px !important;
        max-height: 90px !important;
        padding: 7px 0 !important;
        filter: brightness(0) invert(1);
    }

    .menu-trigger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        cursor: pointer;
        font-size: 24px;
        color: #fff;
        margin-left: auto;
        flex: 0 0 auto;
        order: 2;
        transition: opacity 0.2s ease;
    }

    .menu-trigger:hover {
        opacity: 0.8;
    }

    .dropdown-menu-web {
        display: none !important;
    }

    .dropdown-menu-web.mobile-open {
        display: block !important;
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background: #fff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        padding: 0;
        z-index: 99998;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        animation: slideDown 0.25s ease;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .dropdown-menu-web.mobile-open ul.navbar-nav {
        flex-direction: column;
        width: 100%;
        margin: 0 !important;
        padding: 0;
        list-style: none;
    }

    .dropdown-menu-web.mobile-open ul.navbar-nav li.nav-item {
        height: auto !important;
        line-height: normal !important;
        padding: 0;
        border-bottom: 1px solid #e0e6ed;
        display: block !important;
        width: 100%;
    }

    .dropdown-menu-web.mobile-open li.nav-item .nav-link {
        color: #353535 !important;
        font-size: 15px;
        padding: 16px 20px !important;
        text-align: left;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .dropdown-menu-web.mobile-open li.nav-item .nav-item-text {
        color: #353535 !important;
        font-weight: 700 !important;
    }

    .dropdown-menu-web.mobile-open li.nav-item .dropdown-toggle::after {
        display: none !important;
    }

    .mega-menu-arrow {
        display: inline-block !important;
        font-size: 12px;
        margin-left: 8px;
        transition: transform 0.25s ease;
        color: var(--ct-red);
    }

    .mega-menu-item.mega-open .mega-menu-arrow {
        transform: rotate(180deg);
    }

    .dropdown-menu-web.mobile-open .nav-hover-content {
        display: none !important;
        position: static !important;
        box-shadow: none !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        width: 100% !important;
    }

    .dropdown-menu-web.mobile-open .nav-hover-frame {
        display: block !important;
        position: static !important;
    }

    .dropdown-menu-web.mobile-open .nav-hover-btn {
        height: auto !important;
        display: flex !important;
        font-size: 15px !important;
    }

    .dropdown-menu-web.mobile-open li.nav-item.web--header--buttons {
        display: flex;
        gap: 12px;
        padding: 16px 20px;
        border-bottom: 1px solid #e0e6ed;
    }

    .dropdown-menu-web.mobile-open .header-btn {
        font-size: 14px !important;
        padding: 10px 20px !important;
        flex: 1;
        text-align: center;
    }

    .dropdown-menu-web.mobile-open .login-button-head {
        margin-left: 0 !important;
        background: transparent;
        color: var(--ct-red);
        border: 1px solid var(--ct-red);
    }

    .dropdown-menu-web.mobile-open .login-button-head:hover {
        background: var(--ct-red);
        color: #fff;
    }

    .dropdown-menu-web.mobile-open .ddlLanguage-web,
    .dropdown-menu-web.mobile-open .ddlCountry-web {
        padding: 14px 20px !important;
        border-bottom: 1px solid #e0e6ed;
        display: flex !important;
        align-items: center;
    }

    .dropdown-menu-web.mobile-open .country-select-wrapper,
    .dropdown-menu-web.mobile-open .language-select-wrapper {
        color: #353535;
        font-size: 14px;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .dropdown-menu-web.mobile-open .country-location-icon {
        width: 14px;
        height: 16px;
        flex-shrink: 0;
    }

    .mega-menu-panel {
        display: none !important;
        position: static !important;
        box-shadow: none !important;
        padding: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
        border-radius: 0 !important;
        margin: 0 !important;
        left: auto !important;
        top: auto !important;
        border: none !important;
        background: #f8f9fa !important;
    }

    .mega-menu-item.mega-open .mega-menu-panel {
        display: block !important;
        animation: expandFade 0.25s ease;
    }

    @keyframes expandFade {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    .mega-menu-container {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .mega-menu-columns {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .mega-menu-image {
        display: none !important;
    }

    .mega-menu-col {
        border-bottom: 1px solid #e0e6ed;
        width: 100%;
    }

    .mega-menu-col:last-child {
        border-bottom: none;
    }

    .mega-menu-heading {
        font-size: 14px;
        font-weight: 700;
        color: var(--ct-red) !important;
        margin: 0 !important;
        padding: 12px 20px !important;
        border-bottom: none !important;
        cursor: pointer;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        width: 100%;
        background: #f0f4f8;
        transition: background 0.2s ease;
    }

    .mega-menu-heading:active {
        background: #e3eaf3;
    }

    .mega-chevron {
        display: inline-block !important;
        font-size: 12px;
        transition: transform 0.25s ease;
    }

    .mega-menu-heading.col-open .mega-chevron {
        transform: rotate(180deg);
    }

    .mega-menu-list {
        display: none !important;
        padding: 4px 0 8px 0 !important;
        margin: 0 !important;
        list-style: none !important;
        text-align: left;
        background: #fff;
    }

    .mega-menu-list.show {
        display: block !important;
        animation: expandFade 0.2s ease;
    }

    .mega-menu-list li {
        margin-bottom: 0 !important;
        display: block !important;
        width: 100%;
    }

    .mega-menu-list li a {
        font-size: 13px !important;
        padding: 10px 20px 10px 36px !important;
        text-align: left !important;
        display: block !important;
        color: #555 !important;
        transition: color 0.2s ease, background 0.2s ease;
    }

    .mega-menu-list li a:hover,
    .mega-menu-list li a:active {
        color: var(--ct-red) !important;
        background: #f0f4f8;
    }
}
