.rb-view-switch {
    display: inline-flex;
    align-items: stretch;
    flex-shrink: 0;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid #cfd4dc;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(20, 34, 66, 0.08);
    --rb-switch-slope: 14px;
}

.rb-page-title-row,
.rbl-page-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.rb-view-switch-row {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.rb-view-switch-hint {
    color: #dc2626;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.rb-view-switch-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 128px;
    height: 46px;
    padding: 0 32px;
    border: none;
    border-radius: 0;
    background: #fff;
    color: #4b5563;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: none;
    box-sizing: border-box;
    transition: background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.rb-view-switch-btn:first-child {
    z-index: 1;
    padding-right: calc(32px + var(--rb-switch-slope));
    clip-path: polygon(
        0 0,
        calc(100% - var(--rb-switch-slope)) 0,
        100% 100%,
        0 100%
    );
    border-top-left-radius: 7px;
    border-bottom-left-radius: 7px;
}

.rb-view-switch-btn:last-child {
    z-index: 0;
    margin-left: calc(var(--rb-switch-slope) * -1);
    padding-left: calc(32px + var(--rb-switch-slope));
    clip-path: polygon(
        var(--rb-switch-slope) 0,
        100% 0,
        100% 100%,
        0 100%
    );
    border-top-right-radius: 7px;
    border-bottom-right-radius: 7px;
}

.rb-view-switch-btn:not(.is-active) {
    background: #fff;
    color: #4b5563;
    font-weight: 500;
    box-shadow: none;
}

.rb-view-switch-btn.is-active {
    z-index: 2;
    background: linear-gradient(135deg, #ffb468 0%, #e47a0e 55%, #cc6200 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.rb-view-switch-btn:not(.is-active):hover {
    background: #f9fafb;
    color: #374151;
    text-decoration: none;
}

.rb-view-switch-btn.is-active:hover {
    background: linear-gradient(135deg, #ffa854 0%, #d9720c 55%, #b85800 100%);
    color: #fff;
    text-decoration: none;
}

.rb-page-header a.rb-view-switch-btn,
.rb-page-header a.rb-view-switch-btn:link,
.rb-page-header a.rb-view-switch-btn:visited,
.rb-page-header a.rb-view-switch-btn:hover,
.rb-page-header a.rb-view-switch-btn:active,
.rb-page-switch-panel a.rb-view-switch-btn,
.rb-page-switch-panel a.rb-view-switch-btn:link,
.rb-page-switch-panel a.rb-view-switch-btn:visited,
.rb-page-switch-panel a.rb-view-switch-btn:hover,
.rb-page-switch-panel a.rb-view-switch-btn:active,
.readybulk-list-page a.rb-view-switch-btn,
.readybulk-list-page a.rb-view-switch-btn:link,
.readybulk-list-page a.rb-view-switch-btn:visited,
.readybulk-list-page a.rb-view-switch-btn:hover,
.readybulk-list-page a.rb-view-switch-btn:active {
    display: inline-flex !important;
    width: auto !important;
    height: 46px !important;
    min-height: 46px !important;
    line-height: 1 !important;
}

.rb-page-header,
.rb-page-switch-panel,
.rb-page-search-panel {
    position: relative;
    z-index: 1;
    max-width: 1500px;
    margin: 0 auto 12px;
    padding: 16px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(20, 34, 66, 0.06);
    box-sizing: border-box;
}

.rb-page-search-panel {
    margin-bottom: 16px;
}

.rb-page-header-search {
    width: 100%;
    max-width: none;
    margin-left: 0;
}

.rb-page-header-search.keywordsearch {
    width: 100%;
    max-width: none;
    margin-left: 0;
    height: auto !important;
    clear: none !important;
}

.rb-page-header-search .typeahead__field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.readybulk-list-page .rbl-page-header {
    padding: 14px 20px;
}

@media (max-width: 960px) {
    .rb-view-switch {
        width: 100%;
    }

    .rb-view-switch-btn {
        flex: 1 1 50%;
        min-width: 0;
        padding: 0 16px;
    }

    .rb-view-switch-btn:first-child {
        padding-right: calc(16px + var(--rb-switch-slope));
    }

    .rb-view-switch-btn:last-child {
        padding-left: calc(16px + var(--rb-switch-slope));
    }
}
