.ht-timeline-wrapper {
    position: relative;
    width: 100%;
    overflow: visible !important;
    /* Force visible for sticky */
}

.ht-timeline-container {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 300px;
    will-change: transform;
    /* transition removed for 1:1 response */
    transition: none !important;
}

.ht-timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #e5e7eb;
    transform: translateY(-50%);
    z-index: 1;
}

.ht-timeline-line-active {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background-color: #3b82f6;
    transition: width 0.1s linear;
    /* Faster sync */
}

.ht-timeline-items {
    display: flex;
    position: relative;
    z-index: 2;
}

.ht-timeline-item {
    flex: 0 0 auto;
    width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 20px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-radius: 12px;
}

.ht-timeline-dot-wrapper {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
}

.ht-timeline-dot {
    width: 38px;
    height: 38px;
    background-color: #fff;
    border: 4px solid #fff;
    /* Solid white border like image */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 0 2px #e5e7eb;
    /* Outer thin border */
}

.ht-timeline-dot i,
.ht-timeline-dot svg {
    color: #3b82f6;
    fill: #3b82f6;
    display: block;
    font-size: 14px;
    transition: all 0.4s ease;
    /* Added transition */
}

/* Active Dot Styling */
.ht-timeline-item.ht-active .ht-timeline-dot {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Sticky Scroll Implementation Classes */
.ht-timeline-wrapper.ht-sticky-active {
    padding: 0;
    margin: 50px 0;
}

.ht-timeline-sticky-inner {
    position: sticky;
    top: var(--ht-sticky-top, 0);
    width: 100%;
    height: calc(100vh - var(--ht-sticky-top, 0px));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 1000;
}

/* Helper to unlock sticky-breaking parents */
.ht-sticky-parent-fix,
.elementor-section.ht-sticky-parent-fix,
.elementor-container.ht-sticky-parent-fix,
.elementor-column.ht-sticky-parent-fix,
.elementor-widget-wrap.ht-sticky-parent-fix {
    overflow: visible !important;
}

.ht-timeline-content-top,
.ht-timeline-content-bottom {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 200px;
    width: 100%;
    position: relative;
}

.ht-timeline-box {
    background-color: #f3f4f6;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    position: relative;
    width: 100%;
    max-width: 280px;
    margin: 10px 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 5;
}

/* Pointer Arrow */
.ht-timeline-box::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.4s ease;
}

