/* Tabcordions */
.custom-section.tabcordion {
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.tabcordion *,
.tabcordion *::before,
.tabcordion *::after {
    box-sizing: border-box;
}

.tabcordion {
    --top-logo-height: clamp(6.875rem, 0.217rem + 10.87vw, 10rem);
    --top-margin: 60px;
    padding-top: var(--top-margin);
    padding-bottom: 50px;
    position: relative;
    isolation: isolate;
    width: 100%;
    overflow: hidden;

    &::before {
        content: '';
        top: 0;
        width: 141px;
        height: var(--top-logo-height);
        background-image: var(--logo-img);
        background-repeat: no-repeat;
        background-position: center center;
        background-size: contain;
        z-index: 2;
        display: block;
        margin-inline: auto;
        margin-bottom: 40px;
        position: relative;
    }

    &::after {
        position: absolute;
        height: calc(var(--top-logo-height)/2 + var(--top-margin));
        width: 100vw;
        left: 50%;
        transform: translateX(-50%);
        top: 0;
        background-color: #69B3E7;
        mask-image: url("data:image/svg+xml,%3Csvg width='1928' height='143' viewBox='0 0 1928 143' fill='none' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M964 143L0.979749 0.499971L1927.02 0.50014L964 143Z' fill='%2369B3E7'/%3E%3C/svg%3E%0A");
        mask-repeat: no-repeat no-repeat;
        mask-position: top center;
        mask-size: 100% 100%;
        content: '';
        z-index: -1;
    }
}

.tabcordion.has-tabs .tabcordion--tabs {
    &::before {
        position: absolute;
        bottom: 0;
        height: calc(100% + var(--top-logo-height)/2 + var(--top-margin));
        width: 100%;
        left: 0;
        content: '';
        z-index: -2;
        opacity: 0.2;;
        background: linear-gradient(to top,
                rgba(105, 179, 231, 0) 0%,
                rgba(105, 179, 231, 0.84) 53.8462%,
                rgba(105, 179, 231, 1) 100%);
        mask-image: url("data:image/svg+xml,%3Csvg width='1348' height='358' viewBox='0 0 1348 358' fill='none' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M674 0L1347.77 357.75L0.232239 357.75L674 0Z' fill='url(%23paint0_linear_141_416)' /%3E%3Cdefs%3E%3ClinearGradient id='paint0_linear_141_416' x1='674' y1='337.652' x2='672.161' y2='0.00850651' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%2369B3E7' stop-opacity='0'/%3E%3Cstop offset='0.538462' stop-color='%2369B3E7' stop-opacity='0.84'/%3E%3Cstop offset='1' stop-color='%2369B3E7'/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E%0A");
        mask-repeat: no-repeat no-repeat;
        mask-position: center center;
        mask-size: 100% 100%;
    }
}

.tabcordion .tabs-section-title {
    color: var(--primary-color);
    margin-bottom: 35px;
    max-width: 900px;
}

.tabcordion.has-tabs .tabcordion--tabs {
    opacity: 1;
    height: auto;
    visibility: visible;
    position: relative;
    isolation: isolate;
    z-index: 1;
    padding-inline: 30px;

    &::after {
        position: absolute;
        height: 50%;
        width: 100%;
        bottom: 0;
        left: 0;
        background-color: var(--primary-color);
        content: '';
        z-index: -1;
        border-radius: 62px 62px 0 0;
    }
}

.tabcordion.has-tabs .tabcordion--entry {
    min-height: 0;
}

.tabcordion.has-tabs .tabcordion--entry::before {
    display: none;
}

.tabcordion.has-tabs .tabcordion--entry.is-active .tabcordion--entry-content {
    opacity: 1;
    transition: opacity 400ms ease-in-out;
}

.tabcordion.has-tabs .tabcordion--entry .tabcordion--entry-content {
    opacity: 0;
    transition: opacity 400ms ease-in-out;
}

.tabcordion-container {
    width: 1280px;
    max-width: 80%;
    margin-inline: auto;
}

.tabcordion--tabs {
    opacity: 0;
    height: 0;
    visibility: hidden;
    display: flex;
    flex-flow: nowrap;
    margin: 0;
    list-style: none;
    padding: 0;
    justify-content: center;
    gap: clamp(1.25rem, -1.667rem + 4.762vw, 2.5rem);
}

.tabcordion--tabs .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: transparent;
    color: var(--primary-color);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.2;
    position: relative;
    padding: 0;
}

