/**
 * HRM Slider Flatsome Addons - Main Stylesheet
 * Responsive TGDD Slider with Caption Tabs Navigation
 * Compatible with Flatsome Theme 3.16+ / 3.18+ / 3.19+
 */

:root {
    --hrm-caption-bg: #f5f5f5;
    --hrm-caption-height: 45px;
    --hrm-caption-color: #666666;
    --hrm-caption-active-text: #000000;
    --hrm-caption-active-bar: #FF2D38;
    --hrm-caption-active-bg: rgba(255, 255, 255, 0.5);
    --hrm-caption-font-size: 14px;
}

/* Slider Wrapper */
.hrm-slider-tgdd,
.wbcslider_tgdd {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

/* Main Slider Container */
.hrm-slider-main,
.wbcslider-main {
    position: relative;
    width: 100%;
    outline: none;
}

/* Hidden caption storage inside each slide */
.hrm-slider-tgdd .TextCaption,
.wbcslider_tgdd .TextCaption {
    display: none !important;
}

/* Caption Tabs Container (TGDD Style) */
.hrm-slider-tgdd .hrm-slider-nav,
.wbcslider_tgdd .TextCaptions {
    position: relative;
    background-color: var(--hrm-caption-bg, #f5f5f5);
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    box-sizing: border-box;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.hrm-slider-tgdd .hrm-slider-nav::-webkit-scrollbar,
.wbcslider_tgdd .TextCaptions::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

/* Caption Tab Item */
.hrm-slider-tgdd .hrm-slider-tab,
.wbcslider_tgdd .TextCaptions .item {
    flex: 1 1 0%;
    min-width: 100px;
    height: var(--hrm-caption-height, 45px);
    margin: 0 !important;
    padding: 4px 12px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    color: var(--hrm-caption-color, #666);
    font-size: var(--hrm-caption-font-size, 14px);
    line-height: 1.3;
    font-weight: 400;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
    transition: color 0.2s ease, background-color 0.2s ease;
    white-space: normal;
}

/* Vertical divider between tabs */
.hrm-slider-tgdd .hrm-slider-tab::before,
.wbcslider_tgdd .TextCaptions .item::before {
    content: '';
    background-color: #e5e5e5;
    height: 22px;
    position: absolute;
    top: calc(50% - 11px);
    right: 0;
    width: 1px;
}

.hrm-slider-tgdd .hrm-slider-tab:last-child::before,
.wbcslider_tgdd .TextCaptions .item:last-child::before {
    display: none !important;
    background: none !important;
    width: 0 !important;
}

/* Hover effect */
.hrm-slider-tgdd .hrm-slider-tab:hover,
.wbcslider_tgdd .TextCaptions .item:hover {
    color: #111111;
    background-color: rgba(255, 255, 255, 0.25);
}

/* Active Selected Tab */
.hrm-slider-tgdd .hrm-slider-tab.is-selected,
.hrm-slider-tgdd .hrm-slider-tab.is-nav-selected,
.wbcslider_tgdd .TextCaptions .item.is-nav-selected {
    color: var(--hrm-caption-active-text, #000000);
    font-weight: 600;
    background-color: var(--hrm-caption-active-bg, rgba(255, 255, 255, 0.5));
}

/* Red Indicator Line at Top of Active Tab */
.hrm-slider-tgdd .hrm-slider-tab.is-selected::after,
.hrm-slider-tgdd .hrm-slider-tab.is-nav-selected::after,
.wbcslider_tgdd .TextCaptions .item.is-nav-selected::after {
    content: '';
    background-color: var(--hrm-caption-active-bar, #FF2D38);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 2;
}

/* Inner Text Wrap */
.hrm-slider-tgdd .hrm-tab-inner,
.wbcslider_tgdd .TextCaptions .item .hrm-tab-inner {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Slide Cover & Positioning */
.hrm-slider-tgdd .image-cover,
.wbcslider_tgdd .image-cover {
    background-size: cover;
    background-position: center;
}

/* Responsive Rules */
@media (max-width: 849px) {
    .hrm-slider-tgdd .hrm-slider-tab,
    .wbcslider_tgdd .TextCaptions .item {
        font-size: 13px;
        min-width: 90px;
        padding: 4px 8px !important;
    }
}

@media (max-width: 549px) {
    .hrm-slider-tgdd .hrm-slider-nav,
    .wbcslider_tgdd .TextCaptions {
        justify-content: flex-start;
    }

    .hrm-slider-tgdd .hrm-slider-tab,
    .wbcslider_tgdd .TextCaptions .item {
        flex: 0 0 auto;
        min-width: 120px;
        font-size: 12px;
        padding: 4px 6px !important;
    }
}

