/**
 * KB Product Tabs Advanced Widget
 * Tabs with table of contents and custom sections
 */

.kbpb-product-tabs-advanced {
    margin: 40px 0;
}

/* Tab Navigation */
.kbpb-tabs-nav {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 30px;
}

.kbpb-tab-title {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kbpb-tab-title:hover {
    color: #E84B19;
}

.kbpb-tab-title.active {
    color: #E84B19;
    border-bottom-color: #E84B19;
}

/* Tab Content */
.kbpb-tabs-content {
    position: relative;
}

.kbpb-tab-pane {
    display: none;
}

.kbpb-tab-pane.active {
    display: block;
}

/* Table of Contents */
.kbpb-toc {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    border-left: 4px solid #B76E79;
}

.kbpb-toc.has-bg-image {
    position: relative;
}

.kbpb-toc-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
}

.kbpb-toc-grid {
    position: relative;
    z-index: 1;
}

.kbpb-toc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.kbpb-toc-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kbpb-toc-number {
    font-size: 18px;
    font-weight: 700;
    color: #212223;
}

.kbpb-toc-item a {
    font-size: 16px;
    font-weight: 600;
    color: #B76E79;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.kbpb-toc-item a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Section Content */
.kbpb-sections-content {
    margin-top: 40px;
}

.kbpb-section {
    margin-bottom: 60px;
}

/* Desktop: Side-by-side layout */
@media (min-width: 769px) {
    .kbpb-section {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 40px;
        align-items: start;
    }
}

.kbpb-section-title {
    font-size: 28px;
    font-weight: 700;
    color: #212223;
    line-height: 1.3;
    margin: 0 0 20px 0;
}

.kbpb-section-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.kbpb-section-content p {
    margin-bottom: 15px;
}

.kbpb-section-content a,
.kbpb-section-content p a,
.kbpb-section-content a span,
.kbpb-section-content a span span,
.kbpb-product-description a,
.kbpb-product-description p a,
.kbpb-product-description a span,
.kbpb-product-description a span span {
    color: #B76E79 !important;
    text-decoration: underline !important;
}

.kbpb-section-content a:hover,
.kbpb-section-content a:hover span,
.kbpb-section-content a:hover span span,
.kbpb-section-content p a:hover,
.kbpb-product-description a:hover,
.kbpb-product-description a:hover span,
.kbpb-product-description a:hover span span,
.kbpb-product-description p a:hover {
    color: #9A5A63 !important;
    text-decoration: underline !important;
}

/* Product Description */
.kbpb-product-description {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .elementor-widget-kbpb-product-tabs-advanced .elementor-widget-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .kbpb-product-tabs-advanced {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 20px;
    }

    /* Tabs - horizontal layout with wrapping, 2-3 per row */
    .kbpb-tabs-nav {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        border-bottom: 1px solid #e0e0e0;
        gap: 0;
        margin-bottom: 20px;
    }

    .kbpb-tab-title {
        flex: 1 1 auto;
        min-width: calc(50% - 1px);
        max-width: calc(50%);
        padding: 10px 12px;
        font-size: 11px;
        text-align: center;
        border-bottom: 2px solid transparent;
        border-left: none;
        margin-bottom: -1px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .kbpb-tab-title.active {
        border-bottom-color: #E84B19;
        border-left-color: transparent;
        color: #E84B19;
    }

    /* TOC - compact inline style matching target design */
    .kbpb-toc {
        padding: 15px 20px;
        margin-bottom: 25px;
        border-radius: 6px;
        border-left: 4px solid #B76E79;
        background: #f8f8f8;
    }

    .kbpb-toc-grid {
        display: flex;
        flex-direction: column;
        gap: 8px;
        max-width: 100%;
    }

    .kbpb-toc-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .kbpb-toc-number {
        font-size: 14px;
        font-weight: 700;
        color: #212223;
        min-width: 18px;
    }

    .kbpb-toc-item a {
        font-size: 14px;
        font-weight: 600;
        color: #B76E79;
    }

    .kbpb-section {
        margin-bottom: 30px;
    }

    .kbpb-section-title {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .kbpb-section-content {
        font-size: 14px;
        line-height: 1.7;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .kbpb-tab-title {
        min-width: calc(50% - 1px);
        padding: 8px 8px;
        font-size: 10px;
    }

    .kbpb-toc {
        padding: 12px 15px;
    }

    .kbpb-toc-number {
        font-size: 13px;
    }

    .kbpb-toc-item a {
        font-size: 13px;
    }

    .kbpb-section-title {
        font-size: 18px;
    }

    .kbpb-section-content {
        font-size: 14px;
    }
}