.ht-timeline-content-top .ht-timeline-box::after {
    bottom: -15px;
    border-width: 15px 15px 0 15px;
    border-color: var(--pointer-color, #f3f4f6) transparent transparent transparent;
}

.ht-timeline-content-bottom .ht-timeline-box::after {
    top: -15px;
    border-width: 0 15px 15px 15px;
    border-color: transparent transparent var(--pointer-color, #f3f4f6) transparent;
}

.ht-timeline-year {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1f2937;
    margin-bottom: 8px;
    /* Margin bottom instead of vertical */
    white-space: nowrap;
    display: block;
}

.ht-timeline-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    line-height: 1.3;
}

.ht-timeline-description {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Vertical line connecting dot to box */
.ht-timeline-content-top::after,
.ht-timeline-content-bottom::before {
    content: '';
    width: 2px;
    height: 40px;
    background-color: #e5e7eb;
    opacity: 0.5;
}

/* Hide line as we use pointers now, or reduce it */
.ht-timeline-content-top::after {
    margin-top: 15px;
    visibility: hidden;
}

.ht-timeline-content-bottom::before {
    margin-bottom: 15px;
    visibility: hidden;
}

/* Active States Override */

/* Snake / Road Layout Styling */
:root {
    --ht-road-thickness: 40px;
}

.ht-layout-snake {
    padding: 100px 40px;
    margin: 0 auto;
    overflow: visible !important;
}

.ht-timeline-snake-container {
    display: flex;
    flex-direction: column;
    gap: 180px;
    /* Controlled by Elementor snake_row_gap */
}

.ht-timeline-snake-row {
    display: flex;
    position: relative;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

.ht-row-reverse {
    flex-direction: row-reverse;
}

.ht-timeline-snake-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    padding: 0 10px;
}

/* Road Styles */
.ht-timeline-snake-road-wrapper {
    position: relative;
    width: 100%;
    height: var(--ht-road-thickness, 40px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ht-timeline-snake-road {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e5e7eb;
    /* Inactive road color */
    z-index: 1;
    overflow: hidden;
}

/* Ensure road extends to touch curves at row ends */
.ht-timeline-snake-item:first-child .ht-timeline-snake-road {
    left: -2px;
    width: calc(100% + 2px);
}

.ht-timeline-snake-item:last-child .ht-timeline-snake-road {
    width: calc(100% + 2px);
}

.ht-road-active {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    /* Controlled by JS */
    background-color: #3b82f6;
    /* Default active color */
    transition: width 0.1s linear;
}

.ht-row-reverse .ht-road-active {
    left: auto;
    right: 0;
}

/* Dashed Center Line */
.ht-timeline-snake-road::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -2px;
    width: calc(100% + 4px);
    height: 0;
    border-top: 3px dashed #ffffff;
    transform: translateY(-50%);
    z-index: 3;
    opacity: 0.8;
}

/* Curve Connectors (Bridge Logic) */
.ht-timeline-snake-curve {
    position: absolute;
    box-sizing: border-box;
    width: var(--ht-curve-width, 120px);
    height: var(--ht-curve-height, 300px);
    z-index: 1;
    pointer-events: none;
    top: calc(100% - var(--ht-road-thickness, 40px));
    /* Container only, no border here */
}

/* Inactive (Base) Curve */
.ht-timeline-snake-curve::before {
    content: '';
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    border: var(--ht-road-thickness, 40px) solid #e5e7eb;
    border-radius: inherit;
    z-index: 1;
}

/* Active (Filling) Curve */
.ht-curve-active {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    border: var(--ht-road-thickness, 40px) solid transparent;
    border-radius: inherit;
    z-index: 5;
    transition: none;
    clip-path: inset(0 0 100% 0);
    /* Hidden by default */
}

/* Active Curve Styling */
.ht-curve-active.ht-filled {
    border-color: #3b82f6;
    /* Default active color */
}

.ht-curve-active.ht-filled::after {
    border-color: #ffffff !important;
    /* Default active dashed color */
}

.ht-road-active.ht-filled::after,
.ht-passed .ht-road-active::after,
.ht-active .ht-road-active::after {
    border-color: #ffffff !important;
}

.ht-timeline-snake-curve::after {
    content: '';
    position: absolute;
    /* Center a 3px dashed line in the middle of the road-thickness border */
    inset: calc(var(--ht-road-thickness, 40px) / 2 - 1.5px);
    border: 3px dashed #ffffff;
    border-radius: inherit;
    z-index: 10;
    opacity: 0.8;
}

.ht-timeline-snake-curve.ht-filled::after {
    border-color: #ffffff !important;
    /* Will be controlled by active_road_dashed_color */
}

/* Normal row (L-to-R) ends on right, curves to R-to-L row */
.ht-row-normal .ht-timeline-snake-curve {
    right: calc(-1 * var(--ht-curve-width, 120px));
    border-radius: 0 1000px 1000px 0;
}

/* Apply border masks to BOTH siblings */
.ht-row-normal .ht-timeline-snake-curve::before,
.ht-row-normal .ht-curve-active {
    border-left: 0;
}

.ht-row-normal .ht-timeline-snake-curve::after {
    border-left: 0;
}

/* Reverse row (R-to-L) ends on left, curves to L-to-R row */
.ht-row-reverse .ht-timeline-snake-curve {
    left: calc(-1 * var(--ht-curve-width, 120px));
    border-radius: 1000px 0 0 1000px;
}

.ht-row-reverse .ht-timeline-snake-curve::before,
.ht-row-reverse .ht-curve-active {
    border-right: 0;
}

.ht-row-reverse .ht-timeline-snake-curve::after {
    border-right: 0;
}

/* Content Positioning */
.ht-timeline-snake-content-top {
    min-height: 120px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 25px;
    text-align: center;
}

.ht-timeline-snake-year {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1f2937;
    margin-bottom: 5px;
}

.ht-timeline-snake-text {
    max-width: 180px;
}

.ht-timeline-snake-title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
    margin-bottom: 4px;
    color: #111;
}

.ht-timeline-snake-desc {
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.4;
}

/* Dot on Road */
.ht-timeline-snake-dot {
    background-color: #fff;
    border: 4px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    box-shadow: 0 0 0 3px #1f2937;
    /* Dark outer ring like some parts of the image */
}

/* If item_icon is specified as black in image */
.ht-timeline-snake-dot i,
.ht-timeline-snake-dot svg {
    color: #1f2937;
    fill: #1f2937;
}

/* Responsive adjustments */
@media (max-width: 1024px) {

    /* Horizontal Layout -> Vertical */
    .ht-layout-horizontal .ht-timeline-container {
        flex-direction: column;
        min-height: auto;
        padding: 50px 0;
    }

    .ht-layout-horizontal .ht-timeline-line {
        width: var(--ht-road-thickness, 40px);
        height: 100%;
        left: 50%;
        top: 0;
        transform: translateX(-50%);
        background-color: #e5e7eb;
        border-radius: 20px;
        overflow: hidden;
    }

    .ht-layout-horizontal .ht-timeline-line-active {
        width: 100%;
        height: 0;
        left: 0;
        top: 0;
        transition: height 0.1s linear;
        z-index: 2;
    }

    .ht-layout-horizontal .ht-timeline-items {
        flex-direction: column;
        width: 100%;
    }

    .ht-layout-horizontal .ht-timeline-item {
        width: 100%;
        display: flex !important;
        flex-direction: row;
        align-items: center;
        padding: 40px 0;
        box-sizing: border-box;
    }

    .ht-layout-horizontal .ht-timeline-item .ht-timeline-content-top,
    .ht-layout-horizontal .ht-timeline-item .ht-timeline-content-bottom {
        flex: 1;
        width: auto !important;
        min-height: auto;
        padding: 0 40px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .ht-layout-horizontal .ht-timeline-item .ht-timeline-content-top {
        text-align: right;
        align-items: flex-end;
    }

    .ht-layout-horizontal .ht-timeline-item .ht-timeline-content-bottom {
        text-align: left;
        align-items: flex-start;
    }

    .ht-layout-horizontal .ht-timeline-dot-wrapper {
        flex: 0 0 100px;
        width: 100px;
        margin: 0;
        z-index: 5;
    }

    /* Roadmap dashed line for mobile */
    .ht-layout-horizontal .ht-timeline-line::after,
    .ht-snake-v-line-base::after,
    .ht-snake-v-line-active::after {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        width: 0;
        height: 100%;
        border-left: 3px dashed #ffffff;
        transform: translateX(-50%);
        z-index: 3;
        opacity: 0.8;
    }

    /* Adjust Box and Arrows for Vertical */
    .ht-layout-horizontal .ht-timeline-box {
        margin: 0;
        max-width: 100%;
        width: 100%;
    }

    .ht-layout-horizontal .ht-timeline-content-top .ht-timeline-box::after {
        bottom: auto;
        top: 50%;
        right: -15px;
        left: auto;
        transform: translateY(-50%);
        border-width: 12px 0 12px 12px;
        border-color: transparent transparent transparent var(--pointer-color, #f3f4f6);
    }

    .ht-layout-horizontal .ht-timeline-content-bottom .ht-timeline-box::after {
        top: 50%;
        left: -15px;
        right: auto;
        transform: translateY(-50%);
        border-width: 12px 12px 12px 0;
        border-color: transparent var(--pointer-color, #f3f4f6) transparent transparent;
    }

    /* Hide pointers on spacers */
    .ht-layout-horizontal .ht-timeline-content-top:empty,
    .ht-layout-horizontal .ht-timeline-content-bottom:empty {
        display: none !important;
        /* Not really empty due to whitespace, but handled by flex */
    }

    /* Snake Layout -> Vertical */
    .ht-layout-snake {
        padding: 50px 0;
    }

    .ht-timeline-snake-container {
        gap: 0;
        position: relative;
    }

    /* New Vertical line for snake mobile */
    .ht-timeline-snake-vertical-line {
        position: absolute;
        top: 0;
        left: 50%;
        width: var(--ht-road-thickness, 40px);
        height: 100%;
        transform: translateX(-50%);
        z-index: 1;
        display: block;
    }

    .ht-snake-v-line-base {
        width: 100%;
        height: 100%;
        background-color: #e5e7eb;
        position: absolute;
        top: 0;
        left: 0;
        border-radius: 20px;
    }

    .ht-snake-v-line-active {
        width: 100%;
        height: 0;
        background-color: #3b82f6;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 2;
        border-radius: 20px;
        transition: height 0.1s linear;
    }

    /* Hide old before line */
    .ht-timeline-snake-container::before {
        display: none;
    }

    .ht-timeline-snake-row {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .ht-timeline-snake-item {
        display: flex !important;
        flex-direction: row;
        width: 100%;
        padding: 60px 0;
        box-sizing: border-box;
        align-items: center;
        position: relative;
    }

    /* Alternate snake items */
    .ht-timeline-snake-item:nth-child(even) {
        flex-direction: row-reverse;
    }

    .ht-timeline-snake-content-top {
        flex: 1;
        width: auto !important;
        min-height: auto;
        padding: 0 40px;
        justify-content: center;
        text-align: right;
    }

    .ht-timeline-snake-item:nth-child(even) .ht-timeline-snake-content-top {
        text-align: left;
    }

    .ht-timeline-snake-road-wrapper {
        flex: 0 0 100px;
        width: 100px;
        height: 100px;
        margin: 0;
        z-index: 2;
    }

    /* Spacer for alignment on snake */
    .ht-timeline-snake-item::after {
        content: '';
        flex: 1;
        pointer-events: none;
    }

    .ht-timeline-snake-road {
        display: none;
    }

    .ht-timeline-snake-curve {
        display: none;
    }

    .ht-timeline-snake-dot {
        margin: 0 auto;
        width: 50px;
        height: 50px;
        border: 4px solid #fff;
    }

    .ht-active .ht-timeline-snake-dot {
        /* Color controlled by Elementor selector in PHP */
    }

    /* Box pointers for Snake Mobile */
    .ht-timeline-snake-item .ht-timeline-snake-text {
        position: relative;
        background-color: #f3f4f6;
        /* Default box color */
        padding: 15px;
        border-radius: 12px;
        width: 100%;
        max-width: 250px;
        margin-left: auto;
    }

    .ht-timeline-snake-item:nth-child(even) .ht-timeline-snake-text {
        margin-left: 0;
        margin-right: auto;
    }

    .ht-timeline-snake-text::after {
        content: '';
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-style: solid;
        transition: all 0.4s ease;
    }

    .ht-timeline-snake-item:nth-child(odd) .ht-timeline-snake-text::after {
        right: -12px;
        border-width: 12px 0 12px 12px;
        border-color: transparent transparent transparent #f3f4f6;
    }

    .ht-timeline-snake-item:nth-child(even) .ht-timeline-snake-text::after {
        left: -12px;
        border-width: 12px 12px 12px 0;
        border-color: transparent #f3f4f6 transparent transparent;
    }
}

/* Hide vertical roadmap line on desktop */
@media (min-width: 1025px) {
    .ht-timeline-snake-vertical-line {
        display: none;
    }
}

/* Mobile specific fixes */
@media (max-width: 767px) {
    .ht-timeline-box {
        padding: 15px;
    }

    .ht-timeline-year {
        font-size: 1rem;
    }

    .ht-timeline-item .ht-timeline-content-top,
    .ht-timeline-item .ht-timeline-content-bottom,
    .ht-timeline-snake-content-top {
        padding: 0 10px !important;
    }

    .ht-timeline-snake-road-wrapper {
        width: 60px;
    }
}