/**
 * Timeline Navigation Styles
 * For sales product pages (automobiliai-pardavimui)
 */

/* =============================================================================
   TIMELINE CONTAINER - Main Layout
   ============================================================================= */

.timeline-container {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    position: relative;
}

/* =============================================================================
   TIMELINE NAVIGATION - Sticky Sidebar
   ============================================================================= */

.timeline-nav {
    position: sticky;
    top: 120px;
    height: fit-content;
    padding-right: 20px;
}

/* Track container - overlays timeline-items for progress line and dot */
.timeline-track {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 20px;
    pointer-events: none;
}

.timeline-items {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

/* The vertical track line */
.timeline-items::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-light, #e0e0e0);
}

/* Progress fill overlay */
.timeline-progress {
    position: absolute;
    left: 7px;
    top: 0;
    width: 2px;
    height: 0;
    background: var(--secondary, #2E4A62);
    transition: height 0.3s ease;
    z-index: 1;
}

/* =============================================================================
   TIMELINE ITEMS
   ============================================================================= */

.timeline-item {
    position: relative;
    padding-left: 24px;
    padding-bottom: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

/* Floating active dot - animates between items */
.timeline-dot-active {
    position: absolute;
    left: 2px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--secondary, #2E4A62);
    transition: top 0.3s ease;
    z-index: 2;
}

/* Label text */
.timeline-label {
    display: block;
    font-size: 0.95rem;
    color: var(--text-medium, #666);
    font-weight: 500;
    transition: all 0.3s ease;
    line-height: 1.4;
}

/* Hover state */
.timeline-item:hover .timeline-label {
    color: var(--secondary, #2E4A62);
}

/* =============================================================================
   ACTIVE & PASSED STATES
   ============================================================================= */

/* Passed items (scrolled past) - no bubble, just text styling */
.timeline-item.passed .timeline-label {
    color: var(--text-dark, #333);
}

/* Active item (currently viewing) */
.timeline-item.active .timeline-label {
    color: var(--secondary, #2E4A62);
    font-weight: 600;
}

/* =============================================================================
   TIMELINE CONTENT SECTIONS
   ============================================================================= */

.timeline-content {
    min-height: 100vh;
}

.timeline-section {
    padding-bottom: 60px;
    scroll-margin-top: 100px;
}

.timeline-section:last-child {
    padding-bottom: 40px;
}

.timeline-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--secondary, #2E4A62);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-light, #e0e0e0);
}

/* Description section styling */
.product-description .description-content {
    line-height: 1.7;
    color: var(--text-dark, #333);
}

.product-description .description-content p {
    margin-bottom: 1em;
}

.product-description .description-content ul,
.product-description .description-content ol {
    margin-left: 20px;
    margin-bottom: 1em;
}

.product-description .description-content li {
    margin-bottom: 0.5em;
}

/* =============================================================================
   INQUIRY SECTION (Below Timeline)
   ============================================================================= */

.sales-inquiry-section {
    margin-top: 60px;
    padding: 40px 0;
    border-top: 2px solid var(--border-light, #e0e0e0);
    background: var(--bg-gray, #f5f5f5);
}

.sales-inquiry-section .sales-inquiry-box {
    position: relative;
    top: auto;
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-white, #fff);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.sales-inquiry-section .sales-inquiry-box h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--secondary, #2E4A62);
}

.sales-inquiry-section .inquiry-price-summary {
    margin-bottom: 20px;
}

.sales-inquiry-section .inquiry-description {
    color: var(--text-medium, #666);
    margin-bottom: 25px;
}

.sales-inquiry-section .button {
    display: inline-block;
    min-width: 200px;
}

.sales-inquiry-section .inquiry-contact-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light, #e0e0e0);
}

/* Related Products Section */
.related-products-section {
    margin-top: 40px;
}

/* =============================================================================
   MOBILE RESPONSIVE - Horizontal Timeline
   ============================================================================= */

@media (max-width: 991px) {
    .container-bg {
        background-color: #fafafa
    }
    .timeline-container {
        display: block;
    }

    .timeline-nav {
        position: sticky;
        top: 70px; /* Below sticky header */
        z-index: 100;
        background: var(--bg-white, #fff);
        padding: 15px 0;
        margin: 0 -15px;
        padding-left: 15px;
        padding-right: 15px;
        margin-bottom: 30px;
        background: #fafafa;
        border-bottom: 1px solid var(--border-light, #e0e0e0);
    }

    /* Position track to overlay timeline-items exactly */
    .timeline-track {
        position: absolute;
        top: 15px; /* Match .timeline-nav padding-top */
        left: 15px; /* Match .timeline-nav padding-left */
        right: 15px; /* Match .timeline-nav padding-right */
        height: 30px; /* Enough to contain the line and dot */
        pointer-events: none;
    }

    .timeline-items {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .timeline-items::-webkit-scrollbar {
        display: none;
    }

    /* Horizontal track line */
    .timeline-items::before {
        left: 0;
        right: 0;
        top: 6px;
        bottom: auto;
        width: auto;
        height: 2px;
    }

    /* Horizontal progress - now inside .timeline-track which is positioned over timeline-items */
    .timeline-progress {
        left: 0;
        top: 6px;
        height: 2px;
        width: 0;
    }

    .timeline-item {
        padding-left: 0;
        padding-bottom: 0;
        padding-top: 18px;
        flex-shrink: 0;
        text-align: center;
        min-width: 100px;
        margin-bottom: 0;
    }

    /* Mobile: horizontal floating dot - centered on the line */
    .timeline-dot-active {
        top: 1px; /* Center 12px dot on 2px line at top: 6px */
        left: 0;
        transition: left 0.3s ease, top 0s;
    }

    .timeline-label {
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .timeline-section {
        scroll-margin-top: 160px; /* Account for header (70px) + timeline nav (~90px) */
    }
}

@media (max-width: 576px) {
    .timeline-item {
        min-width: 80px;
    }

    .timeline-label {
        font-size: 0.75rem;
    }

    .timeline-section h3 {
        font-size: 1.25rem;
    }
}
