/* Seven Seas tracking + map */

.apex-shipment {
    background: #fff;
    border: 1px solid #cfe4eb;
    border-radius: 22px;
    overflow: hidden;
    margin-top: 22px;
    box-shadow: 0 16px 40px rgba(6, 56, 71, 0.08);
}

.apex-shipment-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    background: linear-gradient(135deg, #063847, #0a4f61);
    color: #fff;
}

.apex-shipment-head-main {
    min-width: 0;
    flex: 1;
}

.apex-shipment-head h3 {
    color: #fff;
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

.apex-shipment-head-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
    text-align: right;
}

.apex-latest-event {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.apex-status {
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    max-width: 420px;
    white-space: normal;
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.35;
}

.apex-status.is-delivered {
    background: #1ea878;
}

.apex-status.is-transit {
    background: #049bc3;
}

.apex-status.is-booked {
    background: #00cbfd;
}

.apex-shipment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    padding: 20px 20px 8px;
    align-items: stretch;
}

.apex-map-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.apex-map-label {
    font-weight: 700;
    color: #063847;
    margin-bottom: 8px;
}

.apex-map-label i {
    color: #049bc3;
    margin-right: 4px;
}

.apex-map {
    flex: 1;
    min-height: 420px;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #cfe4eb;
    background: #e7f6fa;
}

.apex-map-hint,
.apex-timeline-empty {
    color: #4d6a73;
    font-size: 13px;
    margin: 8px 0 0;
}

.apex-map-wrap.is-empty .apex-map-hint::after {
    content: ' Destination pin appears when consignee location is available.';
}

.apex-shipment-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    padding: 8px 20px 20px;
}

.apex-detail {
    background: #f3fafc;
    border-radius: 12px;
    padding: 10px 12px;
}

.apex-detail span {
    display: block;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #4d6a73;
}

.apex-detail strong,
.apex-detail a {
    color: #063847;
    font-size: 14px;
}

.apex-timeline-panel {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.apex-timeline-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 420px;
    height: 100%;
    max-height: 480px;
    padding: 0;
    background: #f3fafc;
    border: 1px solid #cfe4eb;
    border-radius: 16px;
    overflow: hidden;
}

.apex-timeline-wrap h4 {
    color: #063847;
    font-size: 16px;
    margin: 0;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #cfe4eb;
    background: #fff;
    flex-shrink: 0;
}

.apex-timeline-wrap h4 i {
    color: #049bc3;
    margin-right: 6px;
}

.apex-timeline-wrap .apex-timeline-empty {
    padding: 20px 16px;
    margin: 0;
}

.apex-timeline-vertical {
    list-style: none;
    display: block;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    padding: 8px 12px 16px 16px;
    margin: 0;
    border: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #049bc3 #e7f6fa;
}

.apex-timeline-vertical::-webkit-scrollbar {
    width: 8px;
}

.apex-timeline-vertical::-webkit-scrollbar-thumb {
    background: #049bc3;
    border-radius: 999px;
}

.apex-timeline-vertical::-webkit-scrollbar-track {
    background: #e7f6fa;
    border-radius: 999px;
}

.apex-timeline-vertical li {
    position: relative;
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 14px;
    align-items: start;
    min-height: 0;
    padding: 12px 4px 12px 4px;
    text-align: left;
}

.apex-timeline-vertical li::before {
    content: '';
    position: absolute;
    top: 46px;
    left: 20px;
    bottom: -12px;
    width: 3px;
    background: #cfe4eb;
    z-index: 0;
}

.apex-timeline-vertical li:last-child::before {
    display: none;
}

.apex-timeline-vertical li.is-done::before,
.apex-timeline-vertical li.is-current::before {
    background: #049bc3;
}

.apex-timeline-icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    border-radius: 50%;
    background: #0a4f61;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 0 0 4px #f3fafc;
}

.apex-timeline-vertical li.is-done .apex-timeline-icon {
    background: #049bc3;
}

.apex-timeline-vertical li.is-current .apex-timeline-icon {
    background: #049bc3;
    box-shadow: 0 0 0 4px #f3fafc, 0 0 0 8px rgba(4, 155, 195, 0.22);
}

.apex-timeline-body {
    min-width: 0;
    padding-top: 4px;
}

.apex-timeline h4 {
    font-size: 14px;
    line-height: 1.35;
    margin: 0 0 6px;
    color: #063847;
}

.apex-timeline p {
    margin: 0 0 4px;
    color: #4d6a73;
    font-size: 12px;
    line-height: 1.4;
}

.apex-timeline p i,
.apex-timeline small i {
    color: #049bc3;
    margin-right: 2px;
}

.apex-timeline small {
    display: block;
    color: #7a8a9a;
    font-size: 11px;
    line-height: 1.4;
    margin-top: 2px;
}

.apex-track-loading,
.apex-track-empty {
    text-align: center;
    padding: 28px 16px;
    border-radius: 16px;
    background: #f3fafc;
    color: #123844;
    margin-top: 18px;
}

.apex-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #cfe4eb;
    border-top-color: #049bc3;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    vertical-align: -3px;
    animation: apex-spin 0.8s linear infinite;
}

@keyframes apex-spin {
    to { transform: rotate(360deg); }
}

.leaflet-container {
    font-family: 'Manrope', sans-serif;
}

@media (max-width: 991px) {
    .apex-shipment-grid {
        grid-template-columns: 1fr;
    }

    .apex-map {
        min-height: 300px;
    }

    .apex-timeline-wrap {
        min-height: 320px;
        max-height: 380px;
    }

    .apex-shipment-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .apex-shipment-head-right {
        align-items: flex-start;
        text-align: left;
    }

    .apex-latest-event {
        white-space: normal;
    }
}