.tabcordion--tabs .tab:hover,
.tabcordion--tabs .tab:focus {
    outline: none;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.tabcordion--tabs .tab.is-active {
    background: transparent;
    transform: translateY(-4px);
    z-index: 10;

    img {
        filter: drop-shadow(5.409px 15.147px 10.927px rgba(0, 0, 0, 0.29));
        transform: scale(1.15);
        transform-origin: top center;
    }
}

.tabcordion--tabs .tab.is-active:hover,
.tabcordion--tabs .tab.is-active:focus {
    transform: translateY(-4px);
}

/* Tab with icon and title */
.tabcordion--tabs .tab .tab-image {
    width: var(--tab-image, 170px);
    aspect-ratio: 1/1;
    object-fit: contain;
    transition: all 0.3s ease;
    border-radius: 50%;
}

/* General image sizing for all tab images */
.tabcordion--tabs .tab .tab-image,
.tabcordion .tabcordion--panels .tab .tab-image img,
.tabcordion-moving-image {
    max-width: 100%;
    height: auto;
}

.tabcordion--tabs .tab .tab-title {
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    line-height: 1.1;
    color: var(--primary-color);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

/* Hide tab title when tabTitlePosition is belowPanel and image exists */
.tabcordion.tabTitlePosition-belowPanel .tabcordion--tabs .tab:has(.tab-image) .tab-title {
    display: none;
}

/* Active tab styling */


/* Focus styles for accessibility */


.has-tabs .tabcordion--panels {
    border-top: none;
    margin-top: 0;
}

.tabcordion--entry {
    overflow: visible;
    position: relative;
    background: var(--primary-color);
    color: white;
    border-radius: 0 0 62px 62px;
    text-align: center;
}

.panel-content-text p {
    font-size: clamp(1.125rem, 0.592rem + 0.87vw, 1.375rem);
    line-height: 1.4;
    font-weight: 400;

    @media only screen and (max-width: 460px) {
        font-size: 16px;
    }
}

.tabcordion:not(.has-tabs) .tabcordion--entry:not(:first-child) {
    border-top: 1px solid #ddd;
}

.tabcordion--entry::before {
    position: relative;
    content: attr(data-title);
    z-index: 1;
    display: block;
}

.tabcordion:not(.has-tabs) .tabcordion--entry::before {
    background: color-mix(in srgb, var(--primary-color) 3%, transparent);
    color: var(--primary-color);
    padding: 10px 20px;
    cursor: pointer;
}

.tabcordion:not(.has-tabs) .tabcordion:not(.has-tabs) .tabcordion--entry:not(.is-active):before {
    padding-right: 35px;
}

.tabcordion:not(.has-tabs) .tabcordion--entry:hover,
.tabcordion:not(.has-tabs) .tabcordion--entry:focus {
    outline: none;
}

.tabcordion:not(.has-tabs) .tabcordion--entry:hover::before,
.tabcordion:not(.has-tabs) .tabcordion--entry:focus::before {
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
}

.tabcordion:not(.has-tabs) .tabcordion--entry:not(.is-active):after {
    content: '';
    position: absolute;
    right: 15px;
    top: 15px;
    width: 12px;
    height: 12px;
    background-color: var(--primary-color);
    mask-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 6H8V0H6V6H0V8H6V14H8V8H14V6Z' fill='%23002F6C'/%3E%3C/svg%3E%0A");
    mask-repeat: no-repeat no-repeat;
    mask-position: center center;
    mask-size: contain;
}

.tabcordion--entry.is-active .tabcordion--entry-content {
    margin-top: 0;
    height: auto;
    opacity: 1;
    transition: margin 400ms ease-out -100ms;
}

.tabcordion:not(.has-tabs) .tabcordion--entry.is-active::before {
    background: color-mix(in srgb, var(--primary-color) 18%, transparent);
    font-weight: 700;
}

.tabcordion:not(.has-tabs) .tabcordion--entry.is-active:hover::before,
.tabcordion:not(.has-tabs) .tabcordion--entry.is-active:focus::before {
    background: color-mix(in srgb, var(--primary-color) 20%, transparent);
}

.tabcordion--entry-container {
    overflow: hidden;
    position: relative;
}

.tabcordion--entry-content {
    position: relative;
    margin-top: -100%;
    height: 0;
    opacity: 0;
    transition: margin 500ms ease-in;
    /* background: var(--primary-color); */
    color: white;
    width: 1050px;
    max-width: 85%;
    margin-inline: auto;
}

/* Add bottom title section - only for active panels */
.tabcordion.tabTitlePosition-belowPanel .tabcordion--entry.is-active::after {
    content: attr(data-title);
    display: block;
    background: #69b3e7;
    color: var(--primary-color);
    padding-block: 13px;
    padding-left: 90px;
    padding-right: 30px;
    font-weight: 700;
    font-size: clamp(1.25rem, 0.185rem + 1.739vw, 1.75rem);
    line-height: 1.3;
    text-transform: uppercase;
    text-align: left;
    border-radius: 50vw;
    filter: drop-shadow(0 -1px 8px rgba(0, 0, 0, 0.39));
    animation: slideUp 0.7s ease-out;
}

.tabcordion.tabTitlePosition-belowPanel #tab2-tab.tabcordion--entry.is-active::after {
    background-color: #003a70;
    color: #FFF;
}

.tabcordion.tabTitlePosition-belowPanel #tab3-tab.tabcordion--entry.is-active::after {
    background-color: #d22630;
    color: #FFF;
}

