/**
 * 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;
}

/* =============================================================================
   VIDEO EMBED
   ============================================================================= */

.video-embed {
    max-width: 640px;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-embed iframe {
    width: 100%;
    height: 100%;
    display: block;
}

/* =============================================================================
   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;
}

/* =============================================================================
   LEASING CALCULATOR
   ============================================================================= */

.leasing-disclaimer {
    font-size: 0.8rem;
    color: var(--text-medium, #666);
    margin-top: 16px;
    margin-bottom: 0;
    line-height: 1.4;
}

.leasing-calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 900px;
}

.leasing-calculator {
    background: var(--bg-white, #fff);
    border: 1px solid var(--border-light, #e0e0e0);
    border-radius: 12px;
    padding: 24px;
}

.leasing-field {
    margin-bottom: 24px;
}

.leasing-field:last-of-type {
    margin-bottom: 0;
}

.leasing-field label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-medium, #666);
    margin-bottom: 8px;
    font-weight: 500;
}

.leasing-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.leasing-field-header label {
    margin-bottom: 0;
}

.leasing-field-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary, #2E4A62);
}

/* Price and Rate Display */
.leasing-price-display,
.leasing-rate-display {
    background: var(--bg-light, #f8f9fa);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leasing-price-value,
.leasing-rate-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary, #2E4A62);
    text-align: right;
}

.leasing-rate-value {
    display: flex;
    align-items: center;
    gap: 6px;
}

.leasing-rate-tooltip {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-medium, #666);
    transition: color 0.2s;
}

.tooltipster-default .tooltipster-box {
    max-width: 320px;
}

.leasing-rate-tooltip:hover {
    color: var(--secondary, #2E4A62);
}

/* Slider Styling */
.leasing-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-light, #e0e0e0);
    outline: none;
    cursor: pointer;
}

.leasing-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--secondary, #2E4A62);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.leasing-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.leasing-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--secondary, #2E4A62);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.leasing-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: -4px;
    font-size: 0.8rem;
    color: var(--text-light, #999);
}

/* Result Box */
.leasing-result {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, var(--secondary, #2E4A62) 0%, #3d5f7a 100%);
    border-radius: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.leasing-result-label {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

.leasing-result-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.leasing-result-unit {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.85;
    margin-left: 4px;
}

/* Bank Buttons Section */
.leasing-banks {
    background: var(--bg-light, #f8f9fa);
    border: 1px solid var(--border-light, #e0e0e0);
    border-radius: 12px;
    padding: 24px;
}

.leasing-banks h4 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: var(--text-dark, #333);
}

.leasing-banks-description {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-medium, #666);
}

.bank-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bank-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-white, #fff);
    border: 2px solid var(--border-light, #e0e0e0);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark, #333);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.bank-button:hover {
    border-color: var(--secondary, #2E4A62);
    background: var(--bg-white, #fff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateX(2px);
}

.bank-button svg {
    flex-shrink: 0;
    color: var(--text-medium, #666);
    transition: color 0.2s ease;
}

.bank-button:hover svg {
    color: var(--secondary, #2E4A62);
}

.bank-button-text {
    margin-left: auto;
    margin-right: 8px;
}

.bank-logo {
    width: 70px;
    height: 24px;
    object-fit: contain;
    object-position: left center;
    flex-shrink: 0;
}

/* Leasing Divider */
.leasing-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-light, #999);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.leasing-divider::before,
.leasing-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-light, #e0e0e0);
}

.leasing-divider span {
    padding: 0 12px;
}

/* Leasing Inquiry Section */
.leasing-inquiry-description {
    font-size: 0.9rem;
    color: var(--text-medium, #666);
    margin-bottom: 12px;
}

.leasing-inquiry-btn {
    width: 100%;
    padding: 14px 20px;
    font-weight: 600;
}

/* Commercial Proposal Section */
.leasing-commercial-description {
    font-size: 0.9rem;
    color: var(--text-medium, #666);
    margin-bottom: 12px;
}

.leasing-commercial-btn {
    width: 100%;
    padding: 14px 20px;
    font-weight: 600;
}

/* When bank section is active, enable 2-column layout on desktop */
.leasing-calculator-wrapper:has(.leasing-banks) {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
    .leasing-calculator-wrapper:has(.leasing-banks) {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   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;
        padding: 0;
        margin: 0 -15px;
        padding-left: 15px;
        padding-right: 15px;
        margin-bottom: 30px;
        background: #fafafa;
        border-bottom: 1px solid var(--border-light, #e0e0e0);
    }

    /* Hide the vertical track/progress/dot on mobile - use underline indicator instead */
    .timeline-track {
        display: none;
    }

    .timeline-items {
        display: flex;
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .timeline-items::-webkit-scrollbar {
        display: none;
    }

    /* Remove the horizontal track line - replaced by tab underline */
    .timeline-items::before {
        display: none;
    }

    .timeline-item {
        padding: 12px 16px;
        flex-shrink: 0;
        text-align: center;
        min-width: auto;
        margin-bottom: 0;
        border-bottom: 2px solid transparent;
        transition: border-color 0.3s ease;
    }

    /* Active tab underline indicator */
    .timeline-item.active {
        border-bottom-color: var(--secondary, #2E4A62);
    }

    .timeline-label {
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .timeline-section {
        scroll-margin-top: 160px; /* Account for header (70px) + timeline nav (~90px) */
    }
}

@media (max-width: 576px) {
    .timeline-item {
        padding: 10px 12px;
    }

    .timeline-label {
        font-size: 0.75rem;
    }

    .timeline-section h3 {
        font-size: 1.25rem;
    }

    /* Leasing calculator mobile */
    .leasing-calculator-wrapper {
        max-width: 100%;
    }

    .leasing-calculator {
        padding: 16px;
    }

    .leasing-field {
        margin-bottom: 20px;
    }

    .leasing-price-display,
    .leasing-rate-display {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .leasing-price-value,
    .leasing-rate-value {
        font-size: 1.1rem;
    }

    .leasing-result {
        padding: 16px;
    }

    .leasing-result-label {
        font-size: 0.85rem;
    }

    .leasing-result-value {
        font-size: 1.3rem;
    }

    .leasing-banks {
        padding: 20px;
    }

    .leasing-banks h4 {
        font-size: 1rem;
    }

    .leasing-banks-description {
        font-size: 0.85rem;
        margin-bottom: 16px;
    }

    .bank-button {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}
