/* CONTAINER & NAV */
.tabs-wrapper { margin-top: 40px; }

@media (min-width: 768px) {
  .tabs-wrapper { margin-right: 40px;}
}

.tabs-nav {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 40px;
    overflow-x: auto;
    scrollbar-width: none;
}



/* CONTENT BLOCKS */
.tab-content { display: none; animation: fadeIn 0.4s ease forwards; }
.tab-content.active { display: block; }

.tab-lead { font-size: 1.1rem; color: #ccc; margin-bottom: 30px; line-height: 1.6; }


/* THE TAB BUTTON CONTAINER */
.tab-header-container {
    display: flex;
    overflow-x: auto; /* Allows horizontal swiping */
    overflow-y: hidden;
    white-space: nowrap; /* Prevents buttons from wrapping to a second line */
    -webkit-overflow-scrolling: touch; /* Smooth momentum scrolling on iOS */
    gap: 10px;
    padding-bottom: 10px; /* Space for the scrollbar if visible */
    margin-bottom: 20px;

    /* Hide scrollbar for a cleaner look while keeping functionality */
    scrollbar-width: none; /* Firefox */
}

.tab-header-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}



/* 1. THE WINDOW */

/* RESET BASE */
.tab-wrapper-mobile {
    position: relative;
    width: 100%;
    border: none !important; /* Kills the phantom white line */
    background: transparent;
}

.tab-header-container {
  /* Ensure the container itself is allowed to scroll internally */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    display: flex;
    white-space: nowrap;
    gap: 15px;
    padding: 10px 0;

    /* THE BUFFER: Ensures the button doesn't hit the absolute edge */
    scroll-padding-left: 20px;
    scroll-padding-right: 50px; /* Room for the fade on the right */
    scrollbar-width: none;
}

.tab-header-container::-webkit-scrollbar { display: none; }

/* SHARED LOGIC STYLES */
.tab-trigger {
    cursor: pointer;
    transition: all 0.3s ease;
    /* Reset Safari/Chrome defaults */
    border: none;
    outline: none;
    -webkit-appearance: none;
    background: none; border: none;
    padding: 15px 25px;
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
    flex: 0 0 auto; /* Crucial: prevents buttons from shrinking to fit */
}

/* DARK SECTION STYLING */
.tab-btn-dark {
    color: #555;
    background: transparent;
}
.tab-btn-dark.active {
    color: #fff;
    border-bottom: 2px solid var(--logo-green);
}

/* LIGHT SECTION STYLING */
.tab-btn-light {
    color: #999;
    background: transparent;
}
.tab-btn-light.active {
    color: var(--black);
    border-bottom: 2px solid var(--logo-green);
}

/* THE FADE - EXPLICIT FOR SAFARI */
@media (max-width: 768px) {
    .tab-wrapper-mobile::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 60px;
        height: 100%;
        pointer-events: none;
        z-index: 5;
    }

    /* DARK VARIANT FADE */
    .tab-style-dark::after {
        background: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,1));
    }

    /* LIGHT VARIANT FADE */
    .tab-style-light::after {
        background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,1));
    }
}


/* Hide the fade when the user is at the end (Optional/Advanced) */

.specs-content-wrapper {
    margin-top: 40px;
    min-height: 400px; /* Prevents layout jump when switching tabs */
}

.spec-intro {
    font-size: 1.1rem;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 30px;
}

.spec-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.spec-list li {
    padding: 15px 0;
    border-bottom: 1px solid #222;
    color: #eee;
    font-size: 1rem;
}

.spec-list li strong {
    color: var(--logo-green);
    display: block;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.spec-list li em {
    color: #fff;
    font-style: normal;
    font-weight: 600;
}

/* Tab buttons for Black Section */
.tab-btn-dark {
    color: #666;
    border-bottom: 2px solid transparent;
    padding: 10px 0;
    margin-right: 25px;
    font-weight: 600;
}

.tab-btn-dark.active {
    color: #fff;
    border-bottom-color: var(--logo-green);
}

/* Mobile: Ensure the list is readable */
@media (max-width: 768px) {
    .spec-intro { font-size: 1rem; }
    .spec-list li { font-size: 0.95rem; }

    /* 1. Kill any fixed widths or min-widths */
    #specs .container-narrow {
        width: 100% !important;
        max-width: 100vw !important;
        padding: 0 20px;
        overflow-x: hidden; /* Prevents tiny sub-pixel leaks */
    }

    /* 2. The Tab Header - Essential Fix */
    /* If your tabs are in a row, they often 'push' the screen wide */
    .tab-header-container {
        display: flex;
        flex-wrap: wrap; /* Allows tabs to stack if they don't fit */
        justify-content: flex-start;
        gap: 10px;
        width: 100%;
    }

    .tab-btn-dark {
        margin-right: 10px; /* Reduce the gap between tabs */
        font-size: 0.9rem;
        white-space: nowrap; /* Prevents text from breaking weirdly */
    }

    /* 3. The Content Wrapper */
    .specs-content-wrapper {
        width: 100% !important;
        min-height: auto !important; /* Remove the 400px 'jump' protection for mobile */
    }

    /* 4. The List Items */
    .spec-list li {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%; /* Ensures long words don't push the boundary */
    }

}
