@import url('../../../assets/css/variables.css');

/** START PRODUCT TABS **/

.ba-product-tabs {
    width: 100%;
}

/* Nav */

.ba-product-tabs__nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 8px;
}

.ba-product-tabs__nav-item {
    position: relative;
    padding: 8px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: var(--font-weight-normal);
    color: var(--color-blue-800);
    border-radius: 9999px;
    white-space: nowrap;
    transition: color var(--transition-fast), background-color var(--transition-fast);
    line-height: 1.4;
}

/* Separator: vertical line before each item except the first */
.ba-product-tabs__nav-item + .ba-product-tabs__nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background-color: var(--color-gray-100);
}

/* Active state */
.ba-product-tabs__nav-item.is-active {
    background-color: var(--color-primary);
    color: var(--color-white);
    font-weight: var(--font-weight-medium);
}

/* No separator after an active item or right before one */
.ba-product-tabs__nav-item.is-active + .ba-product-tabs__nav-item::before {
    display: none;
}

.ba-product-tabs__nav-item:hover:not(.is-active) {
    color: var(--color-primary);
}

/* Panels */

.ba-product-tabs__panels {
    margin-top: 40px;
}

.ba-product-tabs__panel {
    display: block;
    width: 100%;
}

.ba-product-tabs__panel[hidden] {
    display: none;
}

/* Tablet */
@media (max-width: 1024px) {
    .ba-product-tabs__nav {
        flex-wrap: wrap;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .ba-product-tabs__nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .ba-product-tabs__nav-item + .ba-product-tabs__nav-item::before {
        display: none;
    }

    .ba-product-tabs__nav-item {
        width: 100%;
        text-align: left;
    }
}

/* Elementor editor: keep all nested panels visible and easy to target */
.elementor-editor-active .ba-product-tabs__panel {
    display: block;
    pointer-events: auto;
    min-height: 60px;
}

.elementor-editor-active .ba-product-tabs__panel[hidden] {
    opacity: 0.5;
}

.elementor-element--editor-is-active .ba-product-tabs__panel {
    outline: 2px dashed var(--color-primary);
    outline-offset: 4px;
}

/* Empty state for editor when a tab container has no inner elements yet */
.elementor-editor-active .ba-product-tabs__panel:empty::before {
    content: 'Arrastra elementos aqui';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100px;
    color: var(--color-gray-300);
    border: 2px dashed var(--color-gray-200);
    border-radius: 8px;
}

/* Highlight the active tab content in editor */
.elementor-editor-active .ba-product-tabs__panel.is-active {
    outline: 2px solid var(--color-primary);
}

/* Editor placeholder when children not yet initialized */
.ba-product-tabs__empty-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--color-gray-300);
    border: 2px dashed var(--color-gray-200);
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

/* Panel entry animation */
@keyframes ba-tab-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ba-product-tabs__panel.is-entering {
    animation: ba-tab-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .ba-product-tabs__nav-item {
        transition: none;
    }

    .ba-product-tabs__panel.is-entering {
        animation: none;
    }
}

/** END PRODUCT TABS **/
