/* ================================================
   SERVICES TABS COMPONENT
================================================ */
.services-tabs {
    padding: 70px 8%;
}

.services-tabs-container {
    max-width: 1400px;
    margin: 0 auto;
}

.services-tabs-container .header {
    position: relative;
    margin-bottom: 40px;
}

.services-tabs-slider .glide__slide.filtered-out {
    display: none !important;
}

/* line */
.services-tabs-container .header::after {
    position: absolute;
    content: "";
    height: 1px;
    width: calc(100% - 440px);
    background: #d8d8d8;
    top: 30px;
    right: 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.9s ease;
}

/* when visible */
.services-tabs-container.is-visible .header::after {
    transform: scaleX(1);
}

.services-tabs-container .header h2 span {
    color: #C3B7D7;
    display: block;
}

/* ================================================
   CATEGORY TAB NAVIGATION
================================================ */
.services-tabs__nav {
  flex: 1;
  display: flex;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  overscroll-behavior-y: none;
}

.services-tabs__nav::-webkit-scrollbar {
    display: none;
}

.services-tab {
    background: #F9F9F9;
    border: none;
    padding: 17px 30px;
    font-family: var(--inter);
    color: var(--darkpurple);
    font-size: 0.9em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 0px;
}

.services-tab:first-child {
    border-radius: 10px 0 0 0;
}

.services-tab:last-child {
    border-radius: 0 10px 0 0;
}

.services-tab::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 20px solid #F9F9F9;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 999;
}

/* Make the triangle animate in sync with the tab hover */
.services-tab::after{
  opacity: 0;
  transform: translateX(-50%) translateY(-6px); /* start slightly up */
  transition: opacity 0.3s ease, transform 0.3s ease, border-top-color 0.3s ease;
}

/* On hover, show triangle and match hover background color */
.services-tab:hover::after{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  border-top-color: var(--darkpurple);
}

/* Keep active state behavior (and still show on hover) */
.services-tab.active::after{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  border-top-color: #8F6FB7;
}

/* If active tab is hovered, triangle should match hover color */
.services-tab.active:hover::after{
  border-top-color: var(--darkpurple);
}

.services-tab.active {
    background: #8F6FB7;
    color: white;
}

.services-tab.active::after {
    opacity: 1;
    border-top-color: #8F6FB7;
}

.services-tab:hover {
    background: var(--darkpurple);
    color: var(--white);
}

/* ================================================
   MOBILE TAB NAV WRAPPER & ARROWS
================================================ */

/* Desktop: wrapper is invisible, arrows are hidden */
@media screen and (min-width: 769px) {
    .services-tabs__nav-wrapper {
        display: contents;
    }

    .services-tabs__nav-arrow {
        display: none;
    }
}

/* Mobile: wrapper becomes a flex row with arrows either side */
@media screen and (max-width: 1350px) {
    .services-tabs__nav-wrapper {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .services-tabs__nav {
        flex: 1;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: hidden;
		overflow-y: hidden;  
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        cursor: grab;
        user-select: none;
        /* Remove radius from first/last since wrapper context changes */
    }

    .services-tabs__nav.is-dragging {
        cursor: grabbing;
        scroll-behavior: auto;
    }

    .services-tab {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* Reset first/last radius on mobile so tabs stay square on the edges */
    .services-tab:first-child {
        border-radius: 10px 0 0 0;
    }

    .services-tab:last-child {
        border-radius: 0 10px 0 0;
    }

    /* Arrow buttons */
    .services-tabs__nav-arrow {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        background: transparent;
        border: none;
        color: var(--darkpurple);
        cursor: pointer;
        transition: background 0.2s ease, opacity 0.2s ease;
        padding: 0;
        z-index: 2;
    }

    .services-tabs__nav-arrow:hover {
        color: var(--purple);
    }

    .services-tabs__nav-arrow.is-disabled {
        opacity: 0.3;
        cursor: not-allowed;
        pointer-events: none;
    }
}

/* ================================================
   SERVICES TABS SLIDER
================================================ */
.services-tabs-slider {
    background: var(--lightpurple);
    padding: 45px;
    border-radius: 0 0 15px 15px;
    position: relative;
}

.services-tabs-slider .glide__track {
    overflow: visible;
}

/* Make all slides equal height */
.services-tabs-slider .glide__slides {
    display: flex;
    align-items: stretch;
}

.services-tabs-slider .glide__slide {
    background: var(--white);
    padding: 40px 30px 30px;
    border-radius: 10px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    height: auto;
}

.services-tabs-slider .glide__slide.filtered-out {
    display: none;
}

.services-tabs__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.services-tabs-slider h3 {
    margin-bottom: 5px;
    color: #281942;
    font-size: 1.2em;
}

.services-tabs__link:hover .services-tabs__description {
    color: var(--darkpurple);
}

.services-tabs__description {
    font-weight: 300;
    margin-bottom: 15px;
    flex: 1;
    color: #666;
    line-height: 1.6;
}

/* ================================================
   GLIDE ARROWS
================================================ */
.services-tabs-slider .glide__slide.filtered-out {
    display: none !important;
}

.services-tabs-slider .glide__arrow {
    background: var(--purple);
    color: white;
    border: 2px solid var(--purple);
    transition: 0.2s ease all;
}

.services-tabs-slider .glide__arrow.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.services-tabs-slider .glide__arrow:hover {
    background: var(--darkpurple);
    border: 2px solid var(--darkpurple);
    transition: 0.2s ease all;
}

.services-tabs-slider .glide__arrows {
    display: flex;
    gap: 1rem;
    justify-content: end;
    margin: 0;
}

.services-tabs-slider .glide__arrow--left {
    left: -25px;
}

.services-tabs-slider .glide__arrow--right {
    right: -25px;
}

/* ================================================
   RESPONSIVE
================================================ */
@media screen and (max-width: 768px) {
    .services-tabs {
        padding: 70px 5%;
    }
}