.tabcordion.tabTitlePosition-belowPanel #tab4-tab.tabcordion--entry.is-active::after {
    background-color: #008013;
    color: #FFF;
}

.tabcordion.tabTitlePosition-belowPanel #tab5-tab.tabcordion--entry.is-active::after {
    background-color: #ffc72c;
    color: #003a70;
}

.tabcordion .tabcordion--entry.is-active .tabcordion--entry-content {
    padding: clamp(1.875rem, -2.5rem + 7.143vw, 3.75rem) 30px 42px;
}


.tabcordion--entry-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    font-size: 16px;
    line-height: 1.6;
}

.tabcordion--entry-content p {
    margin: 0 0 20px 0;
    color: white;
}

.tabcordion--entry-content p:last-child {
    margin-bottom: 0;
}

.tabcordion--entry-content .panel-content-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 15px;
}

.tabcordion--entry-content .panel-content-button {
    min-height: 40px;
    text-decoration: none;
    display: flex;
    align-items: center;
    position: relative;
    border: white solid 2px;
    margin: 0;
    transition: background .35s ease-in-out;
    border-radius: 50vw;
    padding: 12px 24px;
    box-sizing: border-box;
    justify-content: flex-start;
    background: transparent;
}

.tabcordion--entry-content .panel-content-button:hover {
    background-color: white;
}

.tabcordion--entry-content .panel-content-button:hover * {
    color: var(--primary-color) !important;
}

.tabcordion--entry-content .panel-content-button__title {
    color: white;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 700;
}

.tabcordion--entry-content .panel-content-button__title::after {
    background-color: currentColor;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M7.52867 11.5286L8.47133 12.4712L12.9427 7.9999L8.47133 3.52856L7.52867 4.47123L10.3907 7.33323H4V8.66656H10.3907L7.52867 11.5286Z' fill='%23ffffff'/%3E%3C/svg%3E");
    mask-repeat: no-repeat no-repeat;
    mask-position: left center;
    mask-size: contain;
    content: '';
    min-width: 20px;
    min-height: 20px;
    display: block;
}

.tabcordion--entry-content .panel-content-image img {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}

.tabcordion.has-tabs.tabsPosition-left,
.tabcordion.has-tabs.tabsPosition-right {
    .tabcordion-container {
        display: flex;
    }

    .tabcordion--tabs {
        flex-direction: column;
        align-items: flex-start;
        width: 300px;
        opacity: 1;
        visibility: visible;
        height: auto;
        gap: 0;
        padding: 0;
        background: color-mix(in srgb, var(--primary-color) 1%, transparent);
    }

    .tabcordion--tabs .tab {
        width: 100%;
        text-align: left;
        border-radius: 0;
        border-right: 1px solid #ddd;
        border-bottom: 1px solid #ddd;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 20px;
        background: color-mix(in srgb, var(--primary-color) 4%, transparent);
        min-width: auto;
        min-height: auto;
    }

    .tabcordion--tabs .tab:last-child {
        border-bottom: 0;
    }

    .tabcordion--tabs .tab .tab-image {
        width: 40px;
        height: 40px;
    }

    .tabcordion--tabs .tab .tab-title {
        text-align: left;
        font-size: 16px;
        display: block !important;
        /* Override the hide rule for vertical tabs */
    }

    .tabcordion--panels {
        width: calc(100% - 300px);
    }

    .tabcordion--entry-content {
        padding: 0;
        background: transparent;
        color: inherit;
    }

    .tabcordion--entry.is-active {
        padding: 15px 20px;
        overflow: visible;
        background: transparent;
    }

    .tabcordion--entry.is-active .tabcordion--entry-container {
        overflow: visible;
    }

    .tabcordion--entry.is-active::before {
        display: block;
        font-weight: 700;
        color: var(--primary-color);
        font-size: clamp(1.313rem, 0.226rem + 1.774vw, 2rem);
        line-height: 1.1;
        margin-bottom: 20px;
    }
}

@media only screen and (min-width: 1280px) {

    .tabcordion.has-tabs.tabsPosition-left .tabcordion--entry.is-active,
    .tabcordion.has-tabs.tabsPosition-right .tabcordion--entry.is-active {
        padding: 25px 30px;
    }
}

.tabcordion.has-tabs.tabsPosition-right .tabcordion--tabs .tab {
    border-right: 0;
    border-left: 1px solid rgb(221, 221, 221);
}

