.mud-tabs.mud-elevation-1{
    box-shadow: var(--fg-shadow-box);
}

/* UIAUDIT-6: !important обоснован — переопределение стилей MudBlazor Tabs */
.mud-tabs.mud-tabs-rounded-top .mud-tabs-tabbar {
    background-color: unset !important;
}

.mud-tabs-tabbar .mud-tooltip-root.mud-tooltip-inline {
    background-color: var(--mud-palette-surface);
    border-radius: 30px 30px 0 0 !important;
}

.mud-tabs-tabbar .mud-tab {
    background-color: var(--mud-palette-surface);
    border-radius: 30px 30px 0 0 !important;
}

.mud-tabs-tabbar .mud-tab:hover {
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-secondary);
}

.mud-tabs-tabbar .mud-tab-active {
    background-color: var(--mud-palette-secondary);
    color: var(--mud-palette-primary-text);
}

.tab-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    margin-left: 8px;
    background-color: var(--mud-palette-secondary);
    color: white;
    box-sizing: border-box;
}

.mud-tab-active .tab-count-badge {
    background-color: white;
    color: var(--mud-palette-secondary);
}

/* Country sub-tabs (chips) for Cargo/Farms */
.country-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.country-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 20px;
    border: 2px solid var(--mud-palette-secondary);
    background: transparent;
    color: var(--mud-palette-text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.country-chip:hover {
    background-color: rgba(var(--mud-palette-secondary-rgb, 103, 58, 183), 0.1);
}

.country-chip.active {
    background-color: var(--mud-palette-secondary);
    color: white;
}

.country-chip .country-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    background-color: var(--mud-palette-secondary);
    color: white;
}

.country-chip.active .country-badge {
    background-color: white;
    color: var(--mud-palette-secondary);
}

/* ================================================================
   Parent tabs (fg-parent-tabs): text-only, no background
   Active: #542A80, Inactive: #A881D3, 20px, uppercase
   ================================================================ */
.fg-parent-tabs .mud-tabs-tabbar .mud-tab,
.fg-parent-tabs .mud-tabs-tabbar .mud-tooltip-root.mud-tooltip-inline {
    background-color: transparent !important;
    border-radius: 0 !important;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 24px;
    text-transform: uppercase;
    color: #A881D3;
    padding: 8px 16px;
    min-height: unset;
}

.fg-parent-tabs .mud-tabs-tabbar .mud-tab:hover {
    background-color: transparent !important;
    color: #7B3FB5;
}

.fg-parent-tabs .mud-tabs-tabbar .mud-tab-active {
    background-color: transparent !important;
    color: #542A80 !important;
}

.fg-parent-tabs .mud-tabs-tabbar .mud-tab-active .d-flex {
    color: #542A80;
}

.fg-parent-tabs .mud-tabs-tabbar .mud-tab:not(.mud-tab-active) .d-flex {
    color: #A881D3;
}

.fg-parent-tabs .mud-tabs-tabbar {
    background-color: transparent !important;
    box-shadow: none !important;
}

.fg-parent-tabs .mud-tabs-slider {
    background-color: #542A80 !important;
}

.stock-tab-label::after {
    content: "";
    display: none;
}

/* ================================================================
   Child tabs (fg-child-tabs): shared compact catalog-like tab style.
   Nested child tabs are rendered as text subtabs.
   ================================================================ */
.fg-child-tabs > .mud-tabs > .mud-tabs-tabbar {
    background-color: unset !important;
    box-shadow: none !important;
    margin-bottom: 28px !important;
    height: 36px !important;
    min-height: 36px !important;
}

.fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab,
.fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tooltip-root.mud-tooltip-inline {
    min-width: unset !important;
    min-height: 36px !important;
    height: 36px !important;
    padding: 9px 16px !important;
    border-radius: 22px 22px 0 0 !important;
    background-color: #FFFFFF !important;
    color: #1E1E1E !important;
    font-family: 'Inter', sans-serif;
    font-size: 14px !important;
    line-height: 18px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab:hover {
    background-color: #F4EEF9 !important;
    color: #542A80 !important;
}

.fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab:focus-visible {
    box-shadow: inset 0 0 0 2px #A881D3 !important;
    outline: none !important;
}

.fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab-active,
.fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab-active:hover {
    background-color: #542A80 !important;
    color: #FFFFFF !important;
}

.fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab-active .d-flex,
.fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab-active .d-flex *:not(.tab-count-badge) {
    color: #FFFFFF !important;
}

.fg-child-tabs .tab-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 23px;
    height: 23px;
    padding: 0 5px;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    margin-left: 8px;
    background-color: #A881D3 !important;
    color: white !important;
    box-sizing: border-box;
}

