/**
 * Beekom — JOOOL Product Tabs
 * Frontend styles
 *
 * DOM order: tab, panel, tab, panel, tab, panel…
 * Desktop : CSS Grid — tabs go to col 1, panels overlap in col 2.
 * Mobile  : single column — natural flow = accordion (panel under its tab).
 */

.bk-jooul-tabs {
    display: grid;
    grid-template-columns: 45% 1fr;
    column-gap: 60px;
    row-gap: 0;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.bk-jooul-tabs * {
    box-sizing: border-box;
}

/* --- TABS (left column) --- */

.bk-jooul-tab {
    grid-column: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    margin: 0;
    position: relative;
    background: transparent;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    appearance: none;
    -webkit-appearance: none;
    transition:
        background-color .3s ease,
        color .3s ease,
        border-radius .3s ease;
}

.bk-jooul-tab:focus {
    outline: none;
}

.bk-jooul-tab:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.bk-jooul-tab__title {
    margin: 0;
    padding: 0;
    font-weight: 400;
    line-height: 1.2;
    transition: color .3s ease;
}

.bk-jooul-tab__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
    transform-origin: center;
    transition: color .3s ease, transform .35s ease;
}

.bk-jooul-tab__icon svg {
    display: block;
    width: 32px;
    height: auto;
}

/* Active state: rotate arrow -45° to get the diagonal ↗ look */
.bk-jooul-tab.is-active .bk-jooul-tab__icon {
    transform: rotate(-45deg);
}

/* Hover nudge on inactive tabs only */
.bk-jooul-tab:not(.is-active):hover .bk-jooul-tab__icon {
    transform: translateX(4px);
}

/* --- SEPARATORS (pseudo-element on each tab) --- */

.bk-jooul-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #E5E7EB;
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}

/* Separator above every inactive tab except the first */
.bk-jooul-tab:not(.is-active):not(:first-of-type)::before {
    opacity: 1;
}

/* Hide separator on the tab that directly follows the active one
   (DOM order is: … active-tab + active-panel + next-tab …) */
.bk-jooul-tab.is-active + .bk-jooul-panel + .bk-jooul-tab::before {
    opacity: 0;
}

/* --- PANELS (right column, all overlapping at row 1) --- */

.bk-jooul-panel {
    grid-column: 2;
    grid-row: 1 / span 999;
    align-self: start;
    display: flex;
    flex-direction: column;
    min-width: 0;
    animation: bkJooulFadeIn .4s ease;
}

.bk-jooul-panel[hidden],
.bk-jooul-panel:not(.is-active) {
    display: none;
}

@keyframes bkJooulFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bk-jooul-panel__image {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    position: relative;
}

.bk-jooul-panel__image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.bk-jooul-panel__desc {
    margin: 0;
    padding: 0;
}

.bk-jooul-panel__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
    background: transparent;
    transition:
        background-color .3s ease,
        color .3s ease,
        border-color .3s ease,
        transform .3s ease;
}

.bk-jooul-panel__btn:hover {
    text-decoration: none;
}

/* --- RESPONSIVE — accordion on mobile --- */

@media (max-width: 767px) {
    .bk-jooul-tabs {
        grid-template-columns: 1fr !important;
        column-gap: 0 !important;
        row-gap: var(--bk-mobile-row-gap, 16px);
    }

    .bk-jooul-tab,
    .bk-jooul-panel {
        grid-column: auto !important;
        grid-row: auto !important;
    }
}