.tabcordion.has-tabs.tabsPosition-right .tabcordion--panels {
    order: -1;
}

/* Hide the original tab elements since they're cloned to the tabs container */
.tabcordion .tabcordion--panels .tab {
    display: none;
    margin-inline: auto;
    outline: none;
}

/* Show panel tabs when tabs overflow for image animation when tabTitlePosition is belowPanel */
.tabcordion.tabs-overflow.tabTitlePosition-belowPanel .tabcordion--entry.is-active .tab {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    width: 93px;
    height: 93px;
    transform: translateY(-50%);
    margin-bottom: -40px;

    img {
        width: 100%;
        height: auto;
    }
}

.tabcordion.tabs-overflow.tabTitlePosition-belowPanel .tabcordion--entry .tab .tab-image {
    border-radius: 50%;
    transform: scale(0);
    overflow: hidden;
    display: block;
}

.tabcordion.tabs-overflow.tabTitlePosition-belowPanel .tabcordion--entry.is-active .tab .tab-image {
    animation: scaleUp 0.4s ease-in-out 0.3s both;
    ;
    transform: scale(1);
}

/* Keyframe animation */
@keyframes scaleUp {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

.tabcordion.tabs-overflow.tabTitlePosition-belowPanel .tabcordion--entry .tab .tab-image img {
    max-width: 100%;
    height: auto;
    border-radius: 50%;
    display: block;
}

/* Hide panel tab title when tabs overflow */
.tabcordion.tabs-overflow.tabTitlePosition-belowPanel .tabcordion--entry.is-active .tab .tab-title {
    display: none;
}

/* Moving image animation */
.tabcordion-moving-image {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Overflow-based responsive styles (replaces media queries) */
.tabcordion.tabs-overflow .tabcordion--tabs {
    gap: 0;
    flex-wrap: nowrap;
    overflow: visible;
    justify-content: center;
    display: block;
    text-align: center;
    white-space: nowrap;
}

.tabcordion.tabs-overflow .tabcordion--tabs .tab {
    flex-shrink: 0;
    padding: 0;
    gap: 8px;
    display: inline-block;
    vertical-align: middle;
    width: 75px;
    height: 75px;
    transition: all 0.6s ease-in-out !important;

    &.is-active {
        inset: 0 !important;
        opacity: 1;
        border: 0;
        outline: none;
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        transform: none !important;
        width: 0px !important;
        height: 0px !important;
    }
}

.tabcordion.tabs-overflow .tabcordion--tabs .tab .tab-image {
    width: 100%;
    height: 100%;
}

.tabcordion.tabs-overflow .tabcordion--tabs .tab.is-active .tab-image {
    display: block;
}

.tabcordion.tabs-overflow .tabcordion--tabs .tab .tab-title {
    font-size: 11px;
}


/* Animation for tab switching */
.tabcordion--entry.is-active .tabcordion--entry-container {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-button:not(:has(a)) {
    display: none;
}

/* Custom scrollbar for mobile tab overflow */
.tabcordion--tabs::-webkit-scrollbar {
    display: none;
}

.tabcordion--tabs {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.tabcordion.tabs-overflow.has-tabs {
    &.tabTitlePosition-belowPanel .tabcordion--entry.is-active::after {
        padding-inline: 15px;
        text-align: center;
        border-radius: 10px;
    }

    .tabcordion--tabs {
        &::before {
            width: 200vw;
            left: 50%;
            transform: translateX(-50%);
            height: calc(100% + var(--top-logo-height) / 2 + var(--top-margin) + 100px);
            bottom: -100px;
        }
    }

    .tabcordion--entry {
        border-radius: 32px;
    }

    .tabcordion--entry.is-active .tabcordion--entry-content {
        padding: 30px 0;
    }

    .tabcordion--tabs {
        padding-inline: 0;
        justify-content: center;
        padding-bottom: 60px;

        .tab {
            flex: 1;

            &:not(.is-active) {
                margin-inline: 10px;
            }

            img {
                width: 100%;
                height: auto;
            }
        }
    }

    .tabcordion--tabs::after {
        display: none;
    }

}

@media only screen and (max-width: 600px) {
    .tabcordion-container {
        max-width: 100%;
        padding-inline: 30px;
    }

    .tabcordion--entry.is-active .tabcordion--entry-content {
        max-width: 100%;
        padding: 20px 20px 30px !important;
    }

    .panel-content-text p {
        font-size: 16px;
    }
}

@media only screen and (max-width: 440px) {
    .tabcordion.tabs-overflow.has-tabs {
        .tabcordion--tabs {

            .tab {
                width: calc(100%/4 - 10px);
            }

            .tab:not(.is-active) {
                box-shadow: none;
                margin-inline: 5px;
            }
        }

    }
}

/* END Tabcordions */