.fg-child-tabs .mud-tab-active .tab-count-badge {
    background-color: white !important;
    color: #542A80 !important;
}

.fg-child-tabs .mud-tabs-slider,
.fg-child-tabs .mud-tab-slider {
    display: none !important;
}

.fg-child-tabs .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar {
    margin-bottom: 18px !important;
}

.fg-child-tabs .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .d-inline-block {
    margin-right: 38px;
}

.fg-child-tabs .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .d-inline-block:last-of-type {
    margin-right: 0;
}

.fg-child-tabs .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab,
.fg-child-tabs .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tooltip-root.mud-tooltip-inline {
    position: relative;
    min-width: unset !important;
    min-height: unset !important;
    height: auto !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    color: #A881D3 !important;
    font-family: 'Inter', sans-serif;
    font-size: 18px !important;
    line-height: 22px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    transition: color 0.15s ease;
    text-decoration: none !important;
}

.fg-child-tabs .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab:hover {
    background-color: transparent !important;
    color: #542A80 !important;
}

.fg-child-tabs .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab:not(.mud-tab-active):hover::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -5px;
    height: 2px;
    background-color: #A881D3;
    border-radius: 1px;
}

.fg-child-tabs .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab:focus-visible {
    outline: 2px solid #A881D3 !important;
    outline-offset: 4px !important;
    border-radius: 2px !important;
}

.fg-child-tabs .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab-active,
.fg-child-tabs .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab-active:hover {
    background-color: transparent !important;
    color: #542A80 !important;
}

.fg-child-tabs .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab-active .d-flex,
.fg-child-tabs .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab-active .d-flex *:not(.tab-count-badge) {
    color: #542A80 !important;
}

@media (max-width: 599.98px) {
    .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab,
    .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tooltip-root.mud-tooltip-inline {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .fg-child-tabs .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .d-inline-block {
        margin-right: 20px;
    }

    .fg-parent-tabs .mud-tabs-tabbar .mud-tab,
    .fg-parent-tabs .mud-tabs-tabbar .mud-tooltip-root.mud-tooltip-inline {
        max-width: 160px;
        padding: 6px 10px;
        font-size: 15px;
        line-height: 20px;
        white-space: nowrap !important;
    }

    .fg-parent-tabs .mud-tabs-tabbar .mud-tab .mud-tab-text,
    .fg-parent-tabs .mud-tabs-tabbar .mud-tooltip-root.mud-tooltip-inline .mud-tab-text,
    .fg-parent-tabs .mud-tabs-tabbar .mud-tab .d-flex,
    .fg-parent-tabs .mud-tabs-tabbar .mud-tooltip-root.mud-tooltip-inline .d-flex {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap !important;
    }

    .stock-tab-label {
        font-size: 0;
        line-height: 0;
    }

    .stock-tab-label::after {
        content: attr(data-mobile-label);
        display: inline;
        font-size: 15px;
        line-height: 20px;
    }

    .fg-parent-tabs .mud-tabs-prev-button,
    .fg-parent-tabs .mud-tabs-next-button {
        flex: 0 0 32px;
        min-width: 32px;
        width: 32px;
    }
}

/* Keep child-tab labels complete; MudTabs owns horizontal tab navigation. */
@media (max-width: 599.98px) {
    /* MudTabs translates its wrapper; native scroll would shift the tabs twice. */
    .fg-parent-tabs .mud-tabs-tabbar-content,
    .fg-child-tabs .mud-tabs-tabbar-content {
        min-width: 0;
        overflow: clip;
    }

    .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab {
        max-width: none;
        flex-shrink: 0;
    }
    .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .mud-tab .d-flex {
        max-width: none;
        overflow: visible;
    }
    .fg-child-tabs > .mud-tabs > .mud-tabs-tabbar .stock-tab-label::after {
        font-size: 13px;
        line-height: 18px;
    }
